Conversation
Every zephyr-cp board job saved a new ~150 MB ccache entry under a key shared by all boards, and restored whichever entry was saved last. Measured over all 30 boards in one run: 5 boards hit by luck, 25 had one hit each, and the hit boards built no faster. The entries were filling the repository's 10 GB Actions cache and evicting the Zephyr SDK and other ports' caches. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude found and measured this, reviewed by @dhalbert.
This PR removes the use of ccache, because it was ineffective. It wasn't expensive to run, but it wasn't helping, either.
What ccache was doing
action-zephyr-setupenables ccache by default. Its cache key isccache-default-<timestamp>with the restore prefixccache-default-, so every zephyr-cp board job restores whichever entry any board saved most recently, adds its own objects, and saves a new ~150 MB entry. The surviving cache is a collection of whichever boards happened to save last; which boards it helps is luck.Measurement
#11417, a throw-away PR, measured what was going on by adding a
ccache -s -vstep after the build. It ran all 30 boards (run 35396278862). Every job restored the same 140 MB entry.nxp_frdm_rw612,nxp_mimxrt1170_evk,native_native_sim_asan,native_nrf5340bsim,native_nrf54lm20bsimAgainst the previous run on main with the same code, the five boards with full hits changed by -8 s on average and the 25 boards without full hits by -17 s; runner noise is ±50 s. ccache covers only the ~394 Zephyr objects, which ninja compiles in under a minute on the 4-core runner, and cpbuild calls the compiler directly so the CircuitPython objects never go through it. Restoring and saving the entry costs about 10 s per job.
Meanwhile the entries fill the repository's Actions cache: 49 new ccache entries were added in three hours of runs, 7.5 GB. The pool is at its 10 GB cap, so every run evicts older entries. The Zephyr SDK (0.5 GB), the espressif tools (1.2 GB) and the submodule caches share that pool.
A per-board key would give every board full hits, but the measurement above says full hits buy no time, and it would still add 30 entries per run.
Change
Set
enable-ccache: falseon theaction-zephyr-setupstep.Cleanup
Existing
ccache-default-*entries expire after a week unused, or can be removed now withgh cache delete.