Replace preinstalled cmdline-tools older than revision 23 - #494
matanbaruch wants to merge 2 commits into
Conversation
The install was gated on the absence of the cmdline-tools directory, so on GitHub-hosted runners that ship their own copy (ubuntu-24.04 ships 12.0) the bundled 23.0 was never downloaded and the stale revision went on PATH. Revision 12.0 cannot parse a dotted API level such as 37.1: avdmanager exits 0 but writes target=android-0 into the AVD ini, which mis-configures gfxstream and crash-loops the guest. Gate the install on Pkg.Revision instead, and remove the stale latest before extracting so the new package replaces it in place.
|
@ychescale9 I think intel cache wasn't warm. Can you re-run? |
The job fits 15 minutes only when the AVD snapshot cache is warm. On a cold cache it has to generate the snapshot, and the first boot of API 31 on that runner takes 3-5 minutes on top of a cold Gradle build and the SDK install, which put the last run at 15m17s and cancelled it mid-test. Keep 15 minutes everywhere else; the Linux jobs finish in about 5.
|
The macos-15-intel failure is a timeout, not a regression from this PR. I pushed a commit that gives that one job 20 minutes and leaves everything else at 15. What happened in run 33638038969:
For comparison, the last cold-cache run on main (32577705281, Aug 22) did the same work in 10m46s with a 3m17s first boot. So 15 minutes covers the cold path only when the runner is on the fast end. Warm-cache runs on that image finish in 6 to 8. One cost that is on this PR: once the preinstalled cmdline-tools is replaced (revision 16 on that image), sdkmanager delegates to the new Android CLI and downloads it on first use, so the SDK install step is about a minute more expensive on macOS than it is today. Real, but not what blew the budget. Let me know if you would rather have 20 everywhere, or the workflow left alone and the job just re-run. |
|
@ychescale9 the run from that push is sitting in It carries the 20 minute timeout on macos-15-intel, and the AVD cache is still cold there, so it should show whether 20 is actually enough or just closer. |
The bundled cmdline-tools install is gated on the
cmdline-toolsdirectory being absent, so on GitHub-hosted runners that already ship one (ubuntu-24.04ships revision 12.0) the download never runs and the stale revision goes on PATH. Revision 12.0 cannot parse a dotted API level such as37.1:avdmanagerexits 0 and writes a correctimage.sysdir.1, but putstarget=android-0in the AVD ini, which mis-configures gfxstream and makes the guest abort inmapper.ranchu.so(Assertion failed: !rcEnc->featureInfo()->hasReadColorBufferDma), crash-looping SurfaceFlinger and several system_server threads. The action already bundles 23.0, which parses those levels correctly.The fix: read
Pkg.Revisionfromcmdline-tools/latest/source.propertiesand install the bundled package when that revision is missing or older than 23, removing the stalelatestbefore extracting so the new package replaces it in place. No new input and no change toaction.yml. It is a no-op for integer API levels, where both revisions writetarget=android-36.Worth fixing in the action rather than leaving to users: the user-side workaround runs
sdkmanager --install "cmdline-tools;latest", which cannot replace the directory it runs from and lands in a siblinglatest-2that the action then ignores, because the action putscmdline-tools/latest/binon PATH and calls a bareavdmanager. The action downloads and extracts the zip itself, so it can replacelatestcorrectly.Related: #482 (closed, but only a user-side workaround was posted, the action itself was never changed), actions/runner-images#14484 (still open), issuetracker.google.com/issues/546200928 (Google's triage identified the tooling cause).
Abort counts on identical system images and emulator flags, cmdline-tools 12.0 vs 23.0:
37.0;google_apis37.1;ps16k37.2;ps16k