Gentoo Archives: gentoo-dev

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: GLEP 64: Standardize contents of VDB and establish and API for exporting this information.
Date: Sun, 31 Aug 2014 12:35:22
Message-Id: 54031728.7040005@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: GLEP 64: Standardize contents of VDB and establish and API for exporting this information. by "Michał Górny"
1 On 08/31/14 03:26, Micha³ Górny wrote:
2 > Dnia 2014-08-30, o godz. 16:02:51
3 > "Anthony G. Basile" <blueness@g.o> napisa³(a):
4 >
5 >> I've written a GLEP which outlines a standard for what information
6 >> should be stored by any package management systems (PMS) in /var/db/pkg
7 >> (VDB) and mandates some API for exporting it to other tools [1].
8 > I have trouble understanding the goal. As far as I can see, the idea
9 > here is that every PM stores all information in any format, and exports
10 > a Python API that has any synopsis and gives access to it... in any
11 > format.
12 >
13 Not exactly. The point is to *standardize* what is meant by "all
14 information" so that all package managers export the same minimum set of
15 information. The most important being NEEDED.ELF.2 which is portage's
16 VDB but not paludis. Also, it can be in any format and exported in any
17 way so long as it is well documented. The goal is to have tools other
18 than PM's make use of this information. The example that began this is
19 revdep-pax which uses NEEDED.ELF.2 to trace out linking so as to migrate
20 PaX flags between ELF objects.
21
22 > Wouldn't it be better to at least agree on some API for the metadata
23 > exports? That will spare us the necessity of wrapping them all
24 > in a common package or in every tool itself. Maybe it could even bring
25 > some degree of interoperability between package managers.
26 Yes, I agree completely, but I didn't feel I was mandated to do so,
27 which is what leaves me unsatisfied with what I wrote and reflected in
28 your first paragraph. However, I didn't want to bind the hands of the
29 people writing the PM's either. I wanted to make their task as easy as
30 possible. So long as all PM's export the same *minimum* set, developers
31 writing non-PM tools which depend on VDB information can know what to
32 expect and how to get at it. Since NEEDED.ELF.2 is the critical for the
33 reasons stated in the GLEP, and its not cached by some PM's, it was the
34 subject of focus during the Council Meeting.
35
36 Having said that, I very much would like to say what that API looks
37 like. What you have below works for me.
38
39 >
40 > As for the spec itself:
41 >
42 > 1. You're missing some of the metadata variables (RESTRICT,
43 > PROPERTIES...). Wouldn't it be better to make one point worded like
44 > 'ebuild metadata as listed in PMS 13.2 Cache File Format'?
45
46 The point of the GLEP is to define a *minimum* set of exported metadata
47 information, so I thought about what that minimum set should be. I
48 should have cleaned stuff up more before handing the draft over to
49 creffett but I mistakingly assumed I could continue editing the wiki page.
50
51 Anyhow, now is the time for people to suggest what that minimum set
52 should be. I'll look at PMS 13.2 Cache File Format.
53
54 >
55 > 2. For *DEPEND, REQUIRED_USE (another one you missed) PMs store
56 > dependency trees with USE conditionals evaluated. You may want to
57 > explicitly note that.
58
59 Noted.
60
61 >
62 > 3. I would use a copy of ebuild environment variables at the time of
63 > completing the build (leaving last src_* phase?) -- IOW,
64 > environment.bz2.
65
66 Noted.
67
68 >
69 > 4. BUILD_TIME is not defined anywhere, so you may want to replace that
70 > with verbose explanation of what is to be stored. For the remaining
71 > metadata, you may want to reference PMS (the specification).
72
73 Noted.
74
75 > 5. Please do not recommend Python modules since it discriminates
76 > package managers written in C flavors.
77
78 What's wrong with C-python bindings? Or anything-anything bindings.
79 I'm not discriminating against flavors of PM's. A PM can export this
80 information via a C library, as long as the API is documented. Its up
81 to the developers of utilities consuming this information to "hook" in.
82
83 Having said that, I like what you have below and I'd be happy to work on
84 it. I can already see how to proceed with portage.
85
86 > Instead, I suggest a plain CLI
87 > API that gives best portability possibly. Alike:
88 >
89 > $ query-installed metadata sys-apps/coreutils-8.23 RDEPEND SLOT
90 > ...
91 > 0
92 >
93 > $ query-installed file sys-apps/coreutils-8.23 /usr/bin/timeout SONAME
94 > ...
95 >
96 > It should also have batch interface for querying multiple packages
97 > quickly -- passing requests via stdin:
98 >
99 > $ query-installed batch
100 > [>] metadata sys-apps/coreutils-8.23 RDEPEND SLOT
101 > [<] ...
102 > [<] 0
103 > [>] file sys-apps/coreutils-8.23 /usr/bin/timeout SONAME
104 > [<] ...
105 >
106 > 6. Your Portage snippet uses outdated API. The modern one is to use
107 > create_trees().
108
109 You mean the |vardb = portage.db[portage.root]['vartree'].dbapi stuff?
110 We can talk about this later.|
111
112
113
114 --
115 Anthony G. Basile, Ph.D.
116 Gentoo Linux Developer [Hardened]
117 E-Mail : blueness@g.o
118 GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA
119 GnuPG ID : F52D4BBA

Replies

Subject Author
Re: [gentoo-dev] RFC: GLEP 64: Standardize contents of VDB and establish and API for exporting this information. Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>