Skip to content

Dev container: ccache's cache in a volume of its own - #106

Merged
theAndreas merged 2 commits into
mainfrom
ccache-volume
Nov 16, 2026
Merged

theAndreas merged 2 commits into
mainfrom
ccache-volume

Conversation

@theAndreas

Copy link
Copy Markdown
Owner

ccache made a fresh worktree's builds fast (v0.11.1), but its cache lay in ~/.cache/ccache on the container's own file system, which a rebuild of the dev container throws away. The first make check after a rebuild compiled every host build again; in MaxMatrix, after a rebuild today, 113 of 688 compiles hit the cache.

The cache now lives in a named volume of its own, <namespace>-ccache, as uv's cache and the Arduino core already do. The Dockerfile creates the path as the remote user first, as it does for those, so that the empty volume is not owned by root. The template's own dev container gets the same volume, for the projects tests/check.sh builds.

For a project: after copier update, rebuild the dev container. The volume starts empty and fills with the first build.

How it was checked: a project made from this branch passes tests/check.sh lint; its rendered devcontainer-feature.json and the repository's parse, with the new mount among the others. Not checked: a rebuild with the volume, as there is no Docker in this container. The first rebuild after the update shows it: ccache -s should report hits on the second make check after a rebuild, and ls -ld ~/.cache/ccache should show the remote user as its owner.

ccache kept what the host builds compiled in ~/.cache/ccache, on the
container's own file system, which a rebuild throws away: the first make
check after one compiled everything again. A named volume keeps it, as
uv's cache and the Arduino core are kept; the Dockerfile makes the path as
the remote user first, as for those.
@theAndreas theAndreas closed this Nov 16, 2026
@theAndreas theAndreas reopened this Nov 16, 2026
@theAndreas
theAndreas merged commit 18db8a0 into main Nov 16, 2026
1 of 2 checks passed
@theAndreas
theAndreas deleted the ccache-volume branch November 16, 2026 15:51
@theAndreas theAndreas mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants