Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [EAPI 7] The future goals for PORTDIR, ECLASSDIR and... LICENSEDIR?
Date: Sat, 21 Nov 2015 21:37:17
Message-Id: 20151121223657.494e63b0.mgorny@gentoo.org
1 Hello, everyone.
2
3 Currently PMS defines two variables that are being repeatedly abused to
4 access repository data in unpredictable and breaking manners -- PORTDIR
5 and ECLASSDIR. They both reference only so-called 'master
6 repository', are permitted in source builds and src_* phases only.
7
8 For quite some time, QA is monitoring their use and repeatedly
9 reporting abuses and spec violations. I'd like to run a joint QA & PMS
10 team effort in cleaning up those variables for sane multi-repository
11 support or banning them altogether. For this reason, I would like to
12 know your opinion.
13
14
15 Licenses [1]
16 ------------
17
18 So far, the most common use of ${PORTDIR} was to access the licenses
19 subdirectory. That has a number of issues -- most importantly, it fails
20 when the license is provided by another repository. It is also unusable
21 in binary packages.
22
23 So far I see two major possibilities here. We can either decide that:
24
25 a. ebuilds don't need to access licenses directly and if they do,
26 the licenses are usually included in distfiles or can be obtained
27 independently of ebuild tree, or
28
29 b. we provide a proper, safe mechanism for obtaining licenses that
30 works with multiple repositories and binary packages. In particular,
31 I was thinking of establishing a LICENSEDIR that would contain copies
32 or symlinks to all needed licenses, both in source and binary installs.
33
34 Few relevant current bugs:
35
36 - sci-visualization/veusz: replaces bundled license with PORTDIR
37 symlink, which will fail if repository is moved or when using binary
38 packages [2],
39
40 - sci-biology/foldingathome: tries to reference the license
41 in pkg_setup(), while PORTDIR is valid only in src_* [3],
42
43 - sys-block/tw_cli: copies license into install. The license is not
44 included in tarball, yet we have different opinions whether copying
45 it is necessary or not [4].
46
47
48 Eclasses [5]
49 ------------
50
51 The next thing is ECLASSDIR, sometimes disguised as equivalent
52 ${PORTDIR}/eclass. It is used only by a single developer, for two
53 reasons. One is to create eclass-manpages whose ebuild is a huge hack
54 relying on random deprecated Portage variables anyway, so not worth
55 noting. The other is to access a huge collection of patches (over 100
56 files) which are stored in eclass/ELT-patches and not ever used on most
57 of Gentoo systems.
58
59 We've considered different options on how to make ECLASSDIR sane and so
60 far seems there's no real way of doing it while keeping the ELT-patches
61 thing working (the way suggested for licenses won't work, for example).
62 So for less sane solutions, again we have two:
63
64 A. ban ECLASSDIR completely, and move ELT-patches to a dedicated
65 package [6]. This way, it could be cleanly managed, versioned
66 and filtered to install only files relevant to user's system (i.e. not
67 for all potential prefixes we support), and libtool.eclass can simply
68 DEPEND on it. Furthermore, a lot of the code could be moved to
69 a reusable external patcher tool.
70
71 B. Restrict ECLASSDIR to be available only in global scope of
72 eclasses (i.e. while sourcing them), and set it to the repository from
73 which eclass is sourced. This is ugly, barely predictable but should
74 work. Well, as long as you copy the whole ELT-patches structure along
75 with libtool.eclass.
76
77
78 PORTDIR [7]
79 -----------
80
81 Almost all uses of PORTDIR are covered by the two above categories.
82 The only remaining use is games-mods.eclass using it to read header.txt
83 file from the repository [8]. Which in fact could be trivially replaced
84 if games team members had a little different attitude towards QA but
85 I guess that's not my problem.
86
87 Therefore, I think that if both of the above issues are solved either
88 way, PORTDIR should be banned completely. Until then, we'd like it to
89 be QA-deprecated and discouraged from being used unless absolutely
90 necessary.
91
92
93 What are your thoughts?
94
95
96 [1]:https://bugs.gentoo.org/show_bug.cgi?id=566412
97 [2]:https://bugs.gentoo.org/show_bug.cgi?id=341653
98 [3]:https://bugs.gentoo.org/show_bug.cgi?id=566402
99 [4]:https://bugs.gentoo.org/show_bug.cgi?id=566416
100 [5]:https://bugs.gentoo.org/show_bug.cgi?id=373351
101 [6]:https://bugs.gentoo.org/show_bug.cgi?id=566424
102 [7]:https://bugs.gentoo.org/show_bug.cgi?id=373349
103 [8]:https://bugs.gentoo.org/show_bug.cgi?id=416739
104
105 --
106 Best regards,
107 Michał Górny
108 <http://dev.gentoo.org/~mgorny/>

Replies