diff options
| author | hathach <[email protected]> | 2026-08-19 15:41:13 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-08-19 15:41:13 +0700 |
| commit | 0fab079ed8731d0b580a17a09a756d78e7a50a64 (patch) | |
| tree | 26fcc01b540fab0a89ef4c8a430e6639706fa481 | |
| parent | 9c202e8c657e001c8d16753aa90046a5f373575f (diff) | |
ci(circleci): key the toolchain cache off a file that always exists
Restore/Save Toolchain Cache have been failing on every job whose toolchain
is hosted on GitHub - arm-gcc, arm-clang, riscv-gcc, rx-gcc, ft9xx-gcc:
Restore Toolchain Cache
template: cacheKey:1:8: executing "cacheKey" at <checksum "toolchain_key">:
error calling checksum: open /home/circleci/project/tinyusb/toolchain_key:
no such file or directory
"Set toolchain url and key" only wrote toolchain_key when the URL was not a
github.com link, but both cache steps referenced {{ checksum "toolchain_key" }}
unconditionally, so for those toolchains the key could never be computed. The
job still went green because the build step does not depend on the cache, which
is why this went unnoticed - but the two steps are permanently red and the
toolchain is re-downloaded on every single run.
Key the cache on the toolchain name plus a checksum of toolchain.json instead.
That file is in the repo, so the checksum always resolves, and the key still
invalidates whenever a toolchain URL changes. toolchain_key is no longer needed.
Side effect worth calling out: GitHub-hosted toolchains are now cached rather
than skipped. That was the intent of the removed condition, but it is also what
broke the steps - CircleCI cannot skip a cache step on a value only known at
run time. Caching them also saves the repeated download.
| -rw-r--r-- | .circleci/config2.yml | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/.circleci/config2.yml b/.circleci/config2.yml index 4cd848131..e0bd917a4 100644 --- a/.circleci/config2.yml +++ b/.circleci/config2.yml @@ -8,18 +8,14 @@ commands: steps: - run: - name: Set toolchain url and key + name: Set toolchain url command: | toolchain_url=$(jq -r '."<< parameters.toolchain >>"' .github/actions/setup_toolchain/toolchain.json) - # only cache if not a github link - if [[ $toolchain_url != "https://github.com"* ]]; then - echo "<< parameters.toolchain >>-$toolchain_url" > toolchain_key - fi echo "export toolchain_url=$toolchain_url" >> $BASH_ENV - restore_cache: name: Restore Toolchain Cache - key: deps-{{ checksum "toolchain_key" }} + key: deps-<< parameters.toolchain >>-{{ checksum ".github/actions/setup_toolchain/toolchain.json" }} paths: - ~/cache/<< parameters.toolchain >> @@ -59,7 +55,7 @@ commands: - save_cache: name: Save Toolchain Cache - key: deps-{{ checksum "toolchain_key" }} + key: deps-<< parameters.toolchain >>-{{ checksum ".github/actions/setup_toolchain/toolchain.json" }} paths: - ~/cache/<< parameters.toolchain >> |
