fix: a compiler package sets dependent build environment only if used as such

This commit is contained in:
Massimiliano Culpo 2024-11-18 19:02:24 +01:00
parent 320fb7dde7
commit 4bedae3d3a
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C

View File

@ -194,6 +194,13 @@ def enable_new_dtags(self) -> str:
def setup_dependent_build_environment(self, env, dependent_spec):
# FIXME (compiler as nodes): check if this is good enough or should be made more general
# The package is not used as a compiler, so skip this setup
if not any(
lang in dependent_spec and dependent_spec[lang].name == self.spec.name
for lang in ("c", "cxx", "fortran")
):
return
# Populate an object with the list of environment modifications and return it
link_dir = pathlib.Path(spack.paths.build_env_path)