Compare commits

...

1 Commits

Author SHA1 Message Date
Harmen Stoppels
09407ae960 ccache: set base_dir 2025-02-05 12:56:19 +01:00
2 changed files with 3 additions and 4 deletions

3
lib/spack/env/cc vendored
View File

@ -960,9 +960,6 @@ if [ -n "$SPACK_CCACHE_BINARY" ]; then
case "$lang_flags" in
C|CXX) # ccache only supports C languages
prepend full_command_list "${SPACK_CCACHE_BINARY}"
# workaround for stage being a temp folder
# see #3761#issuecomment-294352232
export CCACHE_NOHASHDIR=yes
;;
esac
fi

View File

@ -610,9 +610,11 @@ def set_wrapper_variables(pkg, env):
if spack.config.get("config:ccache"):
# Enable ccache in the compiler wrapper
env.set(SPACK_CCACHE_BINARY, spack.util.executable.which_string("ccache", required=True))
env.set("CCACHE_NOHASHDIR", "")
env.set("CCACHE_BASEDIR", os.path.realpath(spack.stage.get_stage_root()))
else:
# Avoid cache pollution if a build system forces `ccache <compiler wrapper invocation>`.
env.set("CCACHE_DISABLE", "1")
env.set("CCACHE_DISABLE", "")
# Gather information about various types of dependencies
rpath_hashes = set(s.dag_hash() for s in get_rpath_deps(pkg))