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

Improve usage of ccache to speed up builds #396

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

jimklimov
Copy link
Contributor

Port of our (older) OBS setup, which benefits greatly from use of the same persistent ccache directory on all workers, ARM and amd64 alike (and Jenkins workers running builds in similar OS images too, added for good measure).

These changes allow to optionally enforce usage of ccache binary provided by the worker host (such approach should suffice for most Linux distros) even if the build-root does not pull ccache as a package, and to optionally bind-mount the cache directory from the worker's host so that a shared cache is easy to do.

Improvements:
* allow to mount a directory from worker's host OS as the /.ccache/ in the build root, so cache can be shared (including over NFS; tested for an ARM+AMD64 farm)
* use a /.ccache-bin/ rather than /var/lib/build/ccache/bin (easier to clean out)
* more reliably test for presence of compilers where absolute symlinks are used in build root (e.g. debian alternatives)
* allow fallback use of a ccache binary provided by the worker's host OS
* in case of cleanup, hit not only compiler basenames but also possible suffixes (arch, version, etc.)
If ccache was used in this build, optionally display its log in the end of build, so packagers know better if their recipes need to be tuned to take advantage of ccache (tune relative paths to source, etc.)
This should be enabled either via command-line arguments to "build", or caller can also enforce this via envvars (e.g. /etc/sysconfig/obs-worker file) with `export DO_CCACHE_STATISTICS=1`
…STATS that can be used to enable details while sourcing configs (e.g. via worker setup)
…lso pre-create the /.build.log.ccache and chown it to abuild user
@AdamMajer
Copy link
Member

ping? Anyone looking at this? Having ccache available in a project (or per project) would be a great benefit considering we have plenty of "rebuilds" where nothing changes.

@adrianschroeter
Copy link
Member

Sumit reworked the ccache a bit. It is merged meanwhile Could you check if this sufficient for you?

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.

3 participants