Question

How can I setup a shared ccache without falling into a permissions problem?

I would like to run a nightly or CI build with latest changes and share all created binaries throughout the R&D using a large ccache repository.

Was it helpful?

Solution

The easiest solution: create a new group (e.g. "devel"), and make all developers members of it. Give read/write permissions to that group on the directory hierarchy where the cache is maintained. The developers will also need to fix their umask.

OTHER TIPS

See the newly written Sharing a cache section in ccache's manual. In essence, use the same CCACHE_DIR setting, set CCACHE_UMASK appropriately and consider using CCACHE_BASEDIR.

If you also use the related distcc, then the permission problems would largely go away, as the compilations would be run under it's control on whatever compile-farm hosts you set.

You could also include the developers desktop machines among the distcc hosts, though at the expense of having some duplicated work where a file would potentially be compiled on more than one machine - though it would never return an out of date compiled object file. It would also speed up day to day recompilations.

You might also take a look at Mozilla's sccache, which is a ccache-like tool that can store build artifacts in cloud storage (GCS/S3/Azure or redis/memcached).

Please see xcache.
It's ccache-cloud and has been used in alibaba which has high efficiency. If you are using ccache, it would be very easy to switch to xcache.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top