Skip to content
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

Open
Salamandar opened this issue Jan 29, 2018 · 11 comments
Open

Tell meson to not search for CCache #2991

Salamandar opened this issue Jan 29, 2018 · 11 comments

Comments

@Salamandar
Copy link
Contributor

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.

@jpakkane
Copy link
Member

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.

@Salamandar
Copy link
Contributor Author

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

@1ace
Copy link
Contributor

1ace commented Feb 15, 2019

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

@nirbheek
Copy link
Member

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

@eli-schwartz
Copy link
Member

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.

@henning-schild
Copy link

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

@intelfx
Copy link

intelfx commented Nov 30, 2022

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 added a commit to intelfx/meson that referenced this issue Nov 30, 2022
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
@jpakkane
Copy link
Member

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.

@Salamandar
Copy link
Contributor Author

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

@eli-schwartz
Copy link
Member

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.

@Salamandar
Copy link
Contributor Author

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

intelfx added a commit to intelfx/bin that referenced this issue Dec 31, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants