meson icon indicating copy to clipboard operation
meson copied to clipboard

Tell meson to not search for CCache

Open Salamandar opened this issue 7 years ago • 11 comments

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.

Salamandar avatar Jan 29 '18 17:01 Salamandar

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.

jpakkane avatar Jan 29 '18 19:01 jpakkane

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,...)

Salamandar avatar Feb 01 '18 14:02 Salamandar

Just ran into this issue; is there any workaround until --ccache=false gets implemented?

1ace avatar Feb 15 '19 17:02 1ace

Maybe try setting ccache = 'false' in the native file?

nirbheek avatar Feb 15 '19 18:02 nirbheek

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.

eli-schwartz avatar Feb 27 '19 18:02 eli-schwartz

export CCACHE_DISABLE=1 now the wrapper will be a noop, just like it was never detected in the first place

henning-schild avatar Jul 22 '22 13:07 henning-schild

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.

intelfx avatar Nov 30 '22 09:11 intelfx

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 avatar Nov 30 '22 10:11 jpakkane

@jpakkane a cross file is clearly more difficult to set up than to add a command line flag when calling meson.

Salamandar avatar Dec 01 '22 22:12 Salamandar

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.

eli-schwartz avatar Dec 01 '22 22:12 eli-schwartz

Yes, indeed, an environment variable is easy to do. I misread the message.

Salamandar avatar Dec 02 '22 14:12 Salamandar