Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Conversation

@loic-sharma
Copy link
Member

Use Visual Studio 2019 to build the engine. This code was modified from Chromium: https://source.chromium.org/chromium/chromium/src/+/main:build/vs_toolchain.py;l=22-48

This is the draft pull request to update the engine: flutter/engine#36538

This is a requirement to roll ANGLE as it is affected by an STL bug if built using Visual Studio 2017: angleproject#7693

Part of: flutter/flutter#110948

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

Looks like GetVisualStudioVersion is still used elsewhere for setting environment variables and by DetectVisualStudioPath, which is only used to set environment variables, some of which are used later.

Given the GYP_ prefix, looks like they were never updated to GN_ during the gyp to gn migration. I wonder what, if anything, other than this script depends on these. I wouldn't try to fix that in this patch and I won't mention which person declared victory (apparently preemptively) after removing the last vestiges of gyp a couple years ago.

MSVS_VERSIONS = collections.OrderedDict([
('2017', '15.0'),
('2019', '16.0'),
('2017', '15.0'),
Copy link
Contributor

@a-wallen a-wallen Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this line (2017) swapped with the previous (2019)?

It looks like the order matters here,

# in GetVisualStudioVersion
supported_versions_str = ', '.join('{} ({})'.format(v,k)
      for k,v in list(MSVS_VERSIONS.items()))
# looks through supported versions to find which are currently available..
return available_versions[0] # will return 2019 if 2019 is found

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that's right, these are ordered by priority. There's a comment above this, let me know if you have suggestions to improve clarity:

https://github.com/flutter/buildroot/blob/master/build/vs_toolchain.py#L37

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Looked like the mystery crash that prevented me from doing this a long time ago is gone 🎉

@loic-sharma loic-sharma merged commit 24bd842 into flutter:master Oct 3, 2022
@loic-sharma loic-sharma deleted the vs2019 branch October 3, 2022 17:08
loic-sharma added a commit that referenced this pull request Oct 5, 2022
loic-sharma added a commit that referenced this pull request Oct 5, 2022
Reverts #632

After #632, the buildroot cannot be rolled to the engine without the corresponding changes in flutter/engine#36606. However, flutter/engine#36606 was reverted as it broke the Flutter tree. This reverts #632 to allow buildroot to engine rolls while I figure out the bug that broke the tree.

Revert issue: flutter/flutter#112894
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants