summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-03-21 14:59:15 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-03-21 14:59:15 -0700
commit77b94f6030032f31c469184197ba7546843fba1d (patch)
treedceec1f786113266b71ffde1bc7bdacb8437500d
parent6f9a0e73bbef591d0ca829e4b81bb245b2c81d69 (diff)
parent5d06daeb5eed28b4b91ba62a8f99165d87b5ef86 (diff)
downloadspack-77b94f6030032f31c469184197ba7546843fba1d.tar.gz
spack-77b94f6030032f31c469184197ba7546843fba1d.tar.bz2
spack-77b94f6030032f31c469184197ba7546843fba1d.tar.xz
spack-77b94f6030032f31c469184197ba7546843fba1d.zip
Merge pull request #595 from mplegendre/bugfix/issue-573-concretize-compilers
Bugfix/issue 573 concretize compilers
-rw-r--r--lib/spack/spack/concretize.py4
-rw-r--r--lib/spack/spack/test/concretize.py7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 8083f91982..2e576743ec 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -241,7 +241,7 @@ class DefaultConcretizer(object):
return False
#Find the another spec that has a compiler, or the root if none do
- other_spec = find_spec(spec, lambda(x) : x.compiler)
+ other_spec = spec if spec.compiler else find_spec(spec, lambda(x) : x.compiler)
if not other_spec:
other_spec = spec.root
other_compiler = other_spec.compiler
@@ -288,7 +288,7 @@ def find_spec(spec, condition):
if condition(spec):
return spec
- return None # Nohting matched the condition.
+ return None # Nothing matched the condition.
def cmp_specs(lhs, rhs):
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
index f264faf17a..08cce09674 100644
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -309,3 +309,10 @@ class ConcretizeTest(MockPackagesTest):
Spec('d')),
Spec('e'))
self.assertEqual(None, find_spec(s['b'], lambda s: '+foo' in s))
+
+
+ def test_compiler_child(self):
+ s = Spec('mpileaks%clang ^dyninst%gcc')
+ s.concretize()
+ self.assertTrue(s['mpileaks'].satisfies('%clang'))
+ self.assertTrue(s['dyninst'].satisfies('%gcc'))