diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2024-06-20 11:16:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 11:16:24 +0200 |
commit | f650133f83e438bc0630e49eae258985666ce582 (patch) | |
tree | f7cd52569c415c7a35c4aa3c54811988b1bcc4bc /lib | |
parent | 81f9d5baa569ebae15f45fe5ced11d8126a648f2 (diff) | |
download | spack-f650133f83e438bc0630e49eae258985666ce582.tar.gz spack-f650133f83e438bc0630e49eae258985666ce582.tar.bz2 spack-f650133f83e438bc0630e49eae258985666ce582.tar.xz spack-f650133f83e438bc0630e49eae258985666ce582.zip |
build_environment: fix ccache error handling (#44740)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_environment.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 97e0ff6e0e..2b8cc1fca1 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -72,6 +72,7 @@ import spack.stage import spack.store import spack.subprocess_context import spack.user_environment +import spack.util.executable import spack.util.path import spack.util.pattern from spack import traverse @@ -458,10 +459,7 @@ def set_wrapper_variables(pkg, env): # Find ccache binary and hand it to build environment if spack.config.get("config:ccache"): - ccache = Executable("ccache") - if not ccache: - raise RuntimeError("No ccache binary found in PATH") - env.set(SPACK_CCACHE_BINARY, ccache) + env.set(SPACK_CCACHE_BINARY, spack.util.executable.which_string("ccache", required=True)) # Gather information about various types of dependencies link_deps = set(pkg.spec.traverse(root=False, deptype=("link"))) |