1 |
See some comments in-line below. |
2 |
|
3 |
|
4 |
On Wed, May 19, 2021 at 8:33 AM Michał Górny <mgorny@g.o> wrote: |
5 |
> |
6 |
> Hi, |
7 |
> |
8 |
> Please review the pre-GLEP inlined below. Its purpose is to formally |
9 |
> define the format of layout.conf. It's pretty much inevitable these |
10 |
> days, so we should specify it. However, it doesn't really fit into PMS, |
11 |
> and other formats (Manifests, metadata.xml) are already defined |
12 |
> in GLEPs, so this just follows suit. |
13 |
> |
14 |
> Pre-GLEP follows. |
15 |
> |
16 |
> --- |
17 |
> GLEP: 9999 |
18 |
> Title: Repository configuration file (layout.conf) |
19 |
> Author: Michał Górny <mgorny@g.o> |
20 |
> Type: Standards Track |
21 |
> Status: Draft |
22 |
> Version: 1.0 |
23 |
> Created: 2021-05-19 |
24 |
> Last-Modified: 2021-05-19 |
25 |
> Post-History: 2021-05-19 |
26 |
> Content-Type: text/x-rst |
27 |
> --- |
28 |
> |
29 |
> Abstract |
30 |
> ======== |
31 |
> |
32 |
> The ``metadata/layout.conf`` file format is specified as used by Portage |
33 |
> and PkgCore. A standard set of configuration keys is described |
34 |
> including the keys currently used in the Gentoo repository. |
35 |
> |
36 |
> |
37 |
> Motivation |
38 |
> ========== |
39 |
> |
40 |
> The ``metadata/layout.conf`` file was first added to the Gentoo |
41 |
> repository in Oct 2011, to facilitate setting of hashes used |
42 |
> in Manifest2 files. In Mar 2012, it was used to indicate the transition |
43 |
> to the new ``md5-dict`` cache format. In Jul 2013, it started being |
44 |
> used to indicate the repository's masters and effectively became |
45 |
> obligatory for all repositories. |
46 |
> |
47 |
> Today, ``layout.conf`` is used for various repository configuration |
48 |
> knobs that can be expressed as simple values and therefore |
49 |
> do not justify adding new files to the repository. This primarily |
50 |
> involves the configuration of development tools but also includes a few |
51 |
> keys relevant to the behavior of the package manager. |
52 |
> |
53 |
> However, ``layout.conf`` is currently not covered by any formal |
54 |
> specification. The PMS neglects its existence entirely, and the keys |
55 |
> used are roughly defined by their first use of Portage or PkgCore. |
56 |
> This GLEP aims to overcome this by providing a formal specification |
57 |
> for the file, as well as an up-to-date list of permitted configuration |
58 |
> keys. |
59 |
> |
60 |
> |
61 |
> Specification |
62 |
> ============= |
63 |
> |
64 |
> layout.conf file format |
65 |
> ----------------------- |
66 |
> |
67 |
> Every ebuild repository must contain a ``metadata/layout.conf`` file. |
68 |
> The file uses a line-oriented text format. Lines starting with ``#`` |
69 |
> represent comments and are ignored, as are lines consisting entirely |
70 |
> of whitespace. The remaining lines must contain a key followed |
71 |
> by equals sign (``=``), followed by a (possibly empty) value. Each of |
72 |
> these elements can be surrounded by additional whitespace that |
73 |
> is stripped. |
74 |
|
75 |
Is a space around the "=" optional? I see it used below, but here it sounds |
76 |
like there should be no space. |
77 |
|
78 |
> Configuration keys |
79 |
> ------------------ |
80 |
> |
81 |
> The ``layout.conf`` file must contain the ``masters`` key. Other keys |
82 |
> listed in this specification are entirely optional. The package |
83 |
> managers may choose to implement a subset of listed keys. Unknown keys |
84 |
> must be ignored. |
85 |
> |
86 |
> The following keys are currently defined: |
87 |
|
88 |
Is the intent for the GLEP to define and specify every possible key-value |
89 |
combination? If not, then perhaps this section should be truncated a bit? i.e. |
90 |
"here are some examples of currently defined keys" and then list a handful. |
91 |
|
92 |
Additionally, maybe the spec should include some sort of requirement for |
93 |
documentation of variables, similar to what you've done below. |
94 |
|
95 |
Edit: ok, nevermind I see your recommendation at the bottom. But still, |
96 |
I would probably either (1) insist that new keys be added to this GLEP, or |
97 |
(2) insist that new keys are documented properly. |
98 |
|
99 |
> masters = <space-separated values> |
100 |
> Specifies the master repositories of this repository. For stand-alone |
101 |
> repositories, this must be set to an empty value. Otherwise, it can |
102 |
> list one or more repositories, separated by spaces. This key must |
103 |
> be specified. |
104 |
|
105 |
I realize this is the only compulsory key, but perhaps it should still go in |
106 |
a separate section in order to ensure that it stands out? i.e. "The following |
107 |
keys are mandory..." and then later "the following optional keys are |
108 |
currently defined" |
109 |
|
110 |
> manifest-hashes = <space-separated values> |
111 |
> Specifies the list of hashes that should be used for new distfiles |
112 |
> in the Manifest files. The development tools may create a subset |
113 |
> of the specified hashes if it is not updating the checksums for |
114 |
> the specified distfile, or does not support the hash in question. |
115 |
> The hash names are specified in GLEP 74. [#GLEP74]_ The default |
116 |
> set of hashes is implementation-defined. |
117 |
> |
118 |
> manifest-required-hashes = <space-separated values> |
119 |
> Specifies the list of hashes that must be used in Manifest files. |
120 |
> The development tools must support all the hashes listed there, |
121 |
> and update distfile checksums to use these hashes (refetching |
122 |
> if necessary). This must be a subset of manifest-hashes. If not |
123 |
> specified, all hashes from manifest-hashes (or the default set) |
124 |
> are considered required. |
125 |
> |
126 |
> use-manifests = ``strict``, ``true`` or ``false`` |
127 |
> Indicates the policy for creating and using Manifest files. If set |
128 |
> to ``strict``, Manifest files are created and files are required to |
129 |
> match digests found in Manifests. If set to ``true``, Manifests |
130 |
> are created but digest mismatches are ignored. If set to ``false``, |
131 |
> Manifests are not used at all. The default is ``strict``. |
132 |
> |
133 |
> update-changelog = ``true`` or ``false`` |
134 |
> Indicates whether the development tools should write ChangeLog files. |
135 |
> The default is ``false``. |
136 |
> |
137 |
> cache-formats = <space-separated values> |
138 |
> Specifies one or more cache formats used by the repository. |
139 |
> The currently defined values are ``pms`` for the original format |
140 |
> specified in the PMS and ``md5-dict`` for the md5-dict format |
141 |
> introduced in Portage 2.2.0_alpha68. The default is |
142 |
> implementation-defined. |
143 |
> |
144 |
> eapis-deprecated = <space-separated values> |
145 |
> Specifies one or more EAPIs that are to be considered deprecated |
146 |
> by the development tools for use in ebuilds, i.e. their use should |
147 |
> trigger a warning. If not specified, no EAPIs are deprecated. |
148 |
> |
149 |
> eapis-banned = <space-separated values> |
150 |
> Specifies one or more EAPIs that are to be considered banned |
151 |
> by the development tools for use in ebuilds, i.e. their use should |
152 |
> be blocked. If not specified, no EAPIs are banned. |
153 |
> |
154 |
> repo-name = <string> |
155 |
> Specifies the repository name. If specified, it must be equal |
156 |
> to the contents of ``profiles/repo_name``. If not specified, |
157 |
> it defaults to the same value. Discouraged. |
158 |
> |
159 |
> aliases = <space-separated values> |
160 |
> Specified one or more additional names that can be used to reference |
161 |
> the repository (e.g. in repository dependencies). If not specified, |
162 |
> no aliases are defined. |
163 |
> |
164 |
> thin-manifests = ``true`` or ``false`` |
165 |
> If enabled, Manifest files in the package directory must contain only |
166 |
> ``DIST`` entries. If disabled, Manifest files in the package |
167 |
> directory must list digests for all files found in the package |
168 |
> directory and the files directory. The default is ``false``. |
169 |
> |
170 |
> sign-commits = ``true`` or ``false`` |
171 |
> Indicates whether git commits are to be signed (using ``git commit |
172 |
> --gpg-sign``. The default is ``false``. |
173 |
> |
174 |
> sign-manifests = ``true`` or ``false`` |
175 |
> Indicates whether individual package Manifests should be PGP-signed. |
176 |
> Note that this refers to the historical behavior of signing individual |
177 |
> Manifests, not the GLEP 74 behavior of signing the top-level Manifest. |
178 |
> [#GLEP74]_ The default is ``true`` if PGP signing is configured. |
179 |
> |
180 |
> properties-allowed = <space-separated values> |
181 |
> Specifies the list of ``PROPERTIES`` tokens that are permitted |
182 |
> to be used in ebuilds. If present, the development tools should issue |
183 |
> a warning if ``PROPERTIES`` contains any tokens that are not listed |
184 |
> here. If not specified, all tokens are permitted. |
185 |
> |
186 |
> restrict-allowed = <space-separated values> |
187 |
> Same as properties-allowed, except for ``RESTRICT``. |
188 |
> |
189 |
> profile-formats = <space-separated values> |
190 |
> Specifies the format used by profiles and/or extensions to it. |
191 |
> The default is ``pms`` indicating the format specified in the PMS. |
192 |
> Other values are implementation-defined. |
193 |
> |
194 |
> |
195 |
> It is recommended that any future keys are added to this GLEP before |
196 |
> being implemented. |
197 |
> |
198 |
> |
199 |
> Example |
200 |
> ------- |
201 |
> |
202 |
> The following is an example configuration for a git repository with |
203 |
> Gentoo set as a master:: |
204 |
> |
205 |
> masters = gentoo |
206 |
> |
207 |
> # git: do not use ChangeLog, use thin, unsigned Manifests |
208 |
> update-changelog = false |
209 |
> thin-manifests = true |
210 |
> sign-manifests = false |
211 |
> |
212 |
> # force the new md5-dict cache format |
213 |
> cache-formats = md5-dict |
214 |
> |
215 |
> |
216 |
> Rationale |
217 |
> ========= |
218 |
> |
219 |
> This GLEP is written almost 10 years after ``layout.conf`` was |
220 |
> originally introduced. This made it necessary to write it in such a way |
221 |
> that both the modern and historical implementations in Portage |
222 |
> and PkgCore, as well as the use in the Gentoo repository |
223 |
> and a reasonably large subset of the other repositories would remain |
224 |
> compliant. |
225 |
> |
226 |
> The historical default of assuming ``masters = gentoo`` when unspecified |
227 |
> is omitted as it is not portable and verbosely deprecated for many |
228 |
> years in Portage. All repositories are required to explicitly specify |
229 |
> their masters, or an empty value if they are stand-alone. |
230 |
> |
231 |
> The default for Manifest hashes and cache formats are left to be |
232 |
> implementation-defined, as the defaults changed over time and do not |
233 |
> match between package managers. In particular, Portage attempts to |
234 |
> autodetect the cache format currently used in a given repository. |
235 |
> |
236 |
> The repo-name key has been originally added as an alternative to |
237 |
> ``profiles/repo_name``. However, the latter file is still required |
238 |
> for PMS compliance. Furthermore, given that it is much easier to parse, |
239 |
> there seems to be no appealing reason to work towards replacing that |
240 |
> file. This means that for all practical reasons, the repo-name key |
241 |
> is redundant and is listed here for completeness only. |
242 |
> |
243 |
> The profile-formats key has been introduced to permit Portage-specific |
244 |
> extensions to the profile directory without having to introduce custom |
245 |
> EAPIs. The exact extensions are considered outside the scope of this |
246 |
> specification. |
247 |
> |
248 |
> |
249 |
> Backwards Compatibility |
250 |
> ======================= |
251 |
> |
252 |
> The existing implementations found in Portage and PkgCore conform |
253 |
> to this specification, so does the ``metadata/layout.conf`` file |
254 |
> found in the Gentoo repository. |
255 |
> |
256 |
> |
257 |
> Reference Implementation |
258 |
> ======================== |
259 |
> |
260 |
> The support for ``metadata/layout.conf`` is already a part of Portage |
261 |
> and PkgCore. |
262 |
> |
263 |
> |
264 |
> References |
265 |
> ========== |
266 |
> |
267 |
> .. [#GLEP74] GLEP 74: Full-tree verification using Manifest files |
268 |
> (https://www.gentoo.org/glep/glep-0074.html) |
269 |
> |
270 |
> |
271 |
> Copyright |
272 |
> ========= |
273 |
> |
274 |
> This work is licensed under the Creative Commons Attribution-ShareAlike |
275 |
> 4.0 |
276 |
> International License. To view a copy of this license, visit |
277 |
> https://creativecommons.org/licenses/by-sa/4.0/. |
278 |
> |
279 |
> |
280 |
> -- |
281 |
> Best regards, |
282 |
> Michał Górny |
283 |
> |
284 |
> |
285 |
> |