summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-01-26 19:28:06 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit3b648c294ef0a0aa7e5582e345cbf4a98cdea21f (patch)
treeb881f97af0ea2b887e7d19cddbfa7fbf5b9e5af2
parent520b71e89bc321a67b6c84d346b0be7d4f0ebaad (diff)
downloadspack-3b648c294ef0a0aa7e5582e345cbf4a98cdea21f.tar.gz
spack-3b648c294ef0a0aa7e5582e345cbf4a98cdea21f.tar.bz2
spack-3b648c294ef0a0aa7e5582e345cbf4a98cdea21f.tar.xz
spack-3b648c294ef0a0aa7e5582e345cbf4a98cdea21f.zip
concretizer: add initial package existence check
-rw-r--r--lib/spack/spack/solver/asp.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 3ed46328e4..e395a86701 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -166,6 +166,15 @@ def check_same_flags(flag_dict_1, flag_dict_2):
assert values1 == values2
+def check_packages_exist(specs):
+ """Ensure all packages mentioned in specs exist."""
+ repo = spack.repo.path
+ for spec in specs:
+ for s in spec.traverse():
+ if not (repo.exists(s.name) or repo.is_virtual(s)):
+ raise spack.repo.UnknownPackageError(s.name)
+
+
class AspGenerator(object):
def __init__(self, out):
self.out = out
@@ -669,6 +678,9 @@ class AspGenerator(object):
Arguments:
specs (list): list of Specs to solve
"""
+ # preliminary checks
+ check_packages_exist(specs)
+
# get list of all possible dependencies
self.possible_virtuals = set()
possible = spack.package.possible_dependencies(