Ability to disable sccache detection
This is an equivalent of #2991 but for sccache.
For original ccache, a workaround exists in form of setting CCACHE_DISABLE=1. However, for sccache no such workaround exists. In addition, Meson unconditionally prefers sccache to ccache, however:
- sccache is slower than ccache (much more overhead, which is noticeable on relatively slow machines);
- sccache is much less configurable/flexible than ccache
This behavior thus makes Meson counterproductive (and it cannot be disabled/overridden at all, short of removing sccache from PATH which is not an option on a developer's machine). There has to be a way to disable/override this behavior.
Seems reasonable although I think your env var should be called SCCACE_DISABLE.
Although I wonder if @jpakkane has any feedback on environment variables vs using a builtin option to disable this.
Yes, it's a mistake in the commit message, the actual code checks ${,S}CCACHE_DISABLE.
Actually I wrote that patch and now I actually doubt that it's a good solution, that's why I didn't post it as a PR. On one hand, it allows me to set it as a system-wide env var and forget about the issue, but on the other hand it is non-discoverable and quite cumbersome to use in other contexts.
It has the advantage at least for ccache in that it's "discoverable" in the sense that ccache itself says that it uses that variable.
I'm a bit curious though, when someone would want to disable sccache but automatically detect ccache?
@eli-schwartz
I'm a bit curious though, when someone would want to disable sccache but automatically detect ccache?
Two main reasons:
- sccache has noticeably more overhead than ccache (this matters on relatively slow systems, where a sccache run with hot cache can sometimes be nearly as slow as if cache was not used at all)
- sccache is significantly less flexible/configurable than ccache, the user might want to use ccache because they have non-trivial ccache configuration that suits their needs
At the same time, the user might want to keep sccache on their system e. g. for purposes of caching Rust builds (which ccache cannot do, and where per-invocation overhead of sccache does not matter because of larger build times with Rust).