-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tell meson to not search for CCache #2991
Comments
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 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 |
Maybe try setting |
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. |
|
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 $DISABLE_CCACHE is set, do not bother detecting ccache. This aligns with semantics of this variable in ccache itself. Similarly, if $DISABLE_SCCACHE is set, do not detect sccache. This variable has no special meaning for sccache, but using sccache in general is not always desirable, so there should be a way to prevent its detection. Fixes: mesonbuild#2991 mesonbuild#11118
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 |
Yes, indeed, an environment variable is easy to do. I misread the message. |
Work around mesonbuild/meson#2991 and mesonbuild/meson#11118 by performing (rudimentary) compiler detection and passing $CC and $CXX explicitly. This way, meson won't perform ccache/sccache detection and ccache/sccache will only be used if the user has configured $PATH accordingly.
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 #1506 but we need to define CC/CXX, something that Makepkg doesn't do.
The text was updated successfully, but these errors were encountered: