(This is different to the question ccache and absolute path as I want only the command path to not be expanded on the ccache host machine)
When using ccache and distcc together ccache is expanding the compiler to an absolute path, and then distcc cannot use the PATH on the remote machine to choose which compiler to use.
e.g. I call CCACHE_PREFIX=distcc ccache g++ foo.cc
and ccache expands this into a local preprocessing step and cache check and then a call to distcc as distcc /usr/bin/g++
, which is the wrong version (g++ lives in the path on the remote before /usr/bin, but this doesn't give it the chance to search the path at all).
I have various different machines being used as distcc hosts, and they have the same version of gcc/g++ installed in different locations (yes, this problem goes away if I put them all in somewhere like /usr/local, but I can't do that at the moment).
Is there a setting to get ccache to pass just g++
to distcc rather than expanding the path to the absolute path of the local compiler? I'm not completely against patching ccache if there is no setting yet, but that's a last resort :)