summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2015-05-12 14:52:46 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2015-05-12 14:52:46 -0700
commit805122c7895e9498a5330654cb18d3ad7e6a40a1 (patch)
tree308f685145f2cf388b6bacfca35edad9ff3b1b60 /lib
parent095ff1cb4ab3923ac31fb269df8e390438e492b4 (diff)
downloadspack-805122c7895e9498a5330654cb18d3ad7e6a40a1.tar.gz
spack-805122c7895e9498a5330654cb18d3ad7e6a40a1.tar.bz2
spack-805122c7895e9498a5330654cb18d3ad7e6a40a1.tar.xz
spack-805122c7895e9498a5330654cb18d3ad7e6a40a1.zip
SPACK-41: bugfix for nonconvergent normalize()
- constrain() wasn't reporting changes properly.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/spec.py11
-rw-r--r--lib/spack/spack/test/optional_deps.py1
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 0fd9b1f5f5..4a67614be7 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1014,9 +1014,9 @@ class Spec(object):
any_change = False
changed = True
+ pkg = spack.db.get(self.name)
while changed:
changed = False
- pkg = spack.db.get(self.name)
for dep_name in pkg.dependencies:
# Do we depend on dep_name? If so pkg_dep is not None.
pkg_dep = self._evaluate_dependency_conditions(dep_name)
@@ -1132,16 +1132,19 @@ class Spec(object):
raise UnsatisfiableArchitectureSpecError(self.architecture,
other.architecture)
+ changed = False
if self.compiler is not None and other.compiler is not None:
- self.compiler.constrain(other.compiler)
+ changed |= self.compiler.constrain(other.compiler)
elif self.compiler is None:
+ changed |= (self.compiler != other.compiler)
self.compiler = other.compiler
- changed = False
changed |= self.versions.intersect(other.versions)
changed |= self.variants.constrain(other.variants)
- changed |= bool(self.architecture)
+
+ old = self.architecture
self.architecture = self.architecture or other.architecture
+ changed |= (self.architecture != old)
if constrain_deps:
changed |= self._constrain_dependencies(other)
diff --git a/lib/spack/spack/test/optional_deps.py b/lib/spack/spack/test/optional_deps.py
index 669e02f8c9..265a983f3f 100644
--- a/lib/spack/spack/test/optional_deps.py
+++ b/lib/spack/spack/test/optional_deps.py
@@ -92,4 +92,3 @@ class ConcretizeTest(MockPackagesTest):
# the whole chain.
self.check_normalize('optional-dep-test+f',
Spec('optional-dep-test+f', Spec('f'), Spec('g'), Spec('mpi')))
-