Work around VS CMake generation bug#98945
Merged
fluttergithubbot merged 5 commits intoflutter:masterfrom Feb 26, 2022
Merged
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
Contributor
Author
|
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. |
cbracken
approved these changes
Feb 25, 2022
Member
There was a problem hiding this comment.
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.
Contributor
Author
|
TODO added. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 26, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 26, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 26, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 27, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 27, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 27, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 28, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 28, 2022
itsjustkevin
added a commit
that referenced
this pull request
Mar 2, 2022
* 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]>
clocksmith
pushed a commit
to clocksmith/flutter
that referenced
this pull request
Mar 8, 2022
IvanLipotan
pushed a commit
to IvanLipotan/flutter
that referenced
this pull request
Mar 8, 2022
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
///).