ccache in CI - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: ccache in CI (/thread-2333.html) |
RE: ccache in CI - bearbin - 02-06-2016 I tested switching from clang to gcc with ccache. That seemed to fix the issue I was having, and now compilations are ~3x faster for a regular build and ~5x faster for a straight rebuild. I'm going to test with just the linux x86 and 64 build on ccache for now, to see if any problems come up. If they don't then I'll roll it out to all of the other builds also. RE: ccache in CI - LogicParrot - 02-07-2016 You could try using the symlink method to fix the clang issue. It is described in the manual. The idea is to masquadate ccache as the compiler binary using symlinks. In Debian the symlinks are prepared in advance and this it's as simple as running `export PATH=/usr/lib/ccache/:$PATH` before running cmake. RE: ccache in CI - bearbin - 02-07-2016 Only problem: /usr/lib/ccache/clang doesn't exist, so that method couldn't work. RE: ccache in CI - LogicParrot - 02-07-2016 (02-07-2016, 02:56 AM)bearbin Wrote: Only problem: /usr/lib/ccache/clang doesn't exist, so that method couldn't work. Just symlink to clang. cd /usr/lib/ccache/ && ln -s /usr/bin/clang . RE: ccache in CI - bearbin - 02-07-2016 How would that help? It's not a "magic directory", so what would that command actually do? RE: ccache in CI - LogicParrot - 02-07-2016 (02-07-2016, 07:49 PM)bearbin Wrote: How would that help? It's not a "magic directory", so what would that command actually do? It makes ccache masquerade as the compiler. So now when cmake calls "clang", it actually just calls a symlink to ccache. ccache then detects that it's being invoked via a symlink called "clang", so it passes all compilation arguments that it receives to /bin/clang. Yes, /usr/lib/ccache is not magic, you could have done this with any directory. It happens to be the default masqueradation directory in Debian. See the first run mode in the manual for more info. RE: ccache in CI - bearbin - 02-08-2016 I think you may have mistyped your command. Did you mean: cd /usr/lib/ccache/ && ln -s /usr/bin/ccache clang RE: ccache in CI - LogicParrot - 02-08-2016 (02-08-2016, 03:05 AM)bearbin Wrote: I think you may have mistyped your command. Did you mean: Yes. Sorry. RE: ccache in CI - bearbin - 02-14-2016 Using the symlink method allows clang to operate well. The builds appear to be stable, and I'm going to try to roll out ccache to the other ones if I can. RE: ccache in CI - LogicParrot - 02-14-2016 Great! Consider enabling the hard_link (CCACHE_HARDLINK) option, it will save some disk writing, "If true, ccache will attempt to use hard links from the cache directory when creating the compiler output rather than using a file copy. Using hard links may be slightly faster in some situations, but can confuse programs like “make” that rely on modification times. Another thing to keep in mind is that if the resulting object file is modified in any way, this corrupts the cached object file as well. Hard links are never made for compressed cache files. This means that you should not enable compression if you want to use hard links. The default is false. " |