Open emilio opened 5 years ago
ccache seems to just forward everything that doesn't quack as a compiler I guess:
$ ccache echo "foo"
foo
I was going to send a patch just handling the compile locally, but this looks like intentional, per caf08a7fd2d4449d7c6299c21c991721be38c8e4.
@luser do you know to what extent we care about ccache
parity / this case? I'm ok wontfixing this I guess, though it seems to have caused problems.
It looks like when ccache
's argument parsing fails it calls failed
:
https://github.com/ccache/ccache/blob/8bf69a1dd9dec1d3f8bcd161b50c86924b9bc464/src/ccache.cpp#L3785-L3788
which just runs the command as-is: https://github.com/ccache/ccache/blob/8bf69a1dd9dec1d3f8bcd161b50c86924b9bc464/src/ccache.cpp#L326-L340
I made this change in sccache
because we actually hit this case when switching to clang-cl
on Windows builds--sccache decided it was an unsupported compiler and we were failing to cache, but we weren't reporting those stats anywhere so we didn't notice until much later. I'd be fine with providing an opt-out environment variable here, but also what part of the servo build system is running ccache ar
? That isn't ever going to be useful.
This happened when using set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache)
in CMake while compiling a C++ library. This appears to be something built-in to CMake.
Ah! You should remove that. ccache
doesn't cache linker invocations either so it's not actually doing anyone any good. Some light Googling for RULE_LAUNCH_LINK
turned up this blog post which says the same thing: https://crascit.com/2016/04/09/using-ccache-with-cmake/
Yeah, it is the accepted answer here too: https://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmake
It seems this used to work, somehow. This broke Servo's build with sccache, see https://github.com/servo/servo/pull/24491.
STR:
With older sccache, I get the expected output:
Servo isn't the only project that was using
CCACHE=sccache
and relying on sccache to work as ccache does.See https://github.com/servo/skia/pull/180 / https://github.com/EOSIO/eosio.cdt/commit/d70cfd0ac707ad3cb4f82996f5c9ca632c6e98ea