-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Work around VS CMake generation bug #98945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work around VS CMake generation bug #98945
Conversation
Visual Studio 2022 17.1.0 ships a version of CMake whose generator doesn't handle custom build commands correctly: instead of generating one command per config that uses the correct `$<CONFIG>` value, it generates multiple copies per configuration, one with each value of `$<CONFIG>`, and only one of them is actually used. In practice, due to the way VS resolves the incorrect duplication, it's always Release for a flutter project, which causes the call to `assemble` to use the wrong mode for debug builds, preventing them from launching. This works around the generation bug, as a temporary measure until a fixed version of Visual Studio is released, by rewriting the generated project file to have the correct configuration value in each call. To avoid this workaround potentially causing issues in the future, this limits the workaround to just 17.1.x. If a newer version of VS is shipped that doesn't contain a fix, the constraints will need to be updated. Fixes flutter#97086
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
I've changed the check to exactly 17.1.0, since we now have confirmation that the fix should be in 17.1.1. @cbracken I'll leave it up to you whether you want to go forward with landing this, or just wait until 17.1.1 ships. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm for the change. I think we should land it given that it'll take some time for the fix to roll out and some further time for users to all pick this up -- e.g. I can imagine strict corporate update policies in some companies.
We should add a TODO here to strip this back out after some time limit. Maybe when we drop support for VS 2022.
|
TODO added. |
* Work around VS CMake generation bug (#98945) * 'add branch flutter-2.8-candidate.16 to enabled_branches in .ci.yaml' * 'Update Engine revision to bd539267b42051b0da3d16ffa8f48949dce8aa8f for stable release 2.10.3' * remove branch ref * remove consumer deps test Co-authored-by: stuartmorgan <[email protected]> Co-authored-by: Christopher Fujino <[email protected]>
…er#99337) * Work around VS CMake generation bug (flutter#98945) * 'add branch flutter-2.8-candidate.16 to enabled_branches in .ci.yaml' * 'Update Engine revision to bd539267b42051b0da3d16ffa8f48949dce8aa8f for stable release 2.10.3' * remove branch ref * remove consumer deps test Co-authored-by: stuartmorgan <[email protected]> Co-authored-by: Christopher Fujino <[email protected]>
Visual Studio 2022 17.1.0 ships a version of CMake whose generator
doesn't handle custom build commands correctly: instead of generating
one command per config that uses the correct
$<CONFIG>value, itgenerates multiple copies per configuration, one with each value of
$<CONFIG>, and only one of them is actually used. In practice, due tothe way VS resolves the incorrect duplication, it's always Release for a
flutter project, which causes the call to
assembleto use the wrongmode for debug builds, preventing them from launching.
This works around the generation bug, as a temporary measure until a
fixed version of Visual Studio is released, by rewriting the generated
project file to have the correct configuration value in each call.
This limits the workaround to just 17.1.0, as 17.1.1 should contain
a fix.
Fixes #97086
Pre-launch Checklist
///).