summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-10-31 05:02:17 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commite226523aeb7df132aab50275e8591e6a941de536 (patch)
tree99a552c581520e80262bf78130c44aa33b194416
parente7208b159800aa8e458fecc86668d250814ba3a7 (diff)
downloadspack-e226523aeb7df132aab50275e8591e6a941de536.tar.gz
spack-e226523aeb7df132aab50275e8591e6a941de536.tar.bz2
spack-e226523aeb7df132aab50275e8591e6a941de536.tar.xz
spack-e226523aeb7df132aab50275e8591e6a941de536.zip
concretizer: handle dependencies conditional on other dependencies
-rw-r--r--lib/spack/spack/solver/asp.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index c1e483577f..eb54026bf8 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -918,13 +918,12 @@ class SpackSolverSetup(object):
)
)
else:
+ clauses = self.spec_traverse_clauses(named_cond)
+
self.gen.rule(
fn.declared_dependency(
dep.pkg.name, dep.spec.name, t
- ),
- self.gen._and(
- *self.spec_clauses(named_cond, body=True)
- )
+ ), self.gen._and(*clauses)
)
# add constraints on the dependency from dep spec.
@@ -945,11 +944,17 @@ class SpackSolverSetup(object):
clause,
self.gen._and(
fn.depends_on(dep.pkg.name, dep.spec.name),
- *self.spec_clauses(named_cond, body=True)
+ *self.spec_traverse_clauses(named_cond)
)
)
self.gen.newline()
+ def spec_traverse_clauses(self, named_cond):
+ clauses = []
+ for d in named_cond.traverse():
+ clauses.extend(self.spec_clauses(d, body=True))
+ return clauses
+
def virtual_preferences(self, pkg_name, func):
"""Call func(vspec, provider, i) for each of pkg's provider prefs."""
config = spack.config.get("packages")