Repository navigation
☂️ Add support for ARM macOS host #60118
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.platform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Umbrella issue tracking developing Flutter on macOS ARM.
Use case: developer buys ARM Mac, installs Flutter tooling on the Mac, deploys Flutter to an iPhone.
- Build tool on macOS ARM
- Build ARM host dependencies (iproxy, libimobiledevice). Rosetta translation?
- IDE support
- Infrastructure support
Note: this is tracking host-side issues. Running Flutter on ARM macOS as a target is tracked by #60113.
Wiki page: https://github.com/flutter/flutter/wiki/Developing-with-Flutter-on-Apple-Silicon
Update: Flutter should be fully working on M1 with Rosetta translation (particularly tooling and iOS simulator). The remaining work is to get it working natively without Rosetta.
Infrastructure
- Add Mac M1 ARM machines to the prod pool #87508 Add Mac M1 ARM machines to the prod pool
Native host development (flutter tool)
- Build arm64 during Mac Host Engine build #84453
- Build Flutter macOS artifacts with ARM architecture slice #69157 (ios-deploy, libimobiledevice, etc)
- Ship apple silicon dart SDK binaries now that Dart 2.14.0-281.0.dev and higher have arm64 builds available for download #86926
- Run the SDK packaging recipe on an arm64 macOS host #97658
- Build macOS desktop
gen_snapshot_arm64andgen_snapshot_x64as arm64 binary to run natively on Apple Silicon #101138
Completed
Sub-issues
- Update iOS and macOS engine builders to Xcode 12.0 #84601 Update iOS and macOS engine builders to Xcode 12.0
- [flutter_tools] separate target platform, host platform, and architecture #60119 [flutter_tools] separate target platform, host platform, and architecture
- Building flutter tool on ARM macOS host fails dart-lang/sdk#42534 Building flutter tool on ARM macOS host fails
- Dart SDK support for macOS arm64 (Apple Silicon) dart-lang/sdk#42773 Dart SDK version is built for macOS ARM host
- Setup Flutter engine environment and build engine on M1 (Apple Silicon ARM64) #96745 Support building the engine on macOS ARM hosts
Physical devices
- "flutter build ios" fails on ARM macOS, ibtoold crashes compiling xcassets/storyboards #65133 "flutter build ios" fails on ARM macOS, ibtoold crashes compiling xcassets/storyboards
- [doctor] Add macOS architecture to doctor output #65976 (comment) Add macOS architecture to doctor output for host
- Add mac m1 machines to the staging pool #79430 Add mac m1 machines to the staging pool
Simulator
- iOS engine artifacts Flutter.xcframework contains old architecture triples directories #85062 iOS engine artifacts Flutter.xcframework contains old architecture triples directories
- Update Flutter Engine recipes to handle ARM64 simulator #84672 Update Flutter Engine recipes to handle ARM64 simulator
- Adding ARM iOS simulator times out the engine artifacts build #82736 Adding ARM iOS simulator times out the engine artifacts build
- engine gn updates required for simulator on macOS arm #66926 engine gn updates required for simulator on macOS arm
- b/162290052 Cannot launch Android emulators
- Distribute engine as Flutter.xcframework #60109 Distribute engine as Flutter.xcframework
- Deprecate --universal flag in "flutter build ios-framework" #69718 Deprecate
flutter build ios-framework --universal - Mac LUCI builders' Xcode should include iOS 14 SDK #65901 XCode SDK needs to be updated on mac LUCI builders
- flutter engine on iOS arm simulator does not build #66925 flutter engine on iOS arm simulator does not build
- Update engine script create_ios_framework to optionally take ARM simulator path #73066 Update engine script create_ios_framework to optionally take ARM simulator path
- Add buildroot support for ARM64 simulator builds #84670 Add buildroot support for ARM64 simulator engine builds
- Add ARM simulator architecture slice to App.framework to support Apple Silicon #69334 Add ARM simulator architecture slice to App.framework to support Apple Silicon
- Flutter cannot build against ARM simulators (on ARM macOS host) #64502 Flutter cannot build against iOS ARM simulators (on ARM macOS host)
- When plugins do not support ARM iOS simulators, the app fails to build #85713 When plugins do not support ARM iOS simulators, the app fails to build
Plugin support
- Work around ffi "symbol not found" error from CocoaPods on ARM Macs with x86_64 ffi gem #70796 Work around ffi "symbol not found" error from CocoaPods
- SEVG on Apple silicon macOS ffi/ffi#800 SEVG on Apple silicon macOS
- Support Apple Silicon ARM simulators invertase/firestore-ios-sdk-frameworks#16 firestore-ios-sdk-frameworks pre-built xcframeworks should support Apple Silicon ARM simulators
- Apple Silicon CocoaPods workaround issue #73686 CocoaPods Rosetta workaround has issues
- Mark google_maps_flutter as not supporting arm64 iOS simulators #87242 Mark google_maps_flutter as not supporting arm64 iOS simulator
- Mark google_sign_in as not supporting arm64 iOS simulators #87243 Mark google_sign_in as not supporting arm64 iOS simulators
- When plugins do not support ARM iOS simulators, the app fails to build #85713
Tracking Apple Silicon as a target device separately at #60113.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.platform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
cbenhagen commentedon Jun 30, 2020
Building flutter tool on ARM macOS host currently fails with:
Leaving this here so it can be found by a google search. But maybe it should be moved to a separate issue?
jmagman commentedon Jun 30, 2020
Yes, can you file a separate issue? I heard about this but we don't have DTKs yet. I'll link it back to this umbrella meta issue.
jmagman commentedon Jun 30, 2020
@cbenhagen Can you file in https://github.com/dart-lang/sdk ?
cbenhagen commentedon Jun 30, 2020
Done: dart-lang/sdk#42534
christopherfujino commentedon Jul 8, 2020
Just to cross reference, tracking linux arm host support on #56992
alexmarkley commentedon Sep 19, 2020
I'm happy to report that my experience with Flutter master branch on Apple Silicon / DTK has been much better than others early experiences ( ala dart-lang/sdk#42534 ). At this point Rosetta seems to be able to run most of the host tooling, and I am able to target iOS using the generated Xcode project.
Per #65132 the
flutter runtool is still not working. Also, per #64502 the simulator does not work correctly on ARM hosts.However, and I think this is super cool, actually building and running the Flutter application on-device using Xcode 12.2 Beta is working as expected. I can even use
flutter attachto observe and interact with the running application!If I am able to get my local development environment to work correctly ( dart-lang/sdk#43488 ) I'm optimistic that I can participate in the porting effort to get the tooling running natively on the ARM host.
jmagman commentedon Oct 1, 2020
flutter run -d macosworked out of the box (as a rosetta app):xster commentedon Oct 1, 2020
@jmagman I think we were talking about "XCode SDK needs to be updated on mac LUCI builders" just now. Should that be better named as "mac LUCI builders' Xcode need to use the iOS 14 SDK"?
22 remaining items
xster commentedon Dec 14, 2020
Should we leave #64502 and create a separate bug for running iOS simulator on rosetta?
jmagman commentedon Dec 14, 2020
#72294
xster commentedon Jan 25, 2021
Created #74662 to wrap up documentation for the next stable
jmagman commentedon Mar 5, 2021
On Flutter 2 deploying your app in Rosetta mode to the iOS simulator with the command line tool
flutter run/flutter build ios --simulator, or from a Flutter IDE plugin should work. Targeting the iOS simulator from Xcode is supported without manual project changes as of #73828, which is currently available on the master channel.jmagman commentedon Jul 1, 2021
Native arm64 iOS simulator without Rosetta now available as of #85642.
cbracken commentedon May 12, 2022
Engine building on arm64 mac hosts as of flutter-team-archive/engine#33244
jmagman commentedon May 13, 2022
There are also arm64 Mac tests running like
flutter/.ci.yaml
Line 3122 in 708c363
This is complete. We can track the ew remaining x64 binaries separately at #69157.
cbracken commentedon May 13, 2022
SGTM. We're now generating arm64/arm64 (as well as x64/simarm64) binaries for gen_snapshot in macOS engine host builds. I'm happy to take a look at getting a lipo'ed universal binary for gen_snapshot in place.
jmagman commentedon May 14, 2022
@zanderso says it's more complicated than lipoing, more info in #101138.
cbracken commentedon May 14, 2022
If I understand the issue pointed to there, a bunch of that was fixed in flutter-team-archive/engine#33244. That's what I meant by us now generating native arm64/arm64 binaries rather than x86/simarm64. But maybe I'm misreading this?
The issue we still do definitely have though is no arm64 binaries that target x64 architecture, which is due to the lack of simx64 support in Dart, but my understanding was that #101138 is about an arm64->arm64 gen_snapshot, not the arm64->x64 case.
jmagman commentedon May 16, 2022
Neat, I didn't see that PR. Feel free to close what you think is complete.
That's what I meant to track with that issue since that's within our ability do to now given dart limitations.
@zanderso I thought we couldn't just lipo gen_snapshots together because of... some reason you've explained to me at least 4 times.
zanderso commentedon May 16, 2022
We could lipo together the
gen_snapshotbinaries that target arm64, but not thegen_snapshotbinaries that target x64. The reason is that Dart only supports generating intel code when running on an intel host.My suggestion for now is to keep things simple and ship non-lipo'd
gen_snpashots targeting botharm64andx64as intel binaries, which will run under Rosetta on M1.cbracken commentedon May 17, 2022
sgtm!