ccache "command not found" on the runner in CI
Your build invokes ccache as the compiler launcher, but the runner has no ccache binary on PATH. Nothing was cached because the wrapper itself never ran.
What this error means
A compile step fails with "ccache: command not found" or "/bin/sh: 1: ccache: not found", usually right after CMake configured CMAKE_CXX_COMPILER_LAUNCHER=ccache or a Makefile set CC="ccache gcc".
/bin/sh: 1: ccache: not found
make: *** [Makefile:42: main.o] Error 127Common causes
ccache is not installed on the image
The runner image ships gcc/clang but not ccache, so any launcher that shells out to ccache fails with exit 127.
ccache installed but not on PATH for this step
ccache was installed to a prefix (or a per-user bin) that the compile step's PATH does not include, so the shell cannot resolve it.
How to fix it
Install ccache before configuring the build
- Add a setup step that installs ccache from the package manager.
- Confirm it resolves with
ccache --version. - Only then configure CMake or Make to use it as the launcher.
- name: Install ccache
run: sudo apt-get update && sudo apt-get install -y ccache
- run: ccache --versionUse a maintained setup action
A dedicated action installs ccache and prepends it to PATH so both bare and launcher invocations resolve.
- uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccacheHow to prevent it
- Install ccache in a setup step before any compile step references it.
- Verify with
ccache --versionso a missing binary fails fast and clearly. - Bake ccache into custom runner images used for C/C++ builds.