[mythtv] A cautionary tale on the use of ccache

Stuart Auchterlonie stuarta at squashedfrog.net
Mon Feb 20 16:39:58 UTC 2017


On 20/02/17 15:00, roger wrote:
> I have recently been building from a number of separate mythtv clone
> repositories on the same machine, each have a number of modifications to
> some files. I recently deleted one of those repos.
> 
> I run eclipse CDT as my development environment. I started to experience
> problems with breakpoints when running gdb via eclipse. The source path
> lookup for eclipse is extremely complicated and totally undocumented.
> Running gdb from the command line worked OK and I added source
> directories to the gdb source path as I needed them.
> 
> I have just spent a considerable amount of time over the last couple of
> weeks trying work out what mistakes I had made with the eclipse
> configuration. Things just did not make any sense. So I starting tracing
> eclipse interactions with gdb and looking at the debug information in
> various mythtv shared libraries using objdump. I did not notice it at
> first but a eventually realised that all the full absolute source paths
> where pointing to the repo I had deleted!! I then looked at the build
> logs but could not find anything in them that showed this old path being
> given to the build tools. What I could see was that the compilations
> were being done in the correct new directories. So how were this old
> paths getting into the debug info in the executables.
> 
> I then remembered that all our compiles are done via ccache. Ok, I
> thought, I will run a distclean and ./configure --previous, that should
> fix it!
> 
> Result....the old paths were still there!!!!
> 
> I then ran "cache -C".
> 
> Result...success.
> 
> I you have not changed anything in a source file ccache will think that
> it can give you a cached object file from a compilation done in another
> directory even if the correspond source does not exist any more. You
> will not notice anything amiss until you try debugging something in
> anything but the most simple command line environment.
> 
> I think we should put cache -C somewhere in the distclean!

That would entirely defeat it's purpose, especially on the build slaves
which have limited resources. The arm builds take long enough with
a primed ccache!

If you are happy taking the hit of building the whole thing from
scratch each time, then uninstall it.

For the rest of us it saves an enormous amount of time during a
dev / build / test cycle.

Personally I make a note to do a full distclean and a ccache clean
whenever a significant change to the repositories happen. I also don't
happen to work in multiple build directories (apart from fixes/0.28 and
master) at one time.


Regards
Stuart


> 
> Roger
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org



More information about the mythtv-dev mailing list