Skip to content

Reland (framework): Support linux-arm64 host for Android gen_snapshot artifact download#187593

Draft
dbebawy wants to merge 1 commit into
flutter:masterfrom
dbebawy:reland-framework-linux-arm64-gen-snapshot
Draft

Reland (framework): Support linux-arm64 host for Android gen_snapshot artifact download#187593
dbebawy wants to merge 1 commit into
flutter:masterfrom
dbebawy:reland-framework-linux-arm64-gen-snapshot

Conversation

@dbebawy

@dbebawy dbebawy commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Framework half of the reland of #182552. Opened as a draft for code review in parallel with #187591 (engine reland). Do not merge until both gates clear:

  1. Reland: Ship gen_snapshot for linux-arm64 hosts targeting Android #187591 (engine reland) has landed.
  2. The new linux_arm64_android_aot_engine builder has produced linux-arm64.zip to GCS for at least one engine SHA after merge.

The original PR #182552 landed both halves together, which is why the revert #186693 broke flutter precache --all: framework code advertised paths that didn't yet exist on GCS. This time, framework lands only after the artifacts are confirmed present. A scheduled job is watching for the two conditions and will flip this PR from draft → ready for review when both are met.

Changes

  • packages/flutter_tools/lib/src/flutter_cache.dart: convert the hardcoded _linuxBinaryDirs const list into a function parameterized by host architecture, using the existing cache.getHostPlatformArchName() pattern from LinuxEngineArtifacts.
  • packages/flutter_tools/lib/src/artifacts.dart: replace a stale TODO comment with an 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.
  • packages/flutter_tools/test/general.shard/cache_test.dart: new tests covering both x64 and arm64 host artifact resolution, following the existing LinuxEngineArtifacts test pattern.
  • packages/flutter_tools/test/general.shard/artifacts_test.dart: same for getArtifactPath resolving gen_snapshot paths.

Related #75864
Related #168980

Why open this before #187591 lands?

To get code review on the framework half in parallel rather than serially. The actual sequencing-dependency (artifacts must exist before framework manifests them) is enforced by keeping this in draft, not by waiting to open the PR. Reviewers can verify the framework changes are correct without taking on the merge-timing risk.

Pre-launch Checklist

  • I read the Contributor Guide.
  • I read the Tree Hygiene wiki page.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • 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.
  • All existing and new tests are passing.

… artifact download

Framework follow-up to the engine reland in flutter#187591. This is the
flutter_tools half of flutter#182552: teach the cache and artifact resolution
to look for `linux-arm64/gen_snapshot` (and the `linux-arm64.zip`
archive shape) when the host CPU is arm64, instead of the hardcoded
`linux-x64`.

The original PR flutter#182552 landed both halves together, which led to the
revert flutter#186693: framework code advertised the linux-arm64 paths before
the engine builder ever shipped those artifacts to GCS, breaking
`flutter precache --all` for every user at the next beta cut.

Sequencing fix for the reland:
- flutter#187591 lands first (engine builder for linux-arm64 host AOT,
  cross-compiled from x64 bots, gated `bringup: true`).
- Once the new builder has produced `linux-arm64.zip` to GCS for at
  least one release cycle, THIS PR lands.
- That guarantees the manifest never advertises an artifact that
  doesn't exist on GCS.

Files:
- packages/flutter_tools/lib/src/flutter_cache.dart: convert the
  hardcoded `_linuxBinaryDirs` const list into a function parameterized
  by host architecture, using the existing
  `cache.getHostPlatformArchName()` pattern from `LinuxEngineArtifacts`.
- packages/flutter_tools/lib/src/artifacts.dart: replace a stale TODO
  comment with an accurate explanation of why `darwin-arm64` is remapped
  to `darwin-x64` (universal binary). No Linux remapping is needed since
  Linux ships native binaries per host architecture.
- packages/flutter_tools/test/general.shard/cache_test.dart: new tests
  covering both x64 and arm64 host artifact resolution, following the
  existing `LinuxEngineArtifacts` test pattern.
- packages/flutter_tools/test/general.shard/artifacts_test.dart: same
  for `getArtifactPath` resolving `gen_snapshot` paths.

Related flutter#75864
Related flutter#168980
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 5, 2026
@dbebawy

dbebawy commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Opening this in draft so the framework half can get review in parallel with the engine reland #187591. Hold for merge until both gates clear:

  1. Reland: Ship gen_snapshot for linux-arm64 hosts targeting Android #187591 lands.
  2. The new linux_arm64_android_aot_engine builder ships linux-arm64.zip to GCS for at least one engine SHA.

A scheduled job is watching both conditions and will flip this PR from draft → ready for review when met. The body has the full sequencing rationale.

Tagging in the folks who care about both halves:

The diff itself is small (+91/−12 across 4 files) and self-contained to flutter_tools cache/artifact resolution. Comfortable starting review while the engine half is still in flight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant