summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew W Elble <aweits@rit.edu>2020-12-03 10:28:34 -0500
committerGitHub <noreply@github.com>2020-12-03 16:28:34 +0100
commit09aae616c760a3abb782aa3353c3476851b6a590 (patch)
treed6a154a3836a5ee92c3ef96c9dde1c3b9404236d /lib
parent39be60ab929c90ce9c1c459d3511454efab04b92 (diff)
downloadspack-09aae616c760a3abb782aa3353c3476851b6a590.tar.gz
spack-09aae616c760a3abb782aa3353c3476851b6a590.tar.bz2
spack-09aae616c760a3abb782aa3353c3476851b6a590.tar.xz
spack-09aae616c760a3abb782aa3353c3476851b6a590.zip
concretizer: call inject_patches_variants() on the roots of the specs (#20203)
As was done in the old concretizer. Fixes an issue where conditionally patched dependencies did not show up in spec (gdal+jasper)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/solver/asp.py4
-rw-r--r--lib/spack/spack/test/cmd/dependents.py6
-rw-r--r--lib/spack/spack/test/concretize.py8
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index b15c4826be..56f4ba75a4 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -1826,8 +1826,8 @@ class SpecBuilder(object):
# fix flags after all specs are constructed
self.reorder_flags()
- for s in self._specs.values():
- spack.spec.Spec.inject_patches_variant(s)
+ for root in set([spec.root for spec in self._specs.values()]):
+ spack.spec.Spec.inject_patches_variant(root)
# Add external paths to specs with just external modules
for s in self._specs.values():
diff --git a/lib/spack/spack/test/cmd/dependents.py b/lib/spack/spack/test/cmd/dependents.py
index 681b255d05..bd87f92a65 100644
--- a/lib/spack/spack/test/cmd/dependents.py
+++ b/lib/spack/spack/test/cmd/dependents.py
@@ -23,7 +23,8 @@ def test_immediate_dependents(mock_packages):
'libdwarf',
'patch-a-dependency',
'patch-several-dependencies',
- 'quantum-espresso'
+ 'quantum-espresso',
+ 'conditionally-patch-dependency'
])
@@ -38,7 +39,8 @@ def test_transitive_dependents(mock_packages):
'multivalue-variant',
'singlevalue-variant-dependent',
'patch-a-dependency', 'patch-several-dependencies',
- 'quantum-espresso'
+ 'quantum-espresso',
+ 'conditionally-patch-dependency'
])
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
index 8366ecca14..fed0432f91 100644
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -967,3 +967,11 @@ class TestConcretize(object):
s = Spec('a %gcc@foo os=redhat6').concretized()
assert '%gcc@foo' in s
+
+ def test_all_patches_applied(self):
+ uuidpatch = 'a60a42b73e03f207433c5579de207c6ed61d58e4d12dd3b5142eb525728d89ea'
+ localpatch = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
+ spec = spack.spec.Spec('conditionally-patch-dependency+jasper')
+ spec.concretize()
+ assert ((uuidpatch, localpatch) ==
+ spec['libelf'].variants['patches'].value)