summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/concretize.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 6c230a151b..2a5ce65fa4 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -222,9 +222,10 @@ class DefaultConcretizer(object):
spec.architecture = spack.spec.ArchSpec(sys_arch)
spec_changed = True
- default_archs = [root_arch, sys_arch]
- while not spec.architecture.concrete and default_archs:
- arch = default_archs.pop(0)
+ default_archs = list(x for x in [root_arch, sys_arch] if x)
+ for arch in default_archs:
+ if spec.architecture.concrete:
+ break
replacement_fields = [k for k, v in iteritems(arch.to_cmp_dict())
if v and not getattr(spec.architecture, k)]
@@ -232,6 +233,9 @@ class DefaultConcretizer(object):
setattr(spec.architecture, field, getattr(arch, field))
spec_changed = True
+ if not spec.architecture.concrete:
+ raise InsufficientArchitectureInfoError(spec, default_archs)
+
return spec_changed
def concretize_variants(self, spec):
@@ -466,6 +470,17 @@ class NoValidVersionError(spack.error.SpackError):
% (spec.name, spec.versions))
+class InsufficientArchitectureInfoError(spack.error.SpackError):
+
+ """Raised when details on architecture cannot be collected from the
+ system"""
+
+ def __init__(self, spec, archs):
+ super(InsufficientArchitectureInfoError, self).__init__(
+ "Cannot determine necessary architecture information for '%s': %s"
+ % (spec.name, str(archs)))
+
+
class NoBuildError(spack.error.SpackError):
"""Raised when a package is configured with the buildable option False, but
no satisfactory external versions can be found"""