Skip to content
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

[macOS] Generate universal gen_snapshots #52885

Merged
merged 4 commits into from
May 17, 2024

Commits on May 16, 2024

  1. [iOS][macOS] Support both arm64, x64 gen_snapshot

    Previously, the `gen_snapshot_arm64` and `gen_snapshot_x64` binaries
    used by the tool were all built for x64 architecture. As such,
    developers building apps with Flutter rely on Rosetta translation with
    every build.
    
    This refactors the gen_snapshot build rules on macOS hosts to
    consistently produce `gen_snapshot_arm64` and `gen_snapshot_x64`
    binaries with the target architecture of the build but with both host
    architectures.
    
    Differences introduced in arm64 host build:
    
    Prior to this patch we emitted:
    * gen_snapshot_arm64 (arch: x64, target_arch: simarm64)
    
    After this patch, we emit:
    * gen_snapshot_arm64 (arch: x64, target_arch: simarm64)
    * gen_snapshot_arm64 (arch: arm64, target_arch: arm64)
    
    Differences introduced in x64 host build:
    
    Prior to this patch we emitted:
    * gen_snapshot_x64 (arch: x64, target_arch: x64)
    
    After this patch, we emit:
    * gen_snapshot_x64 (arch: x64, target_arch: x64)
    * gen_snapshot_x64 (arch: arm64, target_arch: simx64)
    
    Note that host builds on macOS currently default to a host architecture
    of x64 (can be overridden via `--force-mac-arm64`) regardless of host
    architecture and thus, the build itself relies on Rosetta translation
    when invoked on Apple Silicon arm64 hardware. This is to ensure a
    consistent build in CI regardless of bot architecture.
    See: https://github.com/flutter/engine/blob/6fa734d686888a39add026a2a98d6ec311c23efb/tools/gn#L502-L505
    
    Issue: flutter/flutter#101138
    Issue: flutter/flutter#69157
    
    Related issue: flutter/flutter#103386
    cbracken committed May 16, 2024
    Configuration menu
    Copy the full SHA
    d7b581f View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Generate universal binary

    cbracken committed May 17, 2024
    Configuration menu
    Copy the full SHA
    0df55a7 View commit details
    Browse the repository at this point in the history
  2. Appease the licence script

    cbracken committed May 17, 2024
    Configuration menu
    Copy the full SHA
    d25d0c7 View commit details
    Browse the repository at this point in the history
  3. Appease pylint

    cbracken committed May 17, 2024
    Configuration menu
    Copy the full SHA
    b391402 View commit details
    Browse the repository at this point in the history