Fix ccache never being saved in container CI jobs#49
Merged
Conversation
54c1b9f to
19fcdb6
Compare
3 tasks
actions/cache post step runs on the HOST after the container is removed, so ~/ expands to /home/runner (host runner home) rather than /github/home where ccache actually writes inside the container. The cache path was always empty at save time, so no cache entry was ever uploaded. Use github.workspace-relative path for both the cache path and CCACHE_DIR so the same physical directory is used inside the container and when the host-side post step uploads the cache. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Makes the cache directory explicit rather than relying on HOME resolution, consistent with how CI sets CCACHE_DIR via the workflow environment. The value matches the volume mount in devcontainer.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19fcdb6 to
2eb0f31
Compare
ltowarek
added a commit
to ltowarek/dust-mite
that referenced
this pull request
May 16, 2026
* Explicitly set CCACHE_DIR in devcontainer Dockerfile Makes the cache directory explicit rather than relying on HOME resolution, consistent with how CI sets CCACHE_DIR. The value matches the ccache volume mount in devcontainer.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix ccache never being saved in container CI job Same root cause as ltowarek/esp-opentelemetry-cpp#49: actions/cache POST step runs on the host after the container is removed, so ~/.ccache expands to /home/runner (host home) while ccache wrote to /github/home inside the container — the cache path was always empty, so nothing was ever uploaded. Use github.workspace-relative path for both the cache path and CCACHE_DIR so the same physical directory is used inside the container and when the host-side post step uploads the cache. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <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.
Summary
actions/cachePOST step (save) runs on the host runner after the container is stopped, not inside the container~expands to/home/runner(host home), but ccache ran inside the container and wrote to/github/home/.ccache— a completely different pathThe fix is to use
${{ github.workspace }}/.ccachefor both the cache path andCCACHE_DIR. The workspace directory is bind-mounted, so it resolves to the same physical path inside the container (/__w/.../esp-opentelemetry-cpp/.ccache) and on the host when the post step saves the cache.Also includes the Dockerfile key path fix from #48 (already merged to main).
Test plan
Cache restored from key: ccache-Linux-idf-...appears🤖 Generated with Claude Code