-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable]Add support for Visual Studio 2026 #178450
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
[CP-stable]Add support for Visual Studio 2026 #178450
Conversation
Adds a mapping for Visual Studio 2026 to the `cmakeGenerator` property used to drive Windows builds, enabling Flutter to be used for development on a system with Visual Studio 2026 installed and not Visual Studio 2022 or Visual Studio 2019. Closes: flutter#176399 Related-To: flutter#93426 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
|
@bkonyi please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
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.
Code Review
This pull request adds support for Visual Studio 2026 by updating the CMake generator logic and adding a corresponding test case. My review identifies a missing update for user-facing component descriptions in visual_studio.dart and suggests refactoring duplicated test logic in visual_studio_test.dart for better maintainability.
| String? get cmakeGenerator { | ||
| // From https://cmake.org/cmake/help/v3.22/manual/cmake-generators.7.html#visual-studio-generators | ||
| return switch (_majorVersion) { | ||
| 18 => 'Visual Studio 18 2026', |
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.
While adding support for VS 2026 here is correct, a related part of the code seems to have been missed. The _requiredComponents method, which provides user-facing descriptions for necessary components, has not been updated for VS 2026 (or VS 2022). It will default to showing information for VS 2019's C++ build tools, which could be confusing for users with newer Visual Studio versions who are missing components.
As per the comment in _requiredComponents, the switch statement should be updated to include cases for versions 17 and 18 with the appropriate toolchain descriptions.
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.
This is nice to have for improved flutter doctor, but not strictly necessary. Since this is a stable cherry pick, let's skip.
packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart
Show resolved
Hide resolved
444b8c3
into
flutter:flutter-3.38-candidate.0
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#176399
Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples
Visual Studio 2026 is not supported when compiling Windows desktop applications.
Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)
Developers that only have Visual Studio 2026 installed are unable to compile Windows applications.
Workaround:
Is there a workaround for this issue?
Install an older version of Visual Studio.
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
flutter run -d windowsto run a Windows desktop application.