Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Kent Fredric <kentfredric@×××××.com>
Cc: gentoo-dev <gentoo-dev@l.g.o>, qa@g.o
Subject: Re: [gentoo-dev] [RFC] How to deal with LINGUAS mess?
Date: Sun, 29 May 2016 13:05:15
Message-Id: 20160529143008.18bdbdce.mgorny@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] How to deal with LINGUAS mess? by Kent Fredric
1 On Sat, 21 May 2016 20:14:46 +1200
2 Kent Fredric <kentfredric@×××××.com> wrote:
3
4 > On 21 May 2016 at 19:41, Michał Górny <mgorny@g.o> wrote:
5 > > Hello,
6 > >
7 > >
8 > > Those of you who read my blog post on LINGUAS [1] may already know
9 > > what's going on. For those who didn't, short summary:
10 > >
11 > > In EAPI 5 and newer, all variables listed in USE_EXPAND are supposed to
12 > > be unconditionally exported with their values reduced to enabled USE
13 > > flags listed in IUSE. In particular, this means that if ebuild does not
14 > > list any linguas_* flags in IUSE, PM exports *empty* LINGUAS (i.e.
15 > > disables all localizations with the implicit gettext behavior).
16 > >
17 > > Portage had so far some ugly hack-logic that tried to keep LINGUAS
18 > > working somehow in place. However, the patches to enable PMS-compliant
19 > > behavior are on their way, so it's about time to decide what to do
20 > > about LINGUAS.
21 > >
22 > >
23 > > I see the following possibilities:
24 > >
25 > > 1. We start explicitly listing linguas_* in all ebuilds, no matter how
26 > > tiny they are. Maintainers are required to keep IUSE up-to-date
27 > > and users are forced to rebuild a lot. This is also a QA violation
28 > > in terms of invalid use of USE flags.
29 > >
30 > > 2. We hack-unset LINGUAS in ebuilds. This is a lot of effort, easy to
31 > > miss and probably would need to repeated for every single phase anyway
32 > > due to how global variables are handled in PMS. Additionally, it may
33 > > break at some point since those variables are likely expected to be
34 > > read-only anyway.
35 > >
36 > > 3. We remove LINGUAS from USE_EXPAND and stop using it. If ebuilds have
37 > > a good reason to use flags for localization, we introduce a new,
38 > > non-colliding USE_EXPAND for that. We also ask users to replace LINGUAS
39 > > with the new flag in their make.conf files. LINGUAS gets the original
40 > > upstream behavior back, and we eventually discourage it in favor of new
41 > > INSTALL_MASK features (WiP) [2].
42 > >
43 > > 4. We fix build systems not to do magic depending on whether LINGUAS
44 > > is unset or set-to-empty. Instead, we could some special special value
45 > > like '-' to signify not installing localizations at all. But that's
46 > > upstream thing to do, and breaks backwards compatibility with existing
47 > > systems disabling localizations.
48 > >
49 > >
50 > > Your thoughts?
51 >
52 > I think its a regretful situation we find ourselves in where
53 > portage/PMS control values that have to go via ENV, leak beyond ENV
54 > into packaging.
55 >
56 > This has already been a bit of a worry for us, because we may have
57 > wanted to use PERL_ as a prefix for env vars in an eclass, but there's
58 > a possibility of accidentally picking the same ENV var that is
59 > inherently used in some perl part.
60 > ( And at very least, `perl -V` shows all ENV vars that are prefixed
61 > with PERL_ .... eg: PERL_MOM_YOURS=1 perl -V )
62 >
63 > Though I just don't see how we can generically avoid that scope
64 > leakage, because this is bash, and we're short on private ways to pass
65 > control values around, other than going crazy on functions.
66
67 Yes, that's one side of the problem. The other is that this was done
68 like this intentionally (i.e. to have USE flags implicitly converted
69 into LINGUAS). Just someone didn't have enough foresight where this
70 would lead.
71
72 > The only thing I thought of when reading the writeup was tagged
73 > install mask verbs.
74 >
75 > That is:
76 >
77 > - Always install all language support possible by default.
78
79 This still leaves the problem: how to enforce this? As long as LINGUAS
80 leaks into ebuild env (either from USE_EXPAND magic, from make.conf or
81 from parent env), we're in trouble.
82
83 > - Have an ebuild mapping of some description that annotates "files X
84 > add support for languages ( y, z, x )"
85 >
86 > And then maybe you'd have a parameterized INSTALL_MASK system where you could do
87 >
88 > INSTALL_MASK_RULES="linguas(-* en)"
89 >
90 > Then it would be "Packager decides" if they want to trip a rebuild at
91 > the end user when they "discovered" certain files pertain to specific
92 > language support.
93 >
94 > Then the only reason you'd need USE flags is if you wanted to toggle
95 > compile time support that pulled in dependencies to support the
96 > language in question.
97
98 Yes, exactly. Though my plan was for it to be more like:
99
100 INSTALL_MASK="-@linguas @linguas_pl"
101
102 or alike. Though it's all implementation detail.
103
104 --
105 Best regards,
106 Michał Górny
107 <http://dev.gentoo.org/~mgorny/>