From 0fab079ed8731d0b580a17a09a756d78e7a50a64 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 19 Aug 2026 15:41:13 +0700 Subject: 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 : 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. --- .circleci/config2.yml | 10 +++------- 1 file 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 >> -- cgit v1.3.1