Gentoo Archives: gentoo-dev

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

Replies

Subject Author
Re: [gentoo-dev] [pre-GLEP] Repository configuration file (layout.conf) "Wolfgang E. Sanyer" <wolfgangesanyer@×××××.com>