summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/concretize.py4
-rw-r--r--lib/spack/spack/spec.py13
2 files changed, 6 insertions, 11 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index af3f3a3b18..bcbe1b74b8 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -113,7 +113,9 @@ class DefaultConcretizer(object):
# Find the nearest spec in the dag that has a compiler. We'll
# use that spec to calibrate compiler compatibility.
- abi_exemplar = find_spec(spec, lambda x: x.compiler, spec.root)
+ abi_exemplar = find_spec(spec, lambda x: x.compiler)
+ if abi_exemplar is None:
+ abi_exemplar = spec.root
# Sort candidates from most to least compatibility.
# We reverse because True > False.
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index ed204deb9e..70a27fb951 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1178,20 +1178,13 @@ class Spec(object):
@property
def root(self):
"""Follow dependent links and find the root of this spec's DAG.
- In spack specs, there should be a single root (the package being
- installed). This will throw an assertion error if that is not
- the case.
+
+ Spack specs have a single root (the package being installed).
"""
if not self._dependents:
return self
- # If the spec has multiple dependents, ensure that they all
- # lead to the same place. Spack shouldn't deal with any DAGs
- # with multiple roots, so something's wrong if we find one.
- depiter = iter(self._dependents.values())
- first_root = next(depiter).parent.root
- assert(all(first_root is d.parent.root for d in depiter))
- return first_root
+ return next(iter(self._dependents.values())).parent.root
@property
def package(self):