Skip to content

Build macOS desktop gen_snapshot_arm64 and gen_snapshot_x64 as arm64 binary to run natively on Apple Silicon #101138

@jmagman

Description

@jmagman

On an arm64 Apple Silicon Mac, the published gen_snapshot_* binaries are x86_64 and therefore run with Rosetta translation.

./darwin-x64-profile/gen_snapshot_arm64:          Mach-O 64-bit executable x86_64
./darwin-x64-profile/gen_snapshot_x64:            Mach-O 64-bit executable x86_64
./darwin-x64-profile/gen_snapshot:                Mach-O 64-bit executable x86_64
./darwin-x64/gen_snapshot_arm64:                  Mach-O 64-bit executable x86_64
./darwin-x64/gen_snapshot_x64:                    Mach-O 64-bit executable x86_64
./darwin-x64/gen_snapshot:                        Mach-O 64-bit executable x86_64
./darwin-x64-release/gen_snapshot_arm64:          Mach-O 64-bit executable x86_64
./darwin-x64-release/gen_snapshot_x64:            Mach-O 64-bit executable x86_64
./darwin-x64-release/gen_snapshot:                Mach-O 64-bit executable x86_64

Dart does not currently support targeting x64 from a non-x64 host dart-lang/sdk#49768. However gen_snapshot_arm64 can be compiled as arm64 and therefore run natively on an arm64 Mac. gen_snapshot_x64 can also be compiled as a universal binary for AOT (but not JIT) builds, which is all we need for macOS targets.

Compile macOS gen_snapshot_arm64 as arm64, and publish in the arm64 Flutter install (flutter_macos_arm64_*.zip), as well as the macOS desktop artifacts that get curled when upgrading on an arm64 Mac.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.platform-macBuilding on or for macOS specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions