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.
Fixes #50
Review Requested
I used
'**/*.cpp', '**/*.h', '**/meson.build', 'subprojects/*.wrap'
as the ccache cache key. This list should include everything that could affect what is built and how it is built. Is that a complete a list? Should I include wrap files to this list?Changes
Docker does not natively support exporting cache mounts, or saving it to some external cache storage like the GHA cache.
This commit uses a workaround described in [1] where the content in the cache mount is moved into a dumb container and then exported through its file system. To load recovered cache into the cache mount, another dumb container is built and its build process copies recovered cache into the cache mount.
This is very much a hack and shouldn't be necessary once docker natively supported by buildx.
Justification for not caching more build steps
dnf, apt, and pip can theoretically also be cached this way. However, if the list of dependencies have not been changed, the entire docker layer would be a cache hit and dnf/apt caches would not be beneficial. Considering that dependency changes should be rare, not caching them seems wise.
[1] moby/buildkit#1512