Skip to content

ci(android): restore the ndk and emulator image from the actions cache - #1003

Merged
natew merged 4 commits into
mainfrom
tm/android-sdk-package-cache
Oct 22, 2026
Merged

natew merged 4 commits into
mainfrom
tm/android-sdk-package-cache

Conversation

@natew

@natew natew commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Three Android Native Build setups failed in android-actions/setup-android@v4 before any test ran, with Error reading Zip content from a SeekableByteChannel:

In all three logs the download phase stops early and jumps to its end (NDK at 20%, the image at 26% and 11%; a good run climbs steadily to 33%), and the unzip fails within 0.2s. sdkmanager unzipped a truncated transfer from dl.google.com without checking its length. Each run downloads the 663 MB NDK zip once and the 2.2 GB image zip in each of the six fixture shards.

This adds a small composite action that restores one installed SDK package before setup-android and, on pushes only, saves it afterwards, keyed on the package id and the installed Pkg.Revision. setup-android passes the same package list as before; sdkmanager skips an installed package and downloads it exactly as today on a cache miss, so a missing package still fails setup. Pull requests read the main cache, like the gradle cache.

Cache budget: the repo sits at 10.36 GB of 10 GB, but the entries current runs touch total about 5.8 GB; the rest are stale PR and branch copies that LRU eviction drops first. The two packages add roughly 2.9 GB.

No test, predicate or budget changes.

natew added 4 commits October 21, 2026 09:31
sdkmanager unzips a download without checking its length. two setup-android
runs failed when the dl.google.com transfer ended early (ndk at 20%, the
api 37 image at 26% of the download phase) and the unzip read a truncated
zip. pushes now save each installed package keyed on its package id and
revision, and every job restores it before setup-android, which skips an
installed package; on a miss sdkmanager downloads it as before.

Validation: pending this branch's Android Native Build runs
Team-Machine-Session: p100604
the ndk writes "Pkg.Revision = 27.1.12297006" while system images write
"Pkg.Revision=6", so the ndk was saved under a key with no revision.

Validation: sed read 27.0.12077973 and 6 from local ndk and system image
source.properties

Team-Machine-Session: p100604
pr 1003's own run then failed the same way on the emulator package, so the
cache now holds each job's whole package list, the same list setup-android
installs. a hit replaces the runner image's copies of those packages whole.

Validation: pending this branch's dispatch runs
Team-Machine-Session: p100604
Validation: actionlint and git diff --check passed. Read root/app/One Gradle NDK settings and WebGPU Gradle source; run 39684736046 compile log confirms Gradle installed 28.2.13676358 while 27.1.12297006 remains the root pin. Runtime save/restore proof pending.
Team-Machine-Session: r116388
@natew
natew merged commit 1c2d933 into main Oct 22, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant