Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Underscores in USE flags
Date: Fri, 20 Sep 2019 20:13:26
Message-Id: CAJ0EP40r754wnUO8sYz-yAjLC2XXQAJ6a==E=FPWWqY3P8L+wA@mail.gmail.com
In Reply to: Re: [gentoo-dev] Underscores in USE flags by "Haelwenn (lanodan) Monnier"
1 On Fri, Sep 20, 2019 at 3:03 PM Haelwenn (lanodan) Monnier
2 <contact@×××××××××.me> wrote:
3 >
4 > [2019-09-20 13:24:45-0400] Mike Gilbert:
5 > > On Fri, Sep 20, 2019 at 12:55 PM Michał Górny <mgorny@g.o> wrote:
6 > > > On Fri, 2019-09-20 at 12:41 -0400, Mike Gilbert wrote:
7 > > > > On Fri, Sep 20, 2019 at 12:11 PM Michał Górny <mgorny@g.o> wrote:
8 > > > > > On Fri, 2019-09-20 at 11:46 -0400, Mike Gilbert wrote:
9 > > > > > > Recently, a large number of bugs were filed against packages that have
10 > > > > > > USE flag names which contain underscores. Apparently PMS prohibits
11 > > > > > > this except when the USE flag is part of a USE_EXPAND variable.
12 > > > > > >
13 > > > > > > https://projects.gentoo.org/pms/7/pms.html#x1-200003.1.4
14 > > > > > >
15 > > > > > > I'm not certain when this text was added to PMS, or how many of the
16 > > > > > > affected USE flags pre-date this policy.
17 > > > > > >
18 > > > > > > Portage seems to have no issue dealing with underscores, so this
19 > > > > > > doesn't seem to be solving any technical problem.
20 > > > > > >
21 > > > > > > I am pretty sure that renaming a bunch of USE flags will cause some
22 > > > > > > amount of end-user confusion, for very little benefit. Is enforcing
23 > > > > > > this part of PMS really worth it?
24 > > > > >
25 > > > > > And having packages with pretended-USE_EXPAND-that-does-not-work-as-
26 > > > > > USE_EXPAND is less confusing to the users?
27 > > > >
28 > > > > I doubt users immediately think "USE_EXPAND" when they see an underscore.
29 > > > >
30 > > > > Portage's seems fairly unambiguous to me. For example:
31 > > > >
32 > > > > % emerge -pv1O app-misc/foo
33 > > > >
34 > > > > These are the packages that would be merged, in order:
35 > > > >
36 > > > > [ebuild N ] app-misc/foo-0::local USE="-modern_kernel"
37 > > > > PYTHON_TARGETS="python3_7" VIDEO_CARDS="radeon" 0 KiB
38 > > > >
39 > > > > Total: 1 package (1 new), Size of downloads: 0 KiB
40 > > > >
41 > > > > I don't think anyone would mistake "modern_kernel" for a USE_EXPAND
42 > > > > value given the above.
43 > > >
44 > > > Look at the humongous list of flags on dev-libs/aws-sdk-cpp. They all
45 > > > start with 'aws_targets' which is a clear attempt to emulate USE_EXPAND.
46 > > > Expect that they won't work as USE_EXPAND, user typing:
47 > > >
48 > > > AWS_TARGETS="foo bar baz"
49 > > >
50 > > > will just wildly confused, and in the end this prefixing is just silly
51 > > > and causes the flag names to become awfully long.
52 > >
53 > > Ok, so you chery-picked one particularly horrible example. The Portage
54 > > output still puts them in USE="" section, though the user probably
55 > > won't see that given the massive USE flag list.
56 > >
57 > > My point still stands for many of the other packages in the repo that
58 > > don't have several dozen flags.
59 >
60 > While that's true for portage, it is false for gentoolkit with the
61 > `equery u <atom>` command.
62 >
63 > Following your original example it would be something like:
64 >
65 > % equery y app-misc/foo
66 > [ Legend : U - final flag setting for installation]
67 > [ : I - package is installed with flag ]
68 > [ Colors : set, unset ]
69 > * Found these USE flags for app-misc/foo-0::local
70 > U I
71 > - - modern_kernel : Install init scripts for 3.18 or higher kernels with atomic rule updates
72 > + + python_targets_python3_7 : Build with Python 3.7
73 > - - video_cards_radeon : VIDEO_CARDS setting to build driver for ATI radeon video cards
74 >
75 > And with a bunch more of USE flags (not with having to go to extremes like
76 > dev-libs/aws-sdk-cpp) it is very confusing a lot of time on machines where
77 > app-portage/eix would be overkill I had to check on another machine.
78
79 Ah, thank you for the example. I imagine equery is used quite
80 frequently for this sort of thing, so I'll concede the point.
81
82 It would be nice if there were some easy way to migrate package.use
83 settings; that's going to cause some grumbling from sysadmins.