Description
I am attempting to build a Rust project while using sccache only as a replacement for ccache for CC and CXX.
The project I am attempting to build is the Rust ssh2
crate.
My first approach was to set CC="sccache gcc" and CXX="sccache g++" .
However, cmake split the CC string into 'sccache' as the compiler and 'gcc' as a compiler flag. (Also CC="'sccache gcc'" didn't work as well)
So I created bash files :
sccache-cc
#!/bin/bash
sccache gcc "$@"
and set CC="sccache-cc"
this came from this tip for making ccache work with CMake here
This got much farther, however it appears that CMake expected gcc to do something different with the .o file than was expected by sccache, because the result is :
sccache: encountered fatal error
sccache: error : failed to store `x25519-x86_64.o` to cache
sccache: cause: failed to store `x25519-x86_64.o` to cache
sccache: cause: failed to zip up compiler outputs
sccache: cause: No such file or directory (os error 2)
thread '<unnamed>' panicked at 'execution failed', /usr/local/cargo/registry/src/github.jpy.wang-1ecc6299db9ec823/ring-0.11.0/build.rs:658:8
Has anyone encountered an error like this? Better question : Has anyone convinced ccache to work nicely with CMake?
Thanks.