summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()