[mythtv] Using ccache for native builds in win32 build script

Jonathan Martens jonathan at snetram.nl
Mon Feb 21 17:39:58 UTC 2011

On 21-2-2011 11:12, Lawrence Rust wrote:
> I'm not sure that using ccache for the Qt build would be useful.  In a
> normal environment Qt is built just once,  There should be relatively
> few times when a clean build is necessary.  In those cases using ccache
> could actually slow the build due to ccache saving the intermediates.

That might be true, I have not timed everything. The overhead of ccache 
seems pretty low, but this is just a gut feeling. At the moment I am 
still unable to compile Qt with ccache. For some strange reason it seems 
to bail out looking for a file CreateProcess, which should is a native 
Windows function AFAICT.
I do see a benefit for using ccache in Qt. By the nature of it's 
mechanism ccache will also result in faster compilation of Qt when a new 
version is released and used to build against as lots of the Qt files 
will be the same, which then can be taken from the cache.

> I see that you create wrapper scripts for cpp, c++, gcc and g++  which
> means that ccache will be used for every compilation.

Yes, the other way is symlinking or specifying a compiler command as a 
define when compiling. Symlinking, does not work as it seems that MinGW 
does not create real symbolic link, it seems to be more like a hard 
link, which in itself is not supported as specified in the ccache docs.
The define option could be an easier way to go when we do not want to 
compile everything under ccache.

 > I can see the
> advantage for MythTV, but most of the other libs are only built once.
> Adding a ccache wrapper to these one-off builds might actually slow
> things down.

See my easrlier point, I think there is a benefit, when we upgrade the 
versions we compile against.

> For instance the default max cache size is 1GB but the
> mythbuild folder (including mysql&  Qt but not mythtv) is 3.5G.  This is
> likely to lead to thrashing.

Building everything under ccache (up to Qt) yields a pretty small cache 
folder under 50Mb, so that does not seem to much of an issue to me, it 
is possible to specify a size based maxiumum or on file count, but 
limits can also be unset.

> In normal usage (repetitive MythTV rebuilds), ccache is detected by
> mythtv/configure so the wrapper scripts aren't necessary.

I have not investigated that, but that is nice.

> Incidentally, I got bored manually updating the script and patch
> archives so I setup a git repo for them about 2 weeks ago.  You can find
> it here:
> git clone http://www.softsystem.co.uk/git/mythbuilder.git

That is nice, any particular reason for not using GitHub? It makes 
following and forking a little easier.

Kind regards,


More information about the mythtv-dev mailing list