diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 169958f7044e69..9958f16efe3466 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1269,11 +1269,13 @@ def architecture(self): raise ValueError("Can only get the arch for concrete package.") return spack.architecture.arch_for_spec(self.spec.architecture) - @property + @property # type: ignore + @memoized def compiler(self): """Get the spack.compiler.Compiler object used to build this package""" if not self.spec.concrete: raise ValueError("Can only get a compiler for a concrete package.") + return spack.compilers.compiler_for_spec(self.spec.compiler, self.spec.architecture)