Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable ccache #78

Closed
wants to merge 1 commit into from
Closed

Re-enable ccache #78

wants to merge 1 commit into from

Conversation

lunacd
Copy link
Contributor

@lunacd lunacd commented Mar 24, 2024

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

** 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
@lunacd
Copy link
Contributor Author

lunacd commented Jun 15, 2024

Superseded by #82

@lunacd lunacd closed this Jun 15, 2024
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.

Re-enable ccache in CI
1 participant