[ccache] lilypond doesn't compile with ccache (DEPENDENCIES_OUTPUT)

Martin Pool mbp at samba.org
Wed Aug 13 12:15:38 EST 2003


On 10 Aug 2003, Koblinger Egmont <egmont at uhulinux.hu> wrote:

> ./out/axis.o: axis.cc include/axes.hh include/string.hh \
>   include/arithmetic-operator.hh include/flower-proto.hh include/real.hh \
>   include/string-handle.hh include/string-handle.icc \
>   include/string-data.hh include/string-data.icc include/international.hh \
>   include/compare.hh include/string.icc
> 
> but when ccache is used, this file has one more line:
> 
> ./out/axis.o: axis.cc include/axes.hh include/string.hh \
>   include/arithmetic-operator.hh include/flower-proto.hh include/real.hh \
>   include/string-handle.hh include/string-handle.icc \
>   include/string-data.hh include/string-data.icc include/international.hh \
>   include/compare.hh include/string.icc
> ./out/axis.o: /home/egmont/.ccache/tmp.stdout.boci.5961.ii
> 
> All the other *.dep files have a similar extra line appended which point
> to some ccache-internal filename, which means that somehow ccache fails to
> remain transparent for lilypond.
> 
> The command that generates this .dep file is:
> 
> DEPENDENCIES_OUTPUT="./out/axis.dep ./out/axis.o" c++ -c -DHAVE_CONFIG_H
> -DSTRING_UTILS_INLINED -Iinclude -I./out -I../flower/include
> -I../flower/./out -O2 -finline-functions -g -O2 -finline-functions -g
> -Wall -W -Wmissing-prototypes -Wconversion -o out/axis.o axis.cc

Thankyou for reporting this.

It looks like the problem is that DEPENDENCIES_OUTPUT is read by both
cpp and cc1, so it gets dependencies for both .h->.i and .i->.o.
Almost certainly you only want the first one.

You can work around this in lilypond by using -MD -MF rather than
DEPENDENCIES_OUTPUT.

I think ccache (and distcc) ought to strip DEPENDENCIES_OUTPUT before
invoking the compiler, so that you only get the first dependencies
line.

> Please take a look at this problem. It seems to me that ccache should fix
> the DEPENDENCIES_OUTPUT files after running gcc itself, but real
> developers should know it better than me :-)
> 
> Another trivial workaround might be to let an existing DEPENDENCIES_OUTPUT
> env variable simply imply CCACHE_DISABLE. A small patch is attached.

I don't think such severe measures are needed.

> Have a nice holiday,

Thankyou!  How did you know? :-)

-- 
Martin 



More information about the ccache mailing list