[ccache] cache 3.2.2 calls the compiler with a relative path if CCACHE_BASEDIR is set

Alessio Massaro masariello+ccache at gmail.com
Fri May 22 08:10:15 MDT 2015


Hi All

I've attached a little reproducer for the following problem.

If CCACHE_BASEDIR is set, under certain conditions ccache will invoke
the compiler with a relativized path to the source file. This breaks
certain mechanisms I have in the code that rely on __FILE__ being an
absolute path.

I use CMake to build, which always uses absolute paths when invoking
the compiler (unless you ask it to "try" not to)

Am I doing something wrong? Is there a workaround to the problem?

Thank you very much in advance for any light you can shed on this!

-alessio

Here's how to reproduce the problem:

export CCACHE_DIR=/tmp/ccache_testexport CCACHE_UMASK=002export
CCACHE_BASEDIR=/path/to/reproducer_CCACHE_BASEDIR/code


/path/to/reproducer_CCACHE_BASEDIR/build $
/tp64/ccache/3.2.2/bin/ccache /usr/bin/c++ -o main.cpp.o -c
/path/to/reproducer_CCACHE_BASEDIR/code/main.cpp/path/to/reproducer_CCACHE_BASEDIR/build
$   /tp64/ccache/3.2.2/bin/ccache /usr/bin/c++ main.cpp.o  -o
test__FILE__ -rdynamic/path/to/reproducer_CCACHE_BASEDIR/build $
./test__FILE____FILE__ = ../code/main.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reproducer_CCACHE_BASEDIR.zip
Type: application/zip
Size: 1723 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/ccache/attachments/20150522/5ce2d652/attachment.zip>


More information about the ccache mailing list