Gentoo Archives: gentoo-guis

From: Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>
To: "René 'Necoro' Neumann" <lists@××××××.eu>
Cc: gentoo-guis@l.g.o
Subject: Re: [gentoo-guis] Why I don't like catapult
Date: Tue, 01 Apr 2008 11:04:43
Message-Id: 20080401120430.7fd4e1a6@googlemail.com
In Reply to: Re: [gentoo-guis] Why I don't like catapult by "René 'Necoro' Neumann"
1 On Mon, 31 Mar 2008 00:37:31 +0200
2 René 'Necoro' Neumann <lists@××××××.eu> wrote:
3 > Hmmm - ok then virtuals really need to be thought about.
4
5 Or just forcibly ignored...
6
7 > >>> * use of regexes throughout. Every language defines its own,
8 > >>> different regex dialect. There's no portability between languages.
9 > >> True - I thought of using some kind of globbing - thus only
10 > >> allowing "*" and "?" (and perhaps "^" and "$")
11 > >
12 > > Why support it at all? That's not something that should be in at the
13 > > package manager level.
14 >
15 > That's true ... but catapult is a bit higher than package manager
16 > level. And at least the "find_" functions should allow them, to make
17 > searching and alike simpler.
18
19 Sounds like you need a layered architecture. A low level catapult to
20 package manager layer, and a high level package manager independent
21 extras layer.
22
23 > Hmm ... no. I see you are coming from the package-manager theory side.
24 > And there EAPI is important. But I can't see any point here where EAPI
25 > plays a role (besides package-IDs (which can be resolved using
26 > catapult API versions)), that can't be covered _inside_ the provider.
27
28 As soon as you query any kind of information or perform any kind of
29 information on an ID your code must be EAPI aware.
30
31 > I don't doubt that e.g. the catapult-paludis provider has to deal with
32 > EAPI in some way. But the _user_ (or better: application dev) using
33 > catapult API does not need to be aware of it. Catapult is of higher
34 > level than package management itself.
35
36 But application developers do have to be aware of EAPI! Otherwise they
37 aren't allowed to query anything about the IDs they receive.
38
39 > Ok. Perhaps we can postpone this until it gets real. (And then perhaps
40 > use scpvr's ;) ... like: cpan:bla-foo/SomePerlPkg-0.13)
41
42 Paludis does it already.
43
44 > > Paludis supports multiple configurations. You can, for example,
45 > > have /etc/paludis, /etc/paludis-mychroot and
46 > > ~/.paludis-anotherchroot, and Paludis can operate with all of thse.
47 > > Paludis can also operate on systems where there's no configuration
48 > > -- for example, you shouldn't need a full config setup just to be
49 > > able to run QA checks on one particular repository.
50 > >
51 > > Portage also sort of has some of this in a very crude way, through
52 > > PORTAGE_CONFIGROOT.
53 >
54 > As catapult only queries, this can be resolved _inside_ the paludis
55 > provider.
56 > This of course gets hairy if it comes to libcatapult to provide
57 > config-file manipulation...
58
59 How does Paludis know which configuration set it should be using to
60 respond to queries?
61
62 > A "set" is a "set of packages" for me. You mention a "set of specs" -
63 > don't get what kind of "specs" you are referring to here.
64
65 A set isn't a set of packages. It's a set of dependency specifications
66 (foo/bar or >=foo/bar-2 or whatever).
67
68 > >>> - find_packages. As find_best_match for search key. What
69 > >>> disambiguation is performed upon the atom? What happens if you
70 > >>> pass it something like 'git', which is ambiguous?
71 > >> Return everything that fits. It should be on the users side to
72 > >> translate it into something useful.
73 > >
74 > > That's messy.
75 >
76 > Why? - It's a search function. And I guess in most cases the "return
77 > everything that matches" is in case intended.
78
79 Have a look at what existing tools do when given an ambiguous package
80 name part. They generally error, not do everything. Coding various
81 things gets tricky when you have to manually check that you've only
82 been given a single package name.
83
84 > >>> - get_config_path. Unportable. What if the user is using some
85 > >>> other config format?
86 > >> But the configs (read: package.mask, package.use etc.) have to be
87 > >> at a specified unique location, don't they?
88 > >
89 > > For Paludis? No. NoConfigEnvironment, for example, uses no
90 > > configuration directory at all.
91 > >
92 >
93 > This really is an issue... And what is happening if the user wants to
94 > set an option (e.g. a useflag) in the "NoConfigEnvironment"? - Is a
95 > config directory created and the environment switched?
96
97 No. Users can't set options in NoConfigEnvironment. There is literally
98 no configuration beyond the constructing parameters.
99
100 > Nevertheless, I want to provide applications with the ability to run
101 > a package manager with different option switches which follow some
102 > global semantics. Or do you think, something like this is just not
103 > possible and we have to look for another way of doing so?
104
105 Doing this via an exec() is the wrong way to do it. If you want it to
106 be sanely usable you need to do it via a proper API.
107
108 > Think of the following use case: An application provides an interface
109 > that allows users to select a package for installation. Now this
110 > application uses catapult and wants to query for the command which has
111 > to be run to get this package installed. Using get_merge_command, the
112 > app could do:
113 >
114 > spawn(catapult.system.get_merge_command(), package_list)
115 >
116 > Catapult isn't the system merging here - it just provides the
117 > information to actually _do_ the merge.
118
119 Which is the wrong way of doing it. You might as well ask for a command
120 that outputs DESCRIPTION for a given ID rather than providing an API
121 call to do it directly.
122
123 > >>> - split_cpv. Why the weird revision thing?
124 > >> What's so weired about it?
125 > >
126 > > Why is the revision considered special?
127 >
128 > I'm waiting what's the result of the "-r0"-thread on gentoo-dev before
129 > giving an anwer ;)
130
131 Doesn't make much difference either way... Why is the revision the only
132 version part you treat specially?
133
134 > We have the following cases:
135 > 1.) "DEPEND" is a fixed catapult term/constant. Then the provider has
136 > to map to "DEPENDENCIES" if it encounters the term and EAPI2 is used.
137
138 Not doable. DEPENDENCIES can't map to DEPEND. DEPEND isn't powerful
139 enough syntactically.
140
141 > 2.) "DEPEND" is directly passed to the package manager (for example
142 > using "get_package_settings"). I think this isn't preferred behavior
143 > and only a given set of constants for the "settings" and alike should
144 > be used. -> see 1.)
145
146 Then you'd get a spurious blank result.
147
148 > >>> And what's the return value? What about when || is in operation?
149 > >> WWPMD (what would the package manager do): Simplified: Pass the
150 > >> dep-string to the package manager and see what he does with it. The
151 > >> result is returned.
152 > >
153 > > The package manager has to have special handling for || throughout.
154 > > The behaviour of || blocks is rather tricky.
155 >
156 > I guess it is a major problem if the package manager isn't able to
157 > handle "||", right? - So I can't see your point here.
158
159 The package manager handles || on a case by case basis. Anything
160 containing || cannot be flattened to a simple list.
161
162 > >>> - get_iuse_flags. What does this do for IUSE defaults? For
163 > >>> installed packages, all flags are forced.
164 > >> defaults are returned verbatim. I used to define "forced flags" as:
165 > >> "The flags the user can't change." (like userland_GNU or
166 > >> use.mask'ed flags)
167 > >
168 > > The user can't change any flags for installed packages.
169 >
170 > True. But he can re-install it using the changed flags. (Though he
171 > isn't using the flags of the installed packages here, but the ones of
172 > the uninstalled and overwriting the installed one.)
173 > In other words: For this use case, the useflags of installed packages
174 > are not seen as "forced flags" per se.
175
176 They are forced for the installed ID. They aren't necessarily forced
177 for other different IDs that can be installed to replace the currently
178 installed ID.
179
180 The foo/bar-2.0 that you have installed is a completely different ID to
181 any foo/bar-2.0 you happen to have in a repository somewhere.
182
183 >
184 > >>> - get_masking_reason. Is the return value supposed to be used by
185 > >>> anything other than a human?
186 > >> I doubt it.
187 > >
188 > > Specify that.
189 >
190 > I guess I'm again missing something ;). But I can't see, why it
191 > matters if it is intended for human readers or not :). And if there
192 > _is_ a difference, there should be no problem in adding a
193 > "for_humans" boolean argument to this call. :)
194 > Though I don't know, what the masking reason should look like for
195 > non-human targets.
196
197 If it's intended to be machine usable, the format has to be fixed.
198
199 >
200 > >>> - get_overlay_path. What if it's in an overlay with no on-disk
201 > >>> location? What if it's in some format the end tool doesn't
202 > >>> recognise?
203 > >> The end tool's problem I'd say.
204 > >
205 > > You're providing API calls that make this sort of thing difficult.
206 > > Not an ideal situation...
207 >
208 > Just return some kind of an URL. The end tool has to deal with it.
209
210 Then the name needs changing, and it needs to be documented that the
211 return value is entirely meaningless.
212
213 > >>> How does the whole privs thing work? Should anyone who can talk by
214 > >>> DBus be allowed to perform privileged operations? Should anyone
215 > >>> who can't perform privileged operations be allowed to do
216 > >>> unprivileged operations?
217 > >> I thought of having Catapult being a passive thing. So there is no
218 > >> way of doing privileged actions.
219 > >
220 > > Things like querying an uncached package are privileged.
221 >
222 > Yes? - Why? Any user can open an ebuild and have a look at the
223 > internals.
224
225 But they can't write to cache on disk. Remember that Portage needs you
226 to be in the 'portage' group to do anything, and anyone in the
227 'portage' group can easily obtain root on the box.
228
229 > >>> What about persistence? What's classed as a session? Why force it
230 > >>> down to a single session at once?
231 > >> Easier to implement. But it isn't forced. If the provider
232 > >> implements sessions (e.g. using the Dbus-sending-adress as a key)
233 > >> w/o extending API, I can't see a problem.
234 > >
235 > > But without well-defined session management, you're stuck when it
236 > > comes to multiple configurations and the like.
237 >
238 > What exactly do you want to store in / link to the session?
239
240 Which configuration set is active, for one...
241
242 --
243 Ciaran McCreesh

Attachments

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

Replies

Subject Author
Re: [gentoo-guis] Why I don't like catapult "René 'Necoro' Neumann" <lists@××××××.eu>