Skip to content

Ship gen_snapshot for linux-arm64 hosts targeting Android#182275

Closed
dbebawy wants to merge 1 commit into
flutter:masterfrom
dbebawy:engine-linux-arm64-gen-snapshot
Closed

Ship gen_snapshot for linux-arm64 hosts targeting Android#182275
dbebawy wants to merge 1 commit into
flutter:masterfrom
dbebawy:engine-linux-arm64-gen-snapshot

Conversation

@dbebawy

@dbebawy dbebawy commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make gen_snapshot and analyze_snapshot zip output names in BUILD.gn host-architecture-aware (linux-arm64.zip vs linux-x64.zip)
  • Add linux_arm64_android_aot_engine.json CI builder config following the secondary builder pattern (matching mac_android_aot_engine.json)
  • Add .ci.yaml entry for the new ARM64 Linux builder

The ARM64 builder only produces host-specific archives (linux-arm64.zip and analyze-snapshot-linux-arm64.zip). Shared artifacts (artifacts.zip, symbols.zip, embedding/abi jars) continue to be produced by the existing x64 Linux builder.

This enables Android profile and release builds on ARM64 Linux machines (AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which currently fail because gen_snapshot is only shipped for linux-x64 hosts.

Fixes #75864
Fixes #168980

Test plan

  • CI builder produces linux-arm64.zip archives for all Android target CPUs (arm, arm64, x64, riscv64) in both profile and release modes
  • Archive paths are unique across all builder configs (verified locally via check.dart logic)
  • Existing linux-x64 builds are unaffected — BUILD.gn change still produces linux-x64.zip on x64 hosts
  • Companion framework PR lands after this to enable artifact download on arm64 hosts

Build gen_snapshot and analyze_snapshot for ARM64 Linux hosts targeting
Android, enabling profile and release builds on ARM64 Linux machines
(AWS Graviton, GCP Tau T2A, etc.).

Changes:
- Make gen_snapshot and analyze_snapshot zip output names in BUILD.gn
  host-architecture-aware (linux-arm64.zip vs linux-x64.zip)
- Add linux_arm64_android_aot_engine.json CI builder config following
  the secondary builder pattern (matching mac_android_aot_engine.json)
- Add .ci.yaml entry for the new ARM64 Linux builder

The ARM64 builder only produces host-specific archives (linux-arm64.zip
and analyze-snapshot-linux-arm64.zip). Shared artifacts (artifacts.zip,
symbols.zip, embedding/abi jars) continue to be produced by the
existing x64 Linux builder.

Fixes flutter#75864
Fixes flutter#168980
@dbebawy dbebawy requested a review from a team as a code owner February 12, 2026 04:55
@github-actions github-actions Bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. team-android Owned by Android platform team labels Feb 12, 2026
@dbebawy

dbebawy commented Feb 12, 2026

Copy link
Copy Markdown
Contributor Author

Companion framework PR: #182276

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables building Android profile and release artifacts on ARM64 Linux hosts by adding a new CI builder and updating the build scripts. The changes include:

  • A new CI target Linux linux_arm64_android_aot_engine in .ci.yaml.
  • A new builder configuration file linux_arm64_android_aot_engine.json that defines the builds for producing gen_snapshot and analyze_snapshot for various Android targets from a linux-arm64 host.
  • Updates to BUILD.gn to correctly name the output archives for linux-arm64 hosts.

The changes are well-structured and follow existing patterns in the repository. I have one suggestion to improve maintainability by reducing code duplication in BUILD.gn.

Comment on lines +783 to 786
if (host_os == "linux" && host_cpu == "arm64") {
output = "$android_zip_archive_dir/linux-arm64.zip"
} else if (host_os == "linux") {
output = "$android_zip_archive_dir/linux-x64.zip"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and reduce code duplication, consider defining a variable for the host platform string and reusing it. This same logic for determining the output path based on host_os and host_cpu is duplicated in the analyze_snapshot target around line 827.

You could define a variable at a shared scope, for example:

if (host_os == "linux") {
  if (host_cpu == "arm64") {
    _host_platform_string = "linux-arm64"
  } else {
    _host_platform_string = "linux-x64"
  }
} else if (host_os == "mac") {
  _host_platform_string = "darwin-x64"
} else if (host_os == "win") {
  _host_platform_string = "windows-x64"
}

Then you can use it like this in gen_snapshot:
output = "$android_zip_archive_dir/${_host_platform_string}.zip"

And in analyze_snapshot:
output = "$android_zip_archive_dir/analyze-snapshot-${_host_platform_string}.zip"

This would make the code more DRY (Don't Repeat Yourself) and easier to maintain if more host platforms are added in the future.

References
  1. The repository style guide recommends optimizing for readability and avoiding duplicating state (lines 29-30). The GN style guide also encourages using variables to avoid duplicating values. This logic for determining the host platform string is repeated in two places and can be extracted into a variable to improve maintainability. (link)

@reidbaker

reidbaker commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! I am trying to understand what level of maintenance burden this will be to maintain and if there are other aspects to making this work well that the flutter contributor team needs to do at the same time.

Let me talk with some of my coworkers. I will add our thoughts here after we have talked.

# at https://github.com/flutter/flutter/issues/152186.
cores: "8"

- name: Linux linux_arm64_android_aot_engine

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new builders must be bringup: true until they are stable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — added bringup: true in the combined PR #182552. Thanks for the catch.

@dbebawy

dbebawy commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #182552 — combined engine and framework changes into a single atomic commit per reviewer feedback. Also addresses @jtmcdole's feedback to add bringup: true.

@dbebawy

dbebawy commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

@reidbaker Thanks for looking into this. Happy to answer any questions about maintenance burden. The ARM64 builder follows the same secondary builder pattern as the existing macOS builder (mac_android_aot_engine.json), so it should be minimal incremental overhead. The combined PR is at #182552.

@dbebawy

dbebawy commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

Correcting my earlier comment — wanted to give a more accurate picture of the maintenance burden:

Infrastructure:

  • This adds the first ARM64 Linux engine builder. It requires ARM64 Linux machines in the LUCI swarming pool (os=Linux + cpu=arm64). If those aren't already provisioned, that's new infrastructure to stand up and maintain.
  • The builder uses RBE (--rbe) for remote compilation, which offloads some of the build cost.

Scope:

  • 8 build configurations (arm, arm64, x64, riscv64 × profile, release) — 2 more than the equivalent macOS builder which doesn't include riscv64.
  • Only produces host-specific gen_snapshot/analyze_snapshot zips (secondary builder pattern). Shared artifacts continue to come from the existing x64 builder.

Ongoing maintenance:

  • When the x64 Linux AOT builder (linux_android_aot_engine.json) changes (new targets, config updates), the arm64 builder would need parallel updates.
  • Builder is set to bringup: true to allow stabilization before becoming a blocking builder.

Happy to discuss further or adjust scope (e.g., dropping riscv64 to match the macOS builder's 6-build pattern if that reduces concern).

Combined PR: #182552

@dbebawy dbebawy closed this Feb 18, 2026
@reidbaker

Copy link
Copy Markdown
Contributor

@dbebawy did you mean to close this pr?

@dbebawy

dbebawy commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

@reidbaker Yes — per @jmagman's feedback on #182276 that engine and framework changes should be in a single atomic commit (since the monorepo merge in Dec 2024), I combined both PRs into #182552. That PR also incorporates @jtmcdole's feedback to add bringup: true.

This PR and #182276 are superseded by #182552.

pull Bot pushed a commit to TheRakeshPurohit/flutter that referenced this pull request Apr 29, 2026
…2552)

## Summary

Enable Android **profile** and **release** builds on ARM64 Linux hosts
(AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which
currently fail because `gen_snapshot` is only shipped for `linux-x64`
hosts.

Supersedes flutter#182275 and flutter#182276 — combined into a single atomic commit
per reviewer feedback.

### Engine changes

- **`BUILD.gn`**: Make `gen_snapshot` and `analyze_snapshot` zip output
names host-architecture-aware (`linux-arm64.zip` vs `linux-x64.zip`)
using explicit `if (host_os == "linux" && host_cpu == "arm64")`
branching, matching the existing pattern for mac/windows.
- **`linux_arm64_android_aot_engine.json`** (new): CI builder config
following the secondary builder pattern (matching
`mac_android_aot_engine.json`). Only produces host-specific archives —
shared artifacts (`artifacts.zip`, `symbols.zip`, embedding/abi jars)
continue to be produced by the existing x64 Linux builder.
- **`.ci.yaml`**: New builder entry with `bringup: true`, `os=Linux`,
`cpu=arm64`.

### Framework changes

- **`flutter_cache.dart`**: Convert `_linuxBinaryDirs` from a hardcoded
`linux-x64` const list to a function parameterized by host architecture,
using the existing `cache.getHostPlatformArchName()` pattern from
`LinuxEngineArtifacts`.
- **`artifacts.dart`**: Clean up stale TODO comment — replace with
accurate explanation of why `darwin-arm64` is remapped to `darwin-x64`
(universal binary). No Linux remapping needed since Linux ships native
binaries per host architecture.
- **Tests**: Add tests for both x64 and arm64 host artifact resolution
in `cache_test.dart` and `artifacts_test.dart`, following the existing
`LinuxEngineArtifacts` test pattern.

### Infrastructure notes

- The builder is set to `bringup: true` to allow stabilization before
becoming a blocking builder.
- Requires ARM64 Linux machines in the LUCI swarming pool (`os=Linux` +
`cpu=arm64`).
- 8 build configurations: {arm, arm64, x64, riscv64} × {profile,
release}. This matches the x64 Linux builder's target coverage. The
macOS equivalent has 6 builds (no riscv64).
- Uses RBE (`--rbe`) for remote compilation.

Fixes flutter#75864
Fixes flutter#168980

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

## Test plan

### Verified by PR CI (x64 hosts)

- [x] `linux_android_aot_engine` (x64) passed — `BUILD.gn` change still
produces `linux-x64.zip` correctly
- [x] `mac_android_aot_engine` passed — `darwin-x64.zip` unaffected
- [x] `windows_android_aot_engine` passed — `windows-x64.zip` unaffected
- [x] `ci.yaml validation` passed — builder JSON and `.ci.yaml` entry
are structurally valid
- [x] Archive paths are unique across all builder configs (verified
locally)
- [x] Unit tests pass for `AndroidGenSnapshotArtifacts.getBinaryDirs()`
returning `linux-x64` entries on x64 hosts and `linux-arm64` entries on
arm64 hosts
- [x] Unit tests pass for `getArtifactPath` resolving `gen_snapshot` to
correct host-architecture path on both x64 and arm64 Linux

### Requires ARM64 Linux hardware (post-bringup)

The new `linux_arm64_android_aot_engine` builder is `bringup: true` and
does not run on PR checks. The `BUILD.gn` code path (`host_cpu ==
"arm64"`) is only exercised on ARM64 hosts. The following need to be
validated once the builder runs on ARM64 infrastructure:

- [ ] `gen_snapshot` compiles and links on ARM64 Linux
- [ ] CI builder produces `linux-arm64.zip` archives for all Android
target CPUs (arm, arm64, x64, riscv64) in both profile and release modes
- [ ] `analyze_snapshot` produces `analyze-snapshot-linux-arm64.zip` for
64-bit targets
- [ ] Artifacts download correctly on an ARM64 Linux host via `flutter
precache`

---------

Co-authored-by: Reid Baker <1063596+reidbaker@users.noreply.github.com>
Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>
Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
MarlonJD pushed a commit to MarlonJD/flutter that referenced this pull request May 20, 2026
…lutter#186693)

Reverts: [Ship gen_snapshot for linux-arm64 hosts targeting
Android](flutter#182552)

Initiated by: @eyebrowsoffire

Reason for reverting: We do not have any bots capable of servicing this
builder, and it is breaking our releases as well as `flutter precache
--all`

Original PR Author: @dbebawy

Reviewed By: @reidbaker

The original PR description is provided below:

## Summary

Enable Android **profile** and **release** builds on ARM64 Linux hosts
(AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which
currently fail because `gen_snapshot` is only shipped for `linux-x64`
hosts.

Supersedes flutter#182275 and flutter#182276 — combined into a single atomic commit
per reviewer feedback.

### Engine changes

- **`BUILD.gn`**: Make `gen_snapshot` and `analyze_snapshot` zip output
names host-architecture-aware (`linux-arm64.zip` vs `linux-x64.zip`)
using explicit `if (host_os == "linux" && host_cpu == "arm64")`
branching, matching the existing pattern for mac/windows.
- **`linux_arm64_android_aot_engine.json`** (new): CI builder config
following the secondary builder pattern (matching
`mac_android_aot_engine.json`). Only produces host-specific archives —
shared artifacts (`artifacts.zip`, `symbols.zip`, embedding/abi jars)
continue to be produced by the existing x64 Linux builder.
- **`.ci.yaml`**: New builder entry with `bringup: true`, `os=Linux`,
`cpu=arm64`.

### Framework changes

- **`flutter_cache.dart`**: Convert `_linuxBinaryDirs` from a hardcoded
`linux-x64` const list to a function parameterized by host architecture,
using the existing `cache.getHostPlatformArchName()` pattern from
`LinuxEngineArtifacts`.
- **`artifacts.dart`**: Clean up stale TODO comment — replace with
accurate explanation of why `darwin-arm64` is remapped to `darwin-x64`
(universal binary). No Linux remapping needed since Linux ships native
binaries per host architecture.
- **Tests**: Add tests for both x64 and arm64 host artifact resolution
in `cache_test.dart` and `artifacts_test.dart`, following the existing
`LinuxEngineArtifacts` test pattern.

### Infrastructure notes

- The builder is set to `bringup: true` to allow stabilization before
becoming a blocking builder.
- Requires ARM64 Linux machines in the LUCI swarming pool (`os=Linux` +
`cpu=arm64`).
- 8 build configurations: {arm, arm64, x64, riscv64} × {profile,
release}. This matches the x64 Linux builder's target coverage. The
macOS equivalent has 6 builds (no riscv64).
- Uses RBE (`--rbe`) for remote compilation.

Fixes flutter#75864
Fixes flutter#168980

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

## Test plan

### Verified by PR CI (x64 hosts)

- [x] `linux_android_aot_engine` (x64) passed — `BUILD.gn` change still
produces `linux-x64.zip` correctly
- [x] `mac_android_aot_engine` passed — `darwin-x64.zip` unaffected
- [x] `windows_android_aot_engine` passed — `windows-x64.zip` unaffected
- [x] `ci.yaml validation` passed — builder JSON and `.ci.yaml` entry
are structurally valid
- [x] Archive paths are unique across all builder configs (verified
locally)
- [x] Unit tests pass for `AndroidGenSnapshotArtifacts.getBinaryDirs()`
returning `linux-x64` entries on x64 hosts and `linux-arm64` entries on
arm64 hosts
- [x] Unit tests pass for `getArtifactPath` resolving `gen_snapshot` to
correct host-architecture path on both x64 and arm64 Linux

### Requires ARM64 Linux hardware (post-bringup)

The new `linux_arm64_android_aot_engine` builder is `bringup: true` and
does not run on PR checks. The `BUILD.gn` code path (`host_cpu ==
"arm64"`) is only exercised on ARM64 hosts. The following need to be
validated once the builder runs on ARM64 infrastructure:

- [ ] `gen_snapshot` compiles and links on ARM64 Linux
- [ ] CI builder produces `linux-arm64.zip` archives for all Android
target CPUs (arm, arm64, x64, riscv64) in both profile and release modes
- [ ] `analyze_snapshot` produces `analyze-snapshot-linux-arm64.zip` for
64-bit targets
- [ ] Artifacts download correctly on an ARM64 Linux host via `flutter
precache`

---------

Co-authored-by: Jackson Gardner <jacksongardner@google.com>
eyebrowsoffire added a commit to eyebrowsoffire/flutter that referenced this pull request May 20, 2026
…lutter#186693)

Reverts: [Ship gen_snapshot for linux-arm64 hosts targeting
Android](flutter#182552)

Initiated by: @eyebrowsoffire

Reason for reverting: We do not have any bots capable of servicing this
builder, and it is breaking our releases as well as `flutter precache
--all`

Original PR Author: @dbebawy

Reviewed By: @reidbaker

The original PR description is provided below:

## Summary

Enable Android **profile** and **release** builds on ARM64 Linux hosts
(AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which
currently fail because `gen_snapshot` is only shipped for `linux-x64`
hosts.

Supersedes flutter#182275 and flutter#182276 — combined into a single atomic commit
per reviewer feedback.

### Engine changes

- **`BUILD.gn`**: Make `gen_snapshot` and `analyze_snapshot` zip output
names host-architecture-aware (`linux-arm64.zip` vs `linux-x64.zip`)
using explicit `if (host_os == "linux" && host_cpu == "arm64")`
branching, matching the existing pattern for mac/windows.
- **`linux_arm64_android_aot_engine.json`** (new): CI builder config
following the secondary builder pattern (matching
`mac_android_aot_engine.json`). Only produces host-specific archives —
shared artifacts (`artifacts.zip`, `symbols.zip`, embedding/abi jars)
continue to be produced by the existing x64 Linux builder.
- **`.ci.yaml`**: New builder entry with `bringup: true`, `os=Linux`,
`cpu=arm64`.

### Framework changes

- **`flutter_cache.dart`**: Convert `_linuxBinaryDirs` from a hardcoded
`linux-x64` const list to a function parameterized by host architecture,
using the existing `cache.getHostPlatformArchName()` pattern from
`LinuxEngineArtifacts`.
- **`artifacts.dart`**: Clean up stale TODO comment — replace with
accurate explanation of why `darwin-arm64` is remapped to `darwin-x64`
(universal binary). No Linux remapping needed since Linux ships native
binaries per host architecture.
- **Tests**: Add tests for both x64 and arm64 host artifact resolution
in `cache_test.dart` and `artifacts_test.dart`, following the existing
`LinuxEngineArtifacts` test pattern.

### Infrastructure notes

- The builder is set to `bringup: true` to allow stabilization before
becoming a blocking builder.
- Requires ARM64 Linux machines in the LUCI swarming pool (`os=Linux` +
`cpu=arm64`).
- 8 build configurations: {arm, arm64, x64, riscv64} × {profile,
release}. This matches the x64 Linux builder's target coverage. The
macOS equivalent has 6 builds (no riscv64).
- Uses RBE (`--rbe`) for remote compilation.

Fixes flutter#75864
Fixes flutter#168980

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

## Test plan

### Verified by PR CI (x64 hosts)

- [x] `linux_android_aot_engine` (x64) passed — `BUILD.gn` change still
produces `linux-x64.zip` correctly
- [x] `mac_android_aot_engine` passed — `darwin-x64.zip` unaffected
- [x] `windows_android_aot_engine` passed — `windows-x64.zip` unaffected
- [x] `ci.yaml validation` passed — builder JSON and `.ci.yaml` entry
are structurally valid
- [x] Archive paths are unique across all builder configs (verified
locally)
- [x] Unit tests pass for `AndroidGenSnapshotArtifacts.getBinaryDirs()`
returning `linux-x64` entries on x64 hosts and `linux-arm64` entries on
arm64 hosts
- [x] Unit tests pass for `getArtifactPath` resolving `gen_snapshot` to
correct host-architecture path on both x64 and arm64 Linux

### Requires ARM64 Linux hardware (post-bringup)

The new `linux_arm64_android_aot_engine` builder is `bringup: true` and
does not run on PR checks. The `BUILD.gn` code path (`host_cpu ==
"arm64"`) is only exercised on ARM64 hosts. The following need to be
validated once the builder runs on ARM64 infrastructure:

- [ ] `gen_snapshot` compiles and links on ARM64 Linux
- [ ] CI builder produces `linux-arm64.zip` archives for all Android
target CPUs (arm, arm64, x64, riscv64) in both profile and release modes
- [ ] `analyze_snapshot` produces `analyze-snapshot-linux-arm64.zip` for
64-bit targets
- [ ] Artifacts download correctly on an ARM64 Linux host via `flutter
precache`

---------

Co-authored-by: Jackson Gardner <jacksongardner@google.com>
auto-submit Bot pushed a commit that referenced this pull request May 21, 2026
…roid" (#186818)

This is a cherry-pick of this revert, which is needed because the change that was reverted caused a breakage in our release build.

Reverts: [Ship gen_snapshot for linux-arm64 hosts targeting Android](#182552)

Initiated by: @eyebrowsoffire

Reason for reverting: We do not have any bots capable of servicing this builder, and it is breaking our releases as well as `flutter precache --all`

Original PR Author: @dbebawy

Reviewed By: @reidbaker

The original PR description is provided below:

## Summary

Enable Android **profile** and **release** builds on ARM64 Linux hosts (AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which currently fail because `gen_snapshot` is only shipped for `linux-x64` hosts.

Supersedes #182275 and #182276 — combined into a single atomic commit per reviewer feedback.

### Engine changes

- **`BUILD.gn`**: Make `gen_snapshot` and `analyze_snapshot` zip output names host-architecture-aware (`linux-arm64.zip` vs `linux-x64.zip`) using explicit `if (host_os == "linux" && host_cpu == "arm64")` branching, matching the existing pattern for mac/windows.
- **`linux_arm64_android_aot_engine.json`** (new): CI builder config following the secondary builder pattern (matching
`mac_android_aot_engine.json`). Only produces host-specific archives — shared artifacts (`artifacts.zip`, `symbols.zip`, embedding/abi jars) continue to be produced by the existing x64 Linux builder.
- **`.ci.yaml`**: New builder entry with `bringup: true`, `os=Linux`, `cpu=arm64`.

### Framework changes

- **`flutter_cache.dart`**: Convert `_linuxBinaryDirs` from a hardcoded `linux-x64` const list to a function parameterized by host architecture, using the existing `cache.getHostPlatformArchName()` pattern from `LinuxEngineArtifacts`.
- **`artifacts.dart`**: Clean up stale TODO comment — replace with accurate explanation of why `darwin-arm64` is remapped to `darwin-x64` (universal binary). No Linux remapping needed since Linux ships native binaries per host architecture.
- **Tests**: Add tests for both x64 and arm64 host artifact resolution in `cache_test.dart` and `artifacts_test.dart`, following the existing `LinuxEngineArtifacts` test pattern.

### Infrastructure notes

- The builder is set to `bringup: true` to allow stabilization before becoming a blocking builder.
- Requires ARM64 Linux machines in the LUCI swarming pool (`os=Linux` + `cpu=arm64`).
- 8 build configurations: {arm, arm64, x64, riscv64} × {profile, release}. This matches the x64 Linux builder's target coverage. The macOS equivalent has 6 builds (no riscv64).
- Uses RBE (`--rbe`) for remote compilation.

Fixes #75864 Fixes #168980

https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

## Test plan

### Verified by PR CI (x64 hosts)

### Requires ARM64 Linux hardware (post-bringup)

The new `linux_arm64_android_aot_engine` builder is `bringup: true` and does not run on PR checks. The `BUILD.gn` code path (`host_cpu == "arm64"`) is only exercised on ARM64 hosts. The following need to be validated once the builder runs on ARM64 infrastructure:

---------

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
matthewhendrix pushed a commit to matthewhendrix/flutter that referenced this pull request May 23, 2026
…lutter#186693)

Reverts: [Ship gen_snapshot for linux-arm64 hosts targeting
Android](flutter#182552)

Initiated by: @eyebrowsoffire

Reason for reverting: We do not have any bots capable of servicing this
builder, and it is breaking our releases as well as `flutter precache
--all`

Original PR Author: @dbebawy

Reviewed By: @reidbaker

The original PR description is provided below:

## Summary

Enable Android **profile** and **release** builds on ARM64 Linux hosts
(AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which
currently fail because `gen_snapshot` is only shipped for `linux-x64`
hosts.

Supersedes flutter#182275 and flutter#182276 — combined into a single atomic commit
per reviewer feedback.

### Engine changes

- **`BUILD.gn`**: Make `gen_snapshot` and `analyze_snapshot` zip output
names host-architecture-aware (`linux-arm64.zip` vs `linux-x64.zip`)
using explicit `if (host_os == "linux" && host_cpu == "arm64")`
branching, matching the existing pattern for mac/windows.
- **`linux_arm64_android_aot_engine.json`** (new): CI builder config
following the secondary builder pattern (matching
`mac_android_aot_engine.json`). Only produces host-specific archives —
shared artifacts (`artifacts.zip`, `symbols.zip`, embedding/abi jars)
continue to be produced by the existing x64 Linux builder.
- **`.ci.yaml`**: New builder entry with `bringup: true`, `os=Linux`,
`cpu=arm64`.

### Framework changes

- **`flutter_cache.dart`**: Convert `_linuxBinaryDirs` from a hardcoded
`linux-x64` const list to a function parameterized by host architecture,
using the existing `cache.getHostPlatformArchName()` pattern from
`LinuxEngineArtifacts`.
- **`artifacts.dart`**: Clean up stale TODO comment — replace with
accurate explanation of why `darwin-arm64` is remapped to `darwin-x64`
(universal binary). No Linux remapping needed since Linux ships native
binaries per host architecture.
- **Tests**: Add tests for both x64 and arm64 host artifact resolution
in `cache_test.dart` and `artifacts_test.dart`, following the existing
`LinuxEngineArtifacts` test pattern.

### Infrastructure notes

- The builder is set to `bringup: true` to allow stabilization before
becoming a blocking builder.
- Requires ARM64 Linux machines in the LUCI swarming pool (`os=Linux` +
`cpu=arm64`).
- 8 build configurations: {arm, arm64, x64, riscv64} × {profile,
release}. This matches the x64 Linux builder's target coverage. The
macOS equivalent has 6 builds (no riscv64).
- Uses RBE (`--rbe`) for remote compilation.

Fixes flutter#75864
Fixes flutter#168980

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

## Test plan

### Verified by PR CI (x64 hosts)

- [x] `linux_android_aot_engine` (x64) passed — `BUILD.gn` change still
produces `linux-x64.zip` correctly
- [x] `mac_android_aot_engine` passed — `darwin-x64.zip` unaffected
- [x] `windows_android_aot_engine` passed — `windows-x64.zip` unaffected
- [x] `ci.yaml validation` passed — builder JSON and `.ci.yaml` entry
are structurally valid
- [x] Archive paths are unique across all builder configs (verified
locally)
- [x] Unit tests pass for `AndroidGenSnapshotArtifacts.getBinaryDirs()`
returning `linux-x64` entries on x64 hosts and `linux-arm64` entries on
arm64 hosts
- [x] Unit tests pass for `getArtifactPath` resolving `gen_snapshot` to
correct host-architecture path on both x64 and arm64 Linux

### Requires ARM64 Linux hardware (post-bringup)

The new `linux_arm64_android_aot_engine` builder is `bringup: true` and
does not run on PR checks. The `BUILD.gn` code path (`host_cpu ==
"arm64"`) is only exercised on ARM64 hosts. The following need to be
validated once the builder runs on ARM64 infrastructure:

- [ ] `gen_snapshot` compiles and links on ARM64 Linux
- [ ] CI builder produces `linux-arm64.zip` archives for all Android
target CPUs (arm, arm64, x64, riscv64) in both profile and release modes
- [ ] `analyze_snapshot` produces `analyze-snapshot-linux-arm64.zip` for
64-bit targets
- [ ] Artifacts download correctly on an ARM64 Linux host via `flutter
precache`

---------

Co-authored-by: Jackson Gardner <jacksongardner@google.com>
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
…lutter#186693)

Reverts: [Ship gen_snapshot for linux-arm64 hosts targeting
Android](flutter#182552)

Initiated by: @eyebrowsoffire

Reason for reverting: We do not have any bots capable of servicing this
builder, and it is breaking our releases as well as `flutter precache
--all`

Original PR Author: @dbebawy

Reviewed By: @reidbaker

The original PR description is provided below:

## Summary

Enable Android **profile** and **release** builds on ARM64 Linux hosts
(AWS Graviton, GCP Tau T2A, self-hosted ARM64 runners, etc.), which
currently fail because `gen_snapshot` is only shipped for `linux-x64`
hosts.

Supersedes flutter#182275 and flutter#182276 — combined into a single atomic commit
per reviewer feedback.

### Engine changes

- **`BUILD.gn`**: Make `gen_snapshot` and `analyze_snapshot` zip output
names host-architecture-aware (`linux-arm64.zip` vs `linux-x64.zip`)
using explicit `if (host_os == "linux" && host_cpu == "arm64")`
branching, matching the existing pattern for mac/windows.
- **`linux_arm64_android_aot_engine.json`** (new): CI builder config
following the secondary builder pattern (matching
`mac_android_aot_engine.json`). Only produces host-specific archives —
shared artifacts (`artifacts.zip`, `symbols.zip`, embedding/abi jars)
continue to be produced by the existing x64 Linux builder.
- **`.ci.yaml`**: New builder entry with `bringup: true`, `os=Linux`,
`cpu=arm64`.

### Framework changes

- **`flutter_cache.dart`**: Convert `_linuxBinaryDirs` from a hardcoded
`linux-x64` const list to a function parameterized by host architecture,
using the existing `cache.getHostPlatformArchName()` pattern from
`LinuxEngineArtifacts`.
- **`artifacts.dart`**: Clean up stale TODO comment — replace with
accurate explanation of why `darwin-arm64` is remapped to `darwin-x64`
(universal binary). No Linux remapping needed since Linux ships native
binaries per host architecture.
- **Tests**: Add tests for both x64 and arm64 host artifact resolution
in `cache_test.dart` and `artifacts_test.dart`, following the existing
`LinuxEngineArtifacts` test pattern.

### Infrastructure notes

- The builder is set to `bringup: true` to allow stabilization before
becoming a blocking builder.
- Requires ARM64 Linux machines in the LUCI swarming pool (`os=Linux` +
`cpu=arm64`).
- 8 build configurations: {arm, arm64, x64, riscv64} × {profile,
release}. This matches the x64 Linux builder's target coverage. The
macOS equivalent has 6 builds (no riscv64).
- Uses RBE (`--rbe`) for remote compilation.

Fixes flutter#75864
Fixes flutter#168980

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

## Test plan

### Verified by PR CI (x64 hosts)

- [x] `linux_android_aot_engine` (x64) passed — `BUILD.gn` change still
produces `linux-x64.zip` correctly
- [x] `mac_android_aot_engine` passed — `darwin-x64.zip` unaffected
- [x] `windows_android_aot_engine` passed — `windows-x64.zip` unaffected
- [x] `ci.yaml validation` passed — builder JSON and `.ci.yaml` entry
are structurally valid
- [x] Archive paths are unique across all builder configs (verified
locally)
- [x] Unit tests pass for `AndroidGenSnapshotArtifacts.getBinaryDirs()`
returning `linux-x64` entries on x64 hosts and `linux-arm64` entries on
arm64 hosts
- [x] Unit tests pass for `getArtifactPath` resolving `gen_snapshot` to
correct host-architecture path on both x64 and arm64 Linux

### Requires ARM64 Linux hardware (post-bringup)

The new `linux_arm64_android_aot_engine` builder is `bringup: true` and
does not run on PR checks. The `BUILD.gn` code path (`host_cpu ==
"arm64"`) is only exercised on ARM64 hosts. The following need to be
validated once the builder runs on ARM64 infrastructure:

- [ ] `gen_snapshot` compiles and links on ARM64 Linux
- [ ] CI builder produces `linux-arm64.zip` archives for all Android
target CPUs (arm, arm64, x64, riscv64) in both profile and release modes
- [ ] `analyze_snapshot` produces `analyze-snapshot-linux-arm64.zip` for
64-bit targets
- [ ] Artifacts download correctly on an ARM64 Linux host via `flutter
precache`

---------

Co-authored-by: Jackson Gardner <jacksongardner@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team

Projects

None yet

3 participants