-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Change ccache directory to docker volume #22188
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
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: afbjorklund The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR aims to improve build performance for the minikube ISO by avoiding the lengthy process of building cmake from source and enabling persistent ccache storage via a Docker volume. The changes install cmake via apt (which is significantly faster than building from source) and configure a ccache directory that can be persisted across builds.
Key changes:
- Add cmake to the list of apt packages to avoid building it from source during the buildroot process
- Configure a custom ccache directory at
/var/cache/buildroot/ccacheand declare it as a Docker volume for potential persistence across builds
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # the default ccache dir is "$HOME/.buildroot-ccache" | ||
| ENV BR_CACHE_DIR=/var/cache/buildroot/ccache | ||
| RUN mkdir -p /var/cache/buildroot/ccache && chmod 1777 /var/cache/buildroot/ccache | ||
| VOLUME ["/var/cache/buildroot"] |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VOLUME declaration will create an anonymous volume that won't persist between builds by default. To make the ccache persist and provide the performance benefits intended by this PR, the Makefile's docker run commands (lines 338 and 344) should mount a named volume or host directory to /var/cache/buildroot. Without this, each build will start with an empty ccache, negating the performance benefit. Consider either: 1) Adding an explicit volume mount in the Makefile's docker run commands, or 2) Documenting that users should set ISO_DOCKER_EXTRA_ARGS="-v minikube-buildroot-cache:/var/cache/buildroot" to benefit from ccache persistence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While true, this can come in a later PR
|
I double-checked, and both variables will have the same end result. Not sure why it was failing before? The problem was that it was prepending $HOME to the directory, so Seems to be working now: I have no name!@ff4e04d005f8:/mnt$ out/buildroot/output-x86_64/host/bin/ccache -sv
Cache directory: /var/cache/buildroot/ccache
Config file: /var/cache/buildroot/ccache/ccache.conf
System config file: /mnt/out/buildroot/output-x86_64/host/etc/ccache.conf |
And apt install cmake to avoid host-cmake
e51a9af to
c704dc1
Compare
|
@afbjorklund: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
And apt install cmake to avoid host-cmake
Building cmake is the second longest build time (after the kernel)!
It even takes longer time than the compiler (gcc) and glibc packages.