diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 0752908a389..a65b5fc60f1 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1374,8 +1374,13 @@ def cshort_spec(self): @property def prefix(self): + if hasattr(self, 'test_prefix'): + return Prefix(self.test_prefix) return Prefix(spack.store.layout.path_for_spec(self)) + def _set_test_prefix(self, val): + self.test_prefix = val + def dag_hash(self, length=None): """Return a hash of the entire spec DAG, including connectivity.""" if self._hash: