[ccache] Using CCache in Continous Integration Server

Sam Hendley sam.hendley at plymouthsystems.com
Thu Nov 13 21:56:10 GMT 2008

This is really just a post for google's cache since I found my solution
but I don't want anyone else to have to go through the same difficulties
as I did. 


On our build server every revision is checked out to a different temp
directory and rebuilt from scratch. This was taking too long so I
decided to try ccache to speed things up, it all worked well on my
manual tests on the build server so I tried it in production. All of the
"release" builds ran about 3 times faster than before but the most
important debug build wasn't getting cached. I had run across posts
talking about the timestamps in object files due to having -g3 enabled
but that didn't appear to be the issue since we only had -g enabled. I
eventually narrowed it down to it being in different directories and
then took a look at the preprocessed output and found that gcc 4.1
enables the flag -fworking-directory by default; this meant the second
line in the file is the absolute file name of the cpp file being
compiled which clearly screws the hash function. Adding the option:
-fno-working-directory removes that line and lets builds done in
different directories all take advantage of ccache.



More information about the ccache mailing list