diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-12-17 22:50:13 +0100 |
---|---|---|
committer | Tamara Dahlgren <dahlgren1@llnl.gov> | 2021-02-17 17:07:31 -0800 |
commit | cb76c5a90da62408356c818686bc3b325a8d7b99 (patch) | |
tree | 625f91f966b8ef18526898617b36a69ad158804e | |
parent | ab3f53d78197da12402e5e742fc6f12911bbb17b (diff) | |
download | spack-cb76c5a90da62408356c818686bc3b325a8d7b99.tar.gz spack-cb76c5a90da62408356c818686bc3b325a8d7b99.tar.bz2 spack-cb76c5a90da62408356c818686bc3b325a8d7b99.tar.xz spack-cb76c5a90da62408356c818686bc3b325a8d7b99.zip |
concretizer: fix failing unit tests
-rw-r--r-- | lib/spack/spack/solver/asp.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/solver/concretize.lp | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 3c7a1bfd17..42690fce04 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -1031,7 +1031,11 @@ class SpackSolverSetup(object): # add all clauses from dependencies if transitive: for dep in spec.traverse(root=False): - clauses.extend(self.spec_clauses(dep, body, transitive=False)) + if dep.virtual: + clauses.extend(self.virtual_spec_clauses(dep)) + else: + clauses.extend( + self.spec_clauses(dep, body, transitive=False)) return clauses diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 75f2af1e59..6bbd5c03e7 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -62,7 +62,15 @@ dependency_conditions(P, D, T) :- #defined dependency_type/2. % collect all the dependency conditions into a single conditional rule -dependency_conditions_hold(Package, Dependency, ID) :- +% distinguishing between Parent and Package is needed to account for +% conditions like: +% +% depends_on('patchelf@0.9', when='@1.0:1.1 ^python@:2') +% +% that include dependencies +dependency_conditions_hold(Parent, Dependency, ID) :- + node(Package) + : required_dependency_condition(ID, "node", Package); version(Package, Version) : required_dependency_condition(ID, "version", Package, Version); version_satisfies(Package, Constraint) @@ -79,10 +87,12 @@ dependency_conditions_hold(Package, Dependency, ID) :- : required_dependency_condition(ID, "node_compiler", Package, Compiler); node_compiler_version(Package, Compiler, Version) : required_dependency_condition(ID, "node_compiler_version", Package, Compiler, Version); + node_compiler_version_satisfies(Package, Compiler, Version) + : required_dependency_condition(ID, "node_compiler_version_satisfies", Package, Compiler, Version); node_flag(Package, FlagType, Flag) : required_dependency_condition(ID, "node_flag", Package, FlagType, Flag); - dependency_condition(Package, Dependency, ID); - node(Package). + dependency_condition(Parent, Dependency, ID); + node(Parent). #defined dependency_condition/3. #defined required_dependency_condition/3. |