Skip to content

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

Closed
flutter-team-archive/engine
#52885

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.

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    platform-macosBuilding on or for macOS specifically
    P3Issues that are less important to the Flutter project
    on Mar 31, 2022
  2. jmagman commented on May 14, 2022

    @jmagman
    MemberAuthor
  3. self-assigned this
    on May 14, 2022
  4. jmagman commented on Aug 24, 2022

    @jmagman
    MemberAuthor

    @cbracken I know you're working on gen_snapshot refactoring, will that result in gen_snapshot always running natively on arm, even for creating x64 binaries per dart-lang/sdk@4f7bb16? Would like to stop requiring Rosetta for our developers, plus I'm getting pushback to installing Rosetta on our luci bots https://bugs.chromium.org/p/chromium/issues/detail?id=1354817#c11

  5. cbracken commented on Aug 25, 2022

    @cbracken
    Member

    Yes this is part of #103386.

  6. moved this to In Progress in Flutter Desktopon Aug 25, 2022
  7. 28 remaining items

  8. linked a pull request that will close this issue[macOS] Generate universal gen_snapshots #52885on May 17, 2024
  9. moved this from In Progress to Done in Flutter Desktopon May 17, 2024
  10. jmagman commented on May 18, 2024

    @jmagman
    MemberAuthor

    The fix was reverted, reopening flutter-team-archive/engine#52913

  11. jmagman commented on Jun 24, 2024

    @jmagman
    MemberAuthor
  12. github-actions commented on Jul 9, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Jul 9, 2024
  14. changed the title [-]Build macOS desktop `gen_snapshot_arm64` as arm64 binary to run natively on Apple Silicon[/-] [+]Build macOS desktop `gen_snapshot_arm64` and `gen_snapshot_x64` as arm64 binary to run natively on Apple Silicon[/+] on Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions