views:

310

answers:

3

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.

+2  A: 

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.

zvrba
A: 

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.

Alister Bulman
+1  A: 

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.

Joel Rosdahl