-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[Windows] ☂️ Add support for Arm64 as a target #62597
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
Comments
- Rolls buildroot to pick up flutter/buildroot#389 - Adds support to the gn wrapper for setting the traget CPU on Windows Attempting to generate Windows arm64 GN files will currently fail, due to lack of arm64 support for an OpenGL test support target, but this sets the foundation, and makes experimentation easier. Part of flutter/flutter#62597
- Rolls buildroot to pick up flutter/buildroot#389 - Adds support to the gn wrapper for setting the traget CPU on Windows Attempting to generate Windows arm64 GN files will currently fail, due to lack of arm64 support for an OpenGL test support target, but this sets the foundation, and makes experimentation easier. Part of flutter/flutter#62597
@stuartmorgan it seems like dart-lang/sdk#47824 was merged, so this is mostly technically unblocked? I do have a Surface Pro X, which is Arm64, so I want to help. |
Interesting, I didn't realize that was on the Dart team's radar. I played around with this quite a while ago and got a PoC of the Dart part compiling, but then ran into the issue that it would require cross-building support, or for the entire compilation of the Flutter engine to be on aarm64 (bullet point #2). Does cross-compilation work at the Dart level (i.e., can Dart AOT compilation be done for arm64, but from an x64 machine)? If not you could experiment with getting flutter/engine building on arm64, but getting from there to (/cc @cbracken ) |
Doesn't seem like cross compilation is a thing yet (dart-lang/sdk#28617). I can try to start things on my Surface Pro X, but that seems challenging. I'll see how far I can get. |
Aside from the compilation of the C++ bits, there's also gen_snapshot and the Dart compilation. Today we can generate a gen_snapshot binary that runs on x64 host and targets arm64, but it is not currently possible (without a significant amount of work from the Dart team) to build a gen_snapshot binary that runs on arm64 and targets x64 because there is no simx64 support in the Dart SDK. On macOS, this isn't a huge problem since we can run x64 code on arm64 macs via Rosetta. It looks like this may be possible on Windows 11 and later. It also looks like there was a preview release for Windows 10 based on this Windows blog post but it's unclear if a final version will be available. |
Nice! Given the current distribution of machines, that's the most important thing for us to have to get something working end-to-end. |
@cbracken I believe we should look at these issues as separate issues. The way I see it, we have two options to unblock Arm64 Flutter apps on Windows 10/11:
Since cross compilation seems like a harder subject to tackle, and since Arm64 hardware on the cloud is starting to be a reality (e.g. Azure already has a public preview of Arm64 VMs), working with option number 2 seems like a better approach. This would unblock developers to build their Flutter apps for Windows 10 Arm64 + Windows 11 Arm64, as well as enabling them to use Arm64 hosts to build their apps locally, with the same great developer tools that work today on Intel x64, with minimal focus on cross compilation. Does that seem reasonable? If so, would you be willing to help me drill this down a bit into actionable things to do? I would love to see this become a reality, specially since Microsoft announced Project Volterra. |
The first goal though would be to get the engine cross-compiling (x64->arm64), or compiling natively on arm64, or both. (And if only the later, a CI solution for creating engine artifacts). Without that we can't do anything at the tool level. |
Correct. The minimum set of steps required to be able to develop Flutter apps that target Windows arm64 devices from an x64 host machine is something like (I'm sure I'm missing a pile of items):
The following would be necessary to upgrade Windows ARM64 from a "best-effort" platform to a "google-tested" platform:
|
I'm late to this party and I don't know much about compiling for different architectures, but I have Visual Studio 2022 for ARM64, and Flutter installed on my Surface Pro X, and was able to build for x64. While most devs are probably building on a x64 host, maybe you can provide support faster by targeting an ARM64 host? Especially since Microsoft is set to release that fancy new ARM64 dev box soon. |
Yes, targeting an ARM64 host is probably an easier path forward. Visual Studio 2022 17.3 Preview 2+ runs as an ARM64 process on WIndows 11, and the toolchain should follow, so this is the least resistance path. |
Hello, I've been able to compile a native flutter app for arm64 (native build, no cross compilation). This is documented on Linaro's Windows on Arm wiki. However, I needed to hack through flutter build scripts (see details here). The goal is to upstream all that, starting first with dart-sdk. Just wanted to say there does not seem to be any blocking issue for native build. Cross compilation will be next target. |
Great news! |
From which version will we have the support ready? |
The |
#53120 tracks supporting Windows arm64 as a development environment; this is for being able to build Flutter Windows applications that run on arm64.
This would require:
bringup
--target-platform
option #129808The text was updated successfully, but these errors were encountered: