Skip to content

feat: Support local Windows arm64 engine build - #191560

Open
Gustl22 wants to merge 10 commits into
flutter:masterfrom
Gustl22:96138-vs-2026-engine
Open

Gustl22 wants to merge 10 commits into
flutter:masterfrom
Gustl22:96138-vs-2026-engine

Conversation

@Gustl22

@Gustl22 Gustl22 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Support building Windows Flutter Engine for Arm64 on an ARM host.
Also adds support for building with Visual Studio 18 (2026) on ARM.

Tested locally via et build -c host_debug_unopt_arm64 on an ARM machine.
CI Testing blocked by #96138, #193413

Towards #137161 / #62597

Further resource: https://flutter.dev/go/windows-arm64

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.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. team-engine Owned by Engine team d: docs/ flutter/flutter/docs, for contributors labels Aug 23, 2026
@Gustl22
Gustl22 force-pushed the 96138-vs-2026-engine branch from 2883bd1 to c78ce27 Compare August 23, 2026 20:42
@Gustl22

Gustl22 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor Author

I also had to turn off incremental linking in flutter\engine\src\build\config\win\BUILD.gn, but I am not sure, whether this is a only me, ARM, or a VS 2026 problem:

default_incremental_linking_switch = incremental_linking_off_switch

Also used a newer Windows SDK version in setup_toolchain.py: SDK_VERSION = '10.0.26100.0', but should work with old ones, too.

@Gustl22
Gustl22 marked this pull request as ready for review September 1, 2026 05:49
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@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 the Windows development environment documentation to require Visual Studio 2019 or later and the Windows SDK, modifies vs_toolchain.py to support Visual Studio installations using numeric version folders, and adds a new windows/host_debug_unopt_arm64 builder configuration. Review feedback suggests simplifying the Visual Studio version fallback logic in vs_toolchain.py using dict.get with a default value, and updating an exception message to refer to 'Windows SDK' instead of 'Windows 10 SDK' for consistency with the documentation changes.

Comment on lines +271 to +276
vc_version = VC_VERSIONS.get(env_version)
if not vc_version:
# Fall back to MSVS version, when not installed by year
vc_version = VC_VERSIONS.get(MSVS_VERSION_ALIASES.get(env_version))
if not vc_version:
raise KeyError(env_version)

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.

medium

The fallback logic for looking up the Visual Studio version can be simplified by using dict.get with a default value. This avoids nested conditional checks and redundant dictionary lookups, making the code cleaner and more readable.

Suggested change
vc_version = VC_VERSIONS.get(env_version)
if not vc_version:
# Fall back to MSVS version, when not installed by year
vc_version = VC_VERSIONS.get(MSVS_VERSION_ALIASES.get(env_version))
if not vc_version:
raise KeyError(env_version)
year_version = MSVS_VERSION_ALIASES.get(env_version, env_version)
vc_version = VC_VERSIONS.get(year_version)
if not vc_version:
raise KeyError(env_version)

@Gustl22 Gustl22 Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually I find the current implementation more intuitive to follow than hidden in the get logic. But no hard feelings about that.

Comment thread engine/src/build/vs_toolchain.py
@Gustl22

Gustl22 commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Note: With VS 2026, one cannot select Windows 10 SDK (only version 10.x, but its actually Windows 11 SDK). So to not raise confusion I would only refer to it as "Windows SDK" without stating hard versions for local engine build. The underlaying issue was resolved, as far as I can tell: https://crbug.com/773476

grafik

Regarding the missing tests: as native ARM pipeline is currently not supported and VS 2026 CIPD is not available (#96138) testing this gets quite difficult. But that's why this PR can set the path towards automating the tests in the future. A chicken-egg-problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

d: docs/ flutter/flutter/docs, for contributors engine flutter/engine related. See also e: labels. team-engine Owned by Engine team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant