Currently, we have 3 types of usedeps: a) cat/pkg[opt] b) cat/pkg[opt(-)] c) cat/pkg[opt(+)] All three are equivalent if cat/pkg exposes the opt useflag. They differ only when it doesn't and mean: a) is an error b) considers it disabled c) considers it enabled I don't see the point of keeping a) around, except for leaving room for developers to trigger unspecified/invalid behavior. In a future eapi we could either: 1. kill b), make a) mean cat/pkg[opt(-)] 2. kill a)
The problem is that one cannot know in advance if [opt(-)] or [opt(+)] will be right. If a package always had the opt flag, and it is removed at some point, then it could mean either that the "opt" feature is removed, or that it is enabled unconditionally.
(In reply to Ulrich Müller from comment #1) Well, yes, but this is irrelevant to the above: if opt is removed, cat/pkg[opt] is an error according to pms. option 2. sums up to asking developers to chose explicitly. Another option, which is what portage seems to do, is to consider 2-style usedeps when cat/pkg doesn't expose the useflag to never be satisified, as: - cat/pkg[foo] <=> cat/pkg[foo(-)] - cat/pkg[-foo] <=> cat/pkg[-foo(+)]
(In reply to Alexis Ballier from comment #2) > (In reply to Ulrich Müller from comment #1) > > Well, yes, but this is irrelevant to the above: if opt is removed, > cat/pkg[opt] is an error according to pms. option 2. sums up to asking > developers to chose explicitly. They'll have to forsee the future in order to do that, which obviously is not possible (unless they have a crystal ball or something).
The spec says (https://projects.gentoo.org/pms/5/pms.html#x1-870008.2.6.4): "Unless a 4-style default is specified, it is an error for a use dependency to be applied to an ebuild which does not have the flag in question in IUSE_REFERENCEABLE." A dependency can either be satisfied or not. For example, if the package atom specified is not in the tree (which can be valid usage for || ( ) dependencies or for blockers) then simply does not match, but it is not an error. Therefore it seems unsystematic to say "it is an error" for the specific case that the target of a use dependency doesn't have the flag. Also, how is the package manager supposed to handle that error? Treat the ebuild specifying the dependency as masked ("by corruption")? Maybe we should change/clarify the wording. It should say that such a use dependency is not satisfied, i.e. in the following sense: (In reply to Alexis Ballier from comment #2) > Another option, which is what portage seems to do, is to consider 2-style > usedeps when cat/pkg doesn't expose the useflag to never be satisified, as: > - cat/pkg[foo] <=> cat/pkg[foo(-)] > - cat/pkg[-foo] <=> cat/pkg[-foo(+)] "Unless a 4-style default is specified, a use dependency does not match if applied to an ebuild which does not have the flag in question in IUSE_REFERENCEABLE."
(In reply to Ulrich Müller from comment #4) > The spec says (https://projects.gentoo.org/pms/5/pms.html#x1-870008.2.6.4): > "Unless a 4-style default is specified, it is an error for a use dependency > to be applied to an ebuild which does not have the flag in question in > IUSE_REFERENCEABLE." > > A dependency can either be satisfied or not. For example, if the package > atom specified is not in the tree (which can be valid usage for || ( ) > dependencies or for blockers) then simply does not match, but it is not an > error. yes, indeed > Therefore it seems unsystematic to say "it is an error" for the specific > case that the target of a use dependency doesn't have the flag. Also, how is > the package manager supposed to handle that error? Treat the ebuild > specifying the dependency as masked ("by corruption")? This is one way, a repoman error could be a good not so harsh solution too. > Maybe we should change/clarify the wording. It should say that such a use > dependency is not satisfied, i.e. in the following sense: > > (In reply to Alexis Ballier from comment #2) > > Another option, which is what portage seems to do, is to consider 2-style > > usedeps when cat/pkg doesn't expose the useflag to never be satisified, as: > > - cat/pkg[foo] <=> cat/pkg[foo(-)] > > - cat/pkg[-foo] <=> cat/pkg[-foo(+)] > > "Unless a 4-style default is specified, a use dependency does not match if > applied to an ebuild which does not have the flag in question in > IUSE_REFERENCEABLE." +1 after all, this is the one that makes most sense to me now.
The point of this is to catch developer mistakes. Without it there's no way of knowing whether a developer has checked the behaviour, or just forgotten to do something about it.
Closing per comment #6.