Gentoo Archives: gentoo-portage-dev

From: Michael Lienhardt <michael.lienhardt@×××××××.net>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-portage-dev] erroneous behavior in 2-style USE dependencies?
Date: Wed, 17 Jun 2020 08:08:36
Message-Id: e31b11f9-af7a-02c0-500b-54e04e66ac0c@laposte.net
In Reply to: Re: [gentoo-portage-dev] erroneous behavior in 2-style USE dependencies? by Zac Medico
1 On 6/17/20 1:25 AM, Zac Medico wrote:
2 > On 6/16/20 7:47 PM, Michael Lienhardt wrote:
3 >>
4 >>
5 >> On 6/16/20 11:59 PM, Zac Medico wrote:
6 >>> On 6/16/20 6:38 PM, Michael Lienhardt wrote:
7 >>>> With the first version of DEPEND, emerge succeed:
8 >>>> # emerge -pv app-misc/dummy-master
9 >>>>
10 >>>> These are the packages that would be merged, in order:
11 >>>>
12 >>>> Calculating dependencies... done!
13 >>>> [ebuild N ] app-misc/dummy-slave-2::gentoo USE="-static-libs" 0 KiB
14 >>>> [ebuild N ] app-misc/dummy-master-1::gentoo USE="-static-libs" 0 KiB
15 >>>
16 >>> This success is expected, yes? Do you suggest to change the behavior
17 >>> somehow?
18 >>
19 >> The way I interpret the PMS, this success is not expected:
20 >> the atom ">=app-misc/dummy-slave-1" matches the cpv "app-misc/dummy-slave-1" which does not contains the use flag 'static-libs',
21 >> and thus I expected a 'missing use flag' error.
22 >
23 > For this calculation, it would be a waste of time to read the IUSE
24 > metadata for app-misc/dummy-slave-1, since app-misc/dummy-slave-2 is the
25 > highest available version.
26
27 Good point.
28 I changed the version of app-misc/dummy-slave-1 into app-misc/dummy-slave-3 (so now the higher version is the one without the 'static-libs' use flag), and still no error/warning message.
29
30 > I hope that PMS does not specify that package managers must read IUSE
31 > metadata for irrelevant package versions!
32
33 I think there is indeed an ambiguity there:
34 Section 8.3 of the PMS states when a cpv matches an atom, but does not say which cpvs should be tested against an atom during dependency analysis.
35 This is where my interpretation was maybe wrong: when I see "error" in Section 8.3.4 I understand
36 "all cpv matching an atom with this 2-style USE dependency *must* have the use flag declared, otherwise
37 the .ebuild should be considered erroneous" (I have a strong notion of error).
38 I thus thought that all .ebuilds in the distributed repos were checked (before distribution -- not by emerge) against that error.
39
40 But maybe, "error" here in the PMS mean "the cpvs without the use flag does not match that dependency and a warning should be raised to improve compatibility in the future".
41 In that case, it would be clearer for me to change 'error' in the PMS into something like "results in a no match, but should be avoided".
42 That way, it is explicitly stated that missing use flags for a 2-style USE dependency is accepted (which is the current behavior of emerge) but frown upon,
43 without forcing any specific error handling, like Michał accurately pointed out.
44
45
46 >> I'm not suggesting to change the behavior of emerge, I'm saying that:
47 >> - the way I read the PMS, I expect behavior A, but in practice, I see behavior B.
48 >> - what does the portage devs / PMS gurus think about that?
49 >> - is my understanding of the PMS wrong, and it actually says "behavior B is expected"?
50 >> - if yes, where did I fail in my understanding?
51 >> - if no, should emerge or the PMS be updated so they both describe the same behavior?
52 >> - I will implement your ruling in my tool, which I try to match as closely as possible to the PMS
53 >
54 > In this context I think the spirit of what PMS says is that the package
55 > manager should emit some kind of warning message if it finds missing
56 > IUSE. Now, in the example above, if the package manager has no reason to
57 > examine the IUSE metadata of app-misc/dummy-slave-1 because
58 > app-misc/dummy-slave-2 is the highest available version, then there's no
59 > opportunity for it to emit a warning message.
60
61 From what I've seen now, emerge considers a 2-style USE dependency error as a "no match without warning message", and fails with my second version of DEPEND because there are no .ebuild matching the dependency: the error message it issues only describes why there is no solution, it is not a warning about an erroneous dependency.
62
63 Best,
64 Michael

Replies