Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Reverts "[macOS] Generate universal gen_snapshots (#52885)" #52913

Merged
merged 1 commit into from
May 17, 2024

Conversation

auto-submit[bot]
Copy link
Contributor

@auto-submit auto-submit bot commented May 17, 2024

Reverts: #52885

Initiated by: cbracken

Reason for reverting: while this patch worked fine, it pushed the mac build bot over its time limit. Previous builds were just squeaking under the wire but seeing timeouts on the mac_host_engine host_release shard after this commit. e.g. https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20mac_host_engine/10667/overview

Looking at ci.yaml I see the timeout is set to 240, but the timeout on the failing shard is c

Original PR Author: cbracken

Reviewed By: {jmagman}

This change reverts the following previous change:
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 as universal binaries with both host architectures.

arm64 host build

Prior to this patch we emitted:

  • gen_snapshot_arm64 (arch: x64, target_arch: simarm64)

After this patch, we emit:

  • artifacts_x64/gen_snapshot_arm64 (arch: x64, target_arch: simarm64)
  • artifacts_arm64/gen_snapshot_arm64 (arch: arm64, target_arch: arm64)
  • gen_snapshot_arm64 (universal binary composed of both of the above)

x64 host build

Prior to this patch we emitted:

  • gen_snapshot_x64 (arch: x64, target_arch: x64)

After this patch, we emit:

  • artifacts_x64/gen_snapshot_x64 (arch: x64, target_arch: x64)
  • artifacts_arm64/gen_snapshot_x64 (arch: arm64, target_arch: simx64)
  • gen_snapshot_x64 (universal binary composed of both of the above)

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:

engine/tools/gn

Lines 502 to 505 in 6fa734d

# TODO(cbracken):
# https://github.com/flutter/flutter/issues/103386
if get_host_os() == 'mac' and not args.force_mac_arm64:
gn_args['host_cpu'] = 'x64'

Issue: flutter/flutter#101138
Issue: flutter/flutter#69157

Related issue: flutter/flutter#103386

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I promise to revert this when it inevitably breaks the build.
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@auto-submit auto-submit bot added the revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests. label May 17, 2024
@auto-submit auto-submit bot merged commit ac4c31a into main May 17, 2024
6 of 7 checks passed
@auto-submit auto-submit bot deleted the revert_4e33c102e56e9b3e9898c93c06373066c7eefc92 branch May 17, 2024 23:35
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 18, 2024
…148595)

flutter/engine@93f1b5a...552a965

2024-05-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fixes MatrixFilterContents rendering/coverage (#52880)" (flutter/engine#52918)
2024-05-18 30870216+gaaclarke@users.noreply.github.com Fixes MatrixFilterContents rendering/coverage (flutter/engine#52880)
2024-05-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[macOS] Generate universal gen_snapshots (#52885)" (flutter/engine#52913)
2024-05-17 chris@bracken.jp [macOS] Generate universal gen_snapshots (flutter/engine#52885)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Jun 24, 2024
This reverts commit ac4c31a (#52913).
This relands commit 4e33c10 (#52885).

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 as universal binaries with both host architectures.

## arm64 host build

Prior to this patch we emitted:
* gen_snapshot_arm64 (arch: x64, target_arch: simarm64)

After this patch, we emit:
* artifacts_x64/gen_snapshot_arm64 (arch: x64, target_arch: simarm64)
* artifacts_arm64/gen_snapshot_arm64 (arch: arm64, target_arch: arm64)
* gen_snapshot_arm64 (universal binary composed of both of the above)

## x64 host build

Prior to this patch we emitted:
* gen_snapshot_x64 (arch: x64, target_arch: x64)

After this patch, we emit:
* artifacts_x64/gen_snapshot_x64 (arch: x64, target_arch: x64)
* artifacts_arm64/gen_snapshot_x64 (arch: arm64, target_arch: simx64)
* gen_snapshot_x64 (universal binary composed of both of the above)

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants