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.
This commit is contained in:
Massimiliano Culpo 2021-10-21 17:44:36 +02:00
parent 1e90160d68
commit dd4d7bae1d

View File

@ -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,