Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: New Portage fork: sys-apps/portage-mgorny
Date: Wed, 28 Mar 2018 04:45:01
Message-Id: pan$5d13e$9ddc5a2e$f8966815$e77af2c2@cox.net
In Reply to: Re: [gentoo-dev] New Portage fork: sys-apps/portage-mgorny by "Vadim A. Misbakh-Soloviov"
1 Vadim A. Misbakh-Soloviov posted on Sun, 25 Mar 2018 17:13:28 +0700 as
2 excerpted:
3
4 > Well, in *my* opinion, in turn, having possibility to {R,}DEPEND on
5 > package from exact repo is much and much more needed functionality.
6 >
7 > Say, I have pkg2 in my repo, that depends on pkg1, which is in my repo
8 > too. Then, I (or user) add other repo having pkg1 too. Or, say, gentoo
9 > maintainers bump pkg1 to a newer version (while I'm slacking a bit).
10 > And my pkg1 is a bit different from gentoo's (let it be patchset, or,
11 > say, lua.eclass support for lua overlay).
12 >
13 > So, that changes results in random unexpected behaviour as blocks,
14 > runtime breakage and so on.
15
16 > Currently, it is no way to say "only dep-pkg from that exact repo is
17 > 100% works as expected", so there is still the chance, that someday pkg4
18 > would fail to build because suddenly pkg3 was reinstalled from another
19 > "incompatible" repo...
20
21 > And, honestly, current ways to resolve that issue (adding
22 > dummy-useflags, copy_here&rename, and so on) looks as very dirty hacks.
23
24 [Note that while the following is written using second-person "you",
25 nothing personal or accusatory intended. I simply started with second
26 person and then realized half way thru that because it was written in
27 second person it could be taken as offensive, which wasn't my intent, but
28 didn't want to go back and adjust the whole thing to detached third-party
29 viewpoint just to keep the technical point I had already made, so I chose
30 the disclaimer method instead. And as a second disclaimer, please see
31 the last paragraph; maybe I'm missing the obvious...]
32
33 Actually, I'd argue that the problem as described is well within what USE
34 flags are designed for, and that using a USE flag in this case makes
35 /perfect/ sense. Consider the description above:
36
37 * pkg2 deps on pkg1, both of which are in your repo.
38
39 * But your pkg1 is different in some way, custom patch set, say, or lua
40 eclass support from its overlay.
41
42 * Your pkg2 deps on that difference.
43
44 Seems a perfect match for USE flag deps to me. Make your pkg2 dep on pkg1
45 conditional on a USE flag added to pkg1 when you changed it from what's
46 likely to appear in gentoo or another overlay, making that change in
47 behavior conditional on the USE flag and setting it up so flag-missing
48 behavior is -flag.
49
50 Problem solved.
51
52 That creates an optional change in behavior toggled by a USE flag, and
53 makes some other package dependent on that option by depending on that
54 USE flag. Isn't that exactly what USE flags and USE flag deps are
55 /supposed/ to do?
56
57
58 Of course that pre-supposes that you want to go to all the work of doing
59 it /correctly/ and making your change fully optional and togglable by
60 individual per-package USE flags and deps that fit the individual cases,
61 instead of taking the hacky shortcut of simply hard-coding your copy to
62 do it your way, but "dummy USE flags" that do nothing but control the
63 repo, because the behavior is hardcoded instead of setup via actually
64 togglable USE flag aren't any more hacky than that hard-coding that makes
65 them required in the first place. It's really just part of the same
66 hack, and if you're satisfied with the hacky hardcoded shortcut, it seems
67 you should be satisfied with the hacky USE flag to make it work because
68 you hardcoded the behavior as a shortcut instead of making it properly
69 togglable, as well.
70
71 But if you /do/ want to simply take the expedient route and do hacks such
72 as hardcoding choices (hey, I've taken the hardcoded behavior shortcut
73 myself a few times) etc, and you're doing it pretty much globally,
74 affecting many otherwise independent things thru the entire overlay, then
75 it would seem to me that the most efficient method would be to simply do
76 the fake-flag (call it overlayname-hardcoded or some such, obviously
77 replacing overlayname as appropriate) hack by policy, adding it to your
78 global USE flag settings in make.conf, and to every package as soon as
79 you add it to your overlay. Then you can depend on the flag as
80 necessary, without having to worry about what it does in an individual
81 package.
82
83 Tho even that's actually pretty comparable to how users work with global
84 USE flags. And if it's named overlayname-hardcoded or similar, you /are/
85 actually describing the USE flag, and how you're using it in the deps,
86 reasonably accurately, even if there's no actual option to turn it off in
87 the packages in your overlay.
88
89 ... Tho it's quite possible there's holes in this argument that I'm
90 simply not seeing, thus making my posting as much or more about asking
91 others to point out the holes I can't see, so I /can/ see them, as it is
92 about attempting to convince anyone of the correctness of my viewpoint as
93 I'm posting it. Sure I could be wrong, but if I am, please point it out
94 so I can see it too! =:^)
95
96 --
97 Duncan - List replies preferred. No HTML msgs.
98 "Every nonfree program has a lord, a master --
99 and if you use the program, he is your master." Richard Stallman