SPACK-41: bugfix for nonconvergent normalize()
- constrain() wasn't reporting changes properly.
This commit is contained in:
parent
095ff1cb4a
commit
805122c789
@ -1014,9 +1014,9 @@ def _normalize_helper(self, visited, spec_deps, provider_index):
|
|||||||
any_change = False
|
any_change = False
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
pkg = spack.db.get(self.name)
|
||||||
while changed:
|
while changed:
|
||||||
changed = False
|
changed = False
|
||||||
pkg = spack.db.get(self.name)
|
|
||||||
for dep_name in pkg.dependencies:
|
for dep_name in pkg.dependencies:
|
||||||
# Do we depend on dep_name? If so pkg_dep is not None.
|
# Do we depend on dep_name? If so pkg_dep is not None.
|
||||||
pkg_dep = self._evaluate_dependency_conditions(dep_name)
|
pkg_dep = self._evaluate_dependency_conditions(dep_name)
|
||||||
@ -1132,16 +1132,19 @@ def constrain(self, other, **kwargs):
|
|||||||
raise UnsatisfiableArchitectureSpecError(self.architecture,
|
raise UnsatisfiableArchitectureSpecError(self.architecture,
|
||||||
other.architecture)
|
other.architecture)
|
||||||
|
|
||||||
|
changed = False
|
||||||
if self.compiler is not None and other.compiler is not None:
|
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:
|
elif self.compiler is None:
|
||||||
|
changed |= (self.compiler != other.compiler)
|
||||||
self.compiler = other.compiler
|
self.compiler = other.compiler
|
||||||
|
|
||||||
changed = False
|
|
||||||
changed |= self.versions.intersect(other.versions)
|
changed |= self.versions.intersect(other.versions)
|
||||||
changed |= self.variants.constrain(other.variants)
|
changed |= self.variants.constrain(other.variants)
|
||||||
changed |= bool(self.architecture)
|
|
||||||
|
old = self.architecture
|
||||||
self.architecture = self.architecture or other.architecture
|
self.architecture = self.architecture or other.architecture
|
||||||
|
changed |= (self.architecture != old)
|
||||||
|
|
||||||
if constrain_deps:
|
if constrain_deps:
|
||||||
changed |= self._constrain_dependencies(other)
|
changed |= self._constrain_dependencies(other)
|
||||||
|
@ -92,4 +92,3 @@ def test_transitive_chain(self):
|
|||||||
# the whole chain.
|
# the whole chain.
|
||||||
self.check_normalize('optional-dep-test+f',
|
self.check_normalize('optional-dep-test+f',
|
||||||
Spec('optional-dep-test+f', Spec('f'), Spec('g'), Spec('mpi')))
|
Spec('optional-dep-test+f', Spec('f'), Spec('g'), Spec('mpi')))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user