Tell meson to not search for CCache
When building on ArchLinux with !ccache in makepkg.conf, Meson still searches for CCache.
Meson could expose a "--no-ccache" argument to disable the automatic CCache search, even if CC/CXX is not in the environment.
Yes, I'm aware of https://github.com/mesonbuild/meson/pull/1506 but we need to define CC/CXX, something that Makepkg doesn't do.
Is the problem that it searches for ccache or the fact that it finds it? If the latter then your build env should make sure that ccache is not in path when that option is set.
I'd say the problem is that Meson searches for CCache. If !ccache is in makepkg.conf, that means the build script should not even search for CCache.
But we don't want to "shadow" ccache from the env: what if we just want to detect the available CCache version, without actually using it ? (when building an IDE, plugin, build system,...)
Just ran into this issue; is there any workaround until --ccache=false gets implemented?
Maybe try setting ccache = 'false' in the native file?
Is the problem that it searches for ccache or the fact that it finds it? If the latter then your build env should make sure that ccache is not in path when that option is set.
This is a bit difficult to do when the binaries for everything are all in /usr/bin -- it's of course doable when building every software compilation in a clean build chroot with minimal dependencies.
Traditionally, the Arch Linux build system does not care whether ccache is installed, but if the buildenv is told to use ccache, it will prepend /usr/lib/ccache/bin to the $PATH in order to shadow the compiler executables.
export CCACHE_DISABLE=1 now the wrapper will be a noop, just like it was never detected in the first place
Same issue exists with sccache. Meson prefers sccache to ccache, however 1) sccache is slower and 2) sccache is significantly less flexible/configurable. For me, this behavior of Meson is actually counterproductive, and you cannot disable/override it.
If you set your compiler either with a native/cross file or with an environment variable, then Meson will use that and won't add ccache/sccache even if they exist in path.
@jpakkane a cross file is clearly more difficult to set up than to add a command line flag when calling meson.
I'm decidedly unsure how that answers what @jpakkane said?
The suggestion was "either a native file or an environment variable", and an environment variable and a command line flag are equally easy to set up, differing only in whether it comes before or after the meson command itself.
Yes, indeed, an environment variable is easy to do. I misread the message.