summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-10-21 17:44:36 +0200
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-10-25 09:11:04 +0200
commitdd4d7bae1dfdcba1697b7c669b5518bfd2daf39c (patch)
tree876f962224e890fc8ecdcc273f938155d32131f3
parent1e90160d681e80f212fd357128ca8af63ef576f0 (diff)
downloadspack-dd4d7bae1dfdcba1697b7c669b5518bfd2daf39c.tar.gz
spack-dd4d7bae1dfdcba1697b7c669b5518bfd2daf39c.tar.bz2
spack-dd4d7bae1dfdcba1697b7c669b5518bfd2daf39c.tar.xz
spack-dd4d7bae1dfdcba1697b7c669b5518bfd2daf39c.zip
ASP-based solver: a package eligible to provide a virtual must provide it
fixes #26866 This semantics fits with the way Spack currently treats providers of virtual dependencies. It needs to be revisited when #15569 is reworked with a new syntax.
-rw-r--r--lib/spack/spack/solver/concretize.lp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp
index b85d2f798a..33044e0d38 100644
--- a/lib/spack/spack/solver/concretize.lp
+++ b/lib/spack/spack/solver/concretize.lp
@@ -190,6 +190,11 @@ provides_virtual(Provider, Virtual) :-
% fulfill the conditions to provide that virtual
:- provider(Package, Virtual), not provides_virtual(Package, Virtual).
+% If a package meets the condition to be a provider, it needs to be a provider
+:- not provider(Package, Virtual),
+ provides_virtual(Package, Virtual),
+ virtual_node(Virtual).
+
% If a package is selected as a provider, it is provider of all
% the virtuals it provides
:- provides_virtual(Package, V1), provides_virtual(Package, V2), V1 != V2,