Skip to content

[flutter_tools] Respect mustMatchAppBuild on Windows native assets#186788

Merged
auto-submit[bot] merged 7 commits into
flutter:masterfrom
Vonarian:fix-windows-native-assets-must-match
Jul 13, 2026
Merged

[flutter_tools] Respect mustMatchAppBuild on Windows native assets#186788
auto-submit[bot] merged 7 commits into
flutter:masterfrom
Vonarian:fix-windows-native-assets-must-match

Conversation

@Vonarian

Copy link
Copy Markdown
Contributor

Addresses the TODO to support the mustMatchAppBuild option in the Windows native assets compiler configuration. If Visual Studio is not found and mustMatchAppBuild (throwIfNotFound) is true, throws a ToolExit. Otherwise, returns null.

This PR updates the Windows native assets compiler configuration cCompilerConfigWindows to accept a required bool throwIfNotFound parameter and respects it (resolving a pending TODO in targets.dart).

  • When Visual Studio or any of its necessary tools (compiler, archiver, linker, or environment script) are missing, and throwIfNotFound is true, a ToolExit is thrown.
  • Otherwise, if throwIfNotFound is false, it returns null to avoid exiting the tool in non-build scenarios.
  • Unit tests have been added to verify that cCompilerConfigWindows behaves correctly in both the missing-and-required case and the missing-and-not-required case.

Fixes the pending TODO in targets.dart: // TODO(simolus3): Respect the mustMatchAppBuild option in cCompilerConfigWindows.

Pre-launch Checklist

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

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@Vonarian
Vonarian requested a review from a team as a code owner May 20, 2026 07:33
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-windows Owned by the Windows platform team labels May 20, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 updates cCompilerConfigWindows to include a throwIfNotFound parameter, enabling it to throw a ToolExit when the Visual Studio toolchain is missing. The WindowsAssetTarget class was updated to pass this parameter, and unit tests were added to cover the new logic. Feedback was provided to add documentation to the updated public method to comply with the Flutter style guide.

Addresses the TODO to support the mustMatchAppBuild option in the Windows native assets compiler configuration. If Visual Studio is not found and mustMatchAppBuild (throwIfNotFound) is true, throws a ToolExit. Otherwise, returns null.
@Vonarian
Vonarian force-pushed the fix-windows-native-assets-must-match branch from d5f2bb6 to c58a193 Compare May 20, 2026 13:54
@loic-sharma
loic-sharma requested a review from dcharkes May 21, 2026 21:37
@dcharkes dcharkes added the CICD Run CI/CD label May 22, 2026

@dcharkes dcharkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes LGTM.

Kicking off CI to see if it's green.

@github-actions github-actions Bot removed the CICD Run CI/CD label May 23, 2026
@loic-sharma loic-sharma added the CICD Run CI/CD label Jun 22, 2026
@flutter-dashboard

Copy link
Copy Markdown

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jul 13, 2026
@dcharkes dcharkes added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jul 13, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 13, 2026
@auto-submit

auto-submit Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/186788, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a member of flutter-hackers before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@dcharkes
dcharkes requested a review from bkonyi July 13, 2026 11:09
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 13, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jul 13, 2026
Merged via the queue into flutter:master with commit e1f6e44 Jul 13, 2026
173 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 13, 2026
@Vonarian
Vonarian deleted the fix-windows-native-assets-must-match branch July 14, 2026 08:12
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 14, 2026
flutter/flutter@cf9e8af...846664b

2026-07-14 engine-flutter-autoroll@skia.org Roll Skia from dfcff99566c3 to 88954ef8f36d (1 revision) (flutter/flutter#189440)
2026-07-14 34465683+rkishan516@users.noreply.github.com refactor: remove material import from scrollable_semantics_test and selectable_region_context_menu_test (flutter/flutter#186611)
2026-07-14 engine-flutter-autoroll@skia.org Roll Skia from 3d1fc554f1a2 to dfcff99566c3 (17 revisions) (flutter/flutter#189428)
2026-07-14 engine-flutter-autoroll@skia.org Roll Dart SDK from 2c587df8f05a to 05bf153370c4 (5 revisions) (flutter/flutter#189426)
2026-07-14 nshahan@google.com [flutter_tools] Remove web hot reload flag (flutter/flutter#185994)
2026-07-14 chris@bracken.jp [iOS] Fix flaky keyboard animation test (flutter/flutter#189353)
2026-07-14 flar@google.com [Impeller] Playground expanded role (flutter/flutter#188889)
2026-07-14 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#189409)
2026-07-13 6655696+guidezpl@users.noreply.github.com Update lock-threads dependency to 6.0.2 (flutter/flutter#189053)
2026-07-13 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 6.1.0 to 6.2.0 in the all-github-actions group (flutter/flutter#189396)
2026-07-13 116356835+AbdeMohlbi@users.noreply.github.com Remove  outdated todo about `analysis bug on Windows` and update condition to also perform `analysis on windows` (flutter/flutter#189283)
2026-07-13 ahmedsameha1@gmail.com Add more 0x0 size tests part 4 (flutter/flutter#185187)
2026-07-13 engine-flutter-autoroll@skia.org Roll Packages from 20928d5 to ad2eab1 (18 revisions) (flutter/flutter#189387)
2026-07-13 bkonyi@google.com [flutter_tools] Fix ADB device listing output parsing regression (flutter/flutter#189369)
2026-07-13 magder@google.com Stop running most Mac x64 builders that have Mac ARM equivalents on master (flutter/flutter#189301)
2026-07-13 magder@google.com Move a few benchmarks from x64 Intel Macs to ARM (flutter/flutter#189377)
2026-07-13 34871572+gmackall@users.noreply.github.com Add note that `hcpp` needs impeller (flutter/flutter#189382)
2026-07-13 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from vhIlDkWIy21IrlB9E... to oOETA0ISPouDt2xBo... (flutter/flutter#189349)
2026-07-13 68429735+Vonarian@users.noreply.github.com [flutter_tools] Respect mustMatchAppBuild on Windows native assets (flutter/flutter#186788)
2026-07-13 engine-flutter-autoroll@skia.org Roll Skia from 8bf65996caba to 3d1fc554f1a2 (2 revisions) (flutter/flutter#189350)
2026-07-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 0fc1668c4af4 to 2c587df8f05a (9 revisions) (flutter/flutter#189351)
2026-07-13 1961493+harryterkelsen@users.noreply.github.com [web] Fall back to full CJK fonts for characters not covered by split slices (flutter/flutter#188890)
2026-07-13 magder@google.com Take Mac tool_integration_tests_* out of bringup (flutter/flutter#189368)
2026-07-13 dacoharkes@google.com [hooks] Roll record_use to 1.0 and unpin (flutter/flutter#189366)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC louisehsu@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop CICD Run CI/CD team-windows Owned by the Windows platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants