Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Tim Harder <radhermit@g.o>
Subject: Re: [gentoo-portage-dev] [RFC] Adding extra vars to md5-cache, for QA&tooling purposes
Date: Thu, 25 Jul 2019 20:29:13
Message-Id: 131e2cf734ab7c7a4bf5f950faa7267d79fde460.camel@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [RFC] Adding extra vars to md5-cache, for QA&tooling purposes by Zac Medico
1 On Thu, 2019-07-25 at 12:57 -0700, Zac Medico wrote:
2 > On 7/25/19 5:20 AM, Michał Górny wrote:
3 > > Hi,
4 > >
5 > > TL;DR: I'd like to make it possible for ebuilds to define additional
6 > > variables that will be stored in md5-cache. This would be useful for CI
7 > > and other tooling that right now has to parse ebuilds for other data.
8 > >
9 > >
10 > > The idea is to add a new incremental ebuild/eclass variable (technical
11 > > name: QA_EXTRA_CACHE_VARS) that would define additional data to be
12 > > stored in cache. For example, python*-r1 eclasses would define
13 > > 'PYTHON_COMPAT', acct-user would define 'ACCT_USER_ID', etc.
14 > >
15 > > When regenerating cache, the PM would read this variable, and store
16 > > the values of all defined variables into md5-cache. As a result,
17 > > programs needing those variables can get them straight from cache
18 > > without having to attempt to run or parse ebuilds (which is both slow
19 > > and prone to bugs).
20 > >
21 > > This would benefit e.g. gpyutils that right now need to attempt to parse
22 > > PYTHON_COMPAT from ebuilds. It would also benefit writing future
23 > > pkgcheck checks for user/group ID collisions.
24 > >
25 > >
26 > > Notes:
27 > >
28 > > - since md5-cache uses key-value format and allows for future
29 > > extensions, the new values can be added without breaking anything;
30 > >
31 > > - md5-cache is not specified in the PMS, and the whole thing can be
32 > > implemented without need for EAPI bump,
33 > >
34 > > - I would like to have this implemented consistently both in Portage
35 > > and pkgcore,
36 > >
37 > > - we will need to clearly define how to dump arrays.
38 > >
39 > >
40 > > What do you think?
41 >
42 > Sounds good. Some thoughts:
43 >
44 > * Maybe omit QA from the variable name, since it can be could be
45 > generally useful for things that are unrelated to QA.
46 >
47 > * In the md5-cache entry, maybe use a common prefix like EXT_ for the
48 > extra keys in order to distinguish them from normal keys.
49
50 Yeah, I was thinking of something like '__ext_foo', or '__ext[foo]'.
51
52 --
53 Best regards,
54 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies