Fix setting SPACK_TARGET_ARGS for concrete specs

This commit is contained in:
Massimiliano Culpo 2024-11-15 08:09:20 +01:00
parent 5492b9cc6d
commit f79354c312
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C

View File

@ -219,8 +219,7 @@ def setup_dependent_build_environment(self, env, dependent_spec):
env.set("SPACK_LINKER_ARG", self.linker_arg)
detector = spack.compilers.libraries.CompilerPropertyDetector(self.spec)
paths = detector.implicit_rpaths()
paths = _implicit_rpaths(pkg=self)
if paths:
env.set("SPACK_COMPILER_IMPLICIT_RPATHS", ":".join(paths))
@ -233,7 +232,7 @@ def setup_dependent_build_environment(self, env, dependent_spec):
env.set("SPACK_DTAGS_TO_ADD", self.enable_new_dtags)
spec = self.spec
uarch = spec.architecture.target
uarch = dependent_spec.architecture.target
version_number, _ = archspec.cpu.version_components(spec.version.dotted_numeric_string)
try:
isa_arg = uarch.optimization_flags(spec.name, version_number)
@ -276,6 +275,12 @@ def setup_dependent_build_environment(self, env, dependent_spec):
env.set_path("SPACK_ENV_PATH", env_paths)
def _implicit_rpaths(pkg: spack.package_base.PackageBase) -> List[str]:
detector = spack.compilers.libraries.CompilerPropertyDetector(pkg.spec)
paths = detector.implicit_rpaths()
return paths
@memoized
def _compiler_output(
compiler_path: Path, *, version_argument: str, ignore_errors: Tuple[int, ...] = ()