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