summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-11-04 20:54:37 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit522be6cadfadc7c69a3cee75a78a3c440c34bca6 (patch)
tree84e80fc90dcf7631c8b4aa9ef7e7925b27403b6d
parent5c5a44988e5f7eebe84150a41776e772cb2941a6 (diff)
downloadspack-522be6cadfadc7c69a3cee75a78a3c440c34bca6.tar.gz
spack-522be6cadfadc7c69a3cee75a78a3c440c34bca6.tar.bz2
spack-522be6cadfadc7c69a3cee75a78a3c440c34bca6.tar.xz
spack-522be6cadfadc7c69a3cee75a78a3c440c34bca6.zip
External packages have a consistent hash across different concretizers
-rw-r--r--lib/spack/spack/solver/asp.py2
-rw-r--r--lib/spack/spack/test/concretize.py11
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 64e9f62e5d..b83cf133c3 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -1644,7 +1644,7 @@ class SpecBuilder(object):
spec_info = packages_yaml[pkg]['externals'][int(idx)]
self._specs[pkg].external_path = spec_info.get('prefix', None)
self._specs[pkg].external_modules = (
- spack.spec.Spec._format_module_list(spec_info.get('modules', []))
+ spack.spec.Spec._format_module_list(spec_info.get('modules', None))
)
self._specs[pkg].extra_attributes = spec_info.get(
'extra_attributes', {}
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
index df8d893adc..6275954df0 100644
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -855,3 +855,14 @@ class TestConcretize(object):
s = Spec(spec_str).concretized()
assert s.external
assert s.satisfies(expected)
+
+ def test_external_packages_have_consistent_hash(self):
+ if spack.config.get('config:concretizer') == 'original':
+ pytest.skip('This tests needs the ASP-based concretizer')
+
+ s, t = Spec('externaltool'), Spec('externaltool')
+ s._old_concretize(), t._new_concretize()
+
+ assert s.dag_hash() == t.dag_hash()
+ assert s.build_hash() == t.build_hash()
+ assert s.full_hash() == t.full_hash()