Gentoo Archives: gentoo-guis

From: "René 'Necoro' Neumann" <lists@××××××.eu>
To: ciaran.mccreesh@××××××××××.com
Cc: gentoo-guis@l.g.o
Subject: Re: [gentoo-guis] Why I don't like catapult
Date: Sun, 30 Mar 2008 22:37:44
Message-Id: 47F0162B.2040800@necoro.eu
In Reply to: Re: [gentoo-guis] Why I don't like catapult by Ciaran McCreesh
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Ciaran McCreesh schrieb:
5 > On Sun, 30 Mar 2008 19:30:24 +0200
6 > René 'Necoro' Neumann <lists@××××××.eu> wrote:
7 >> Ciaran McCreesh schrieb:
8 >>> * use of cpv throughout. cpv isn't enough to uniquely identify an
9 >>> ID, especially if there're overlays. cpvr is closer, but still
10 >>> doesn't work if you need to deal with virtuals directly (rather
11 >>> than the thing provided by the virtual)
12 >> CPVR sounds reasonable ... and what about using virtual/* for
13 >> virtuals? Btw: There was the idea of providing a "get_virtuals"
14 >> function....
15 >
16 > The issue with virtuals is that all the package managers do them a bit
17 > differently. For Paludis, if you have two different providers of the
18 > same virtual installed with the same version and slot, you'll get two
19 > IDs that have the same cpvr and that are only distinguished by the
20 > package for which they are a virtual. This isn't an issue for us since
21 > we use a different PackageID instance for each, but if instead you're
22 > using a string to identify things (eww) you're in trouble.
23
24 Hmmm - ok then virtuals really need to be thought about.
25
26 >>> * use of regexes throughout. Every language defines its own,
27 >>> different regex dialect. There's no portability between languages.
28 >> True - I thought of using some kind of globbing - thus only allowing
29 >> "*" and "?" (and perhaps "^" and "$")
30 >
31 > Why support it at all? That's not something that should be in at the
32 > package manager level.
33
34 That's true ... but catapult is a bit higher than package manager level.
35 And at least the "find_" functions should allow them, to make searching
36 and alike simpler.
37
38 >>> * No mention of EAPI anywhere.
39 >> Why would this be needed? This is only true if "catapult API" ==
40 >> "EAPI".
41 >
42 > Well no. When doing pretty much anything with IDs, you have to be aware
43 > of the EAPI. Client programs mustn't attempt to do anything with IDs
44 > whose EAPI they don't recognise.
45
46 Hmm ... no. I see you are coming from the package-manager theory side.
47 And there EAPI is important. But I can't see any point here where EAPI
48 plays a role (besides package-IDs (which can be resolved using catapult
49 API versions)), that can't be covered _inside_ the provider.
50 I don't doubt that e.g. the catapult-paludis provider has to deal with
51 EAPI in some way. But the _user_ (or better: application dev) using
52 catapult API does not need to be aware of it. Catapult is of higher
53 level than package management itself.
54
55 >>> * Generally lots of hard-coded ebuildy things that don't map well
56 >>> onto future EAPIs or handling of non-ebuilds (e.g. native CRAN
57 >>> support).
58 >> For me - gentoo package management is all about ebuilds. So I can't
59 >> see, what should changed there.
60 >
61 > Future-direction-wise, a lot of people are wanting to handle things
62 > like CPAN, CRAN, Gems etc natively in the package manager rather than
63 > by writing wrapper ebuilds.
64
65 Ok. Perhaps we can postpone this until it gets real. (And then perhaps
66 use scpvr's ;) ... like: cpan:bla-foo/SomePerlPkg-0.13)
67
68 >>> * It's tied onto a single user configuration setup, and has no sane
69 >>> way of handling multiple configurations or unconfigured operation.
70 >> I don't understand this ...
71 >
72 > Paludis supports multiple configurations. You can, for example,
73 > have /etc/paludis, /etc/paludis-mychroot and ~/.paludis-anotherchroot,
74 > and Paludis can operate with all of thse. Paludis can also operate on
75 > systems where there's no configuration -- for example, you shouldn't
76 > need a full config setup just to be able to run QA checks on one
77 > particular repository.
78 >
79 > Portage also sort of has some of this in a very crude way, through
80 > PORTAGE_CONFIGROOT.
81
82 As catapult only queries, this can be resolved _inside_ the paludis
83 provider.
84 This of course gets hairy if it comes to libcatapult to provide
85 config-file manipulation...
86
87 >>> * sets don't map on to package manager sets.
88 >> This can easily be changed. But nevertheless, some catapult-wide sets
89 >> should be defined, that map onto the specific ones in the package
90 >> managers (e.g. catapult.SET_ALL should be replaced by the specific set
91 >> in the different managers)
92 >
93 > I'm not really sure that your concept of sets is right...
94 >
95
96 A "set" is a "set of packages" for me. You mention a "set of specs" -
97 don't get what kind of "specs" you are referring to here.
98
99 >>> - find_best. What does this do if you give it foo/bar-1 foo/baz-1?
100 >> Undefined atm.
101 >>> What's the point of having this function at all?
102 >> See very first remark.
103 >
104 > Sure, but you should still define your API in such a way that it's
105 > easily generalisable and maps well onto the underlying data.
106 >
107
108 Hmm ... Catapult should provide an API to ease developing applications
109 that deal with package managers. So there might be the case here or
110 there that one provider has to do some work to map to the underlying
111 package manager.
112
113 >>> - find_packages. As find_best_match for search key. What
114 >>> disambiguation is performed upon the atom? What happens if you pass
115 >>> it something like 'git', which is ambiguous?
116 >> Return everything that fits. It should be on the users side to
117 >> translate it into something useful.
118 >
119 > That's messy.
120 >
121
122 Why? - It's a search function. And I guess in most cases the "return
123 everything that matches" is in case intended.
124
125 >>> - get_config_path. Unportable. What if the user is using some other
126 >>> config format?
127 >> But the configs (read: package.mask, package.use etc.) have to be at a
128 >> specified unique location, don't they?
129 >
130 > For Paludis? No. NoConfigEnvironment, for example, uses no
131 > configuration directory at all.
132 >
133
134 This really is an issue... And what is happening if the user wants to
135 set an option (e.g. a useflag) in the "NoConfigEnvironment"? - Is a
136 config directory created and the environment switched?
137
138 >>> - get_deep_option. Deep's a mess; making package managers emulate
139 >>> it via a command line switch is silly.
140 >> If you don't have an equivalent: Return "".
141 >
142 > It shouldn't be in the API at all though.
143
144 Hmmm ... it is of course portage-inspired. So you are of course right,
145 that something like this should not be allowed in the API. Nevertheless,
146 I want to provide applications with the ability to run a package manager
147 with different option switches which follow some global semantics.
148 Or do you think, something like this is just not possible and we have to
149 look for another way of doing so?
150
151 >>> - get_merge_command. There's no nice way of using whatever this
152 >>> returns. And it's pointless -- why not just ask the package manager
153 >>> to do the merge?
154 >> Because catapult should be passive: I.E. only provide information and
155 >> does not do anything that could be harmful.
156 >
157 > Then it shouldn't even try to provide a way to do the merge stuff. It
158 > needs to either do this properly or not at all.
159
160 Think of the following use case: An application provides an interface
161 that allows users to select a package for installation. Now this
162 application uses catapult and wants to query for the command which has
163 to be run to get this package installed. Using get_merge_command, the
164 app could do:
165
166 spawn(catapult.system.get_merge_command(), package_list)
167
168 Catapult isn't the system merging here - it just provides the
169 information to actually _do_ the merge.
170
171 >>> - split_cpv. Why the weird revision thing?
172 >> What's so weired about it?
173 >
174 > Why is the revision considered special?
175
176 I'm waiting what's the result of the "-r0"-thread on gentoo-dev before
177 giving an anwer ;)
178
179 >>> - What do all of these do on unknown EAPI?
180 >> Again: Why does the API have to care about EAPI? - It's the providers
181 >> job to care about it.
182 >
183 > If you perform an API call that works on an ID with an unknown EAPI,
184 > what's supposed to happen? What about if you perform an API call that
185 > works upon an ID with an EAPI known to the package manager but not to
186 > the tool?
187 >
188 > (One example: what happens if we go with DEPENDENCIES for EAPI 2, and if
189 > you ask for DEPEND on an EAPI 2 package?)
190
191 We have the following cases:
192 1.) "DEPEND" is a fixed catapult term/constant. Then the provider has to
193 map to "DEPENDENCIES" if it encounters the term and EAPI2 is used.
194 2.) "DEPEND" is directly passed to the package manager (for example
195 using "get_package_settings"). I think this isn't preferred behavior and
196 only a given set of constants for the "settings" and alike should be
197 used. -> see 1.)
198
199 >>> - compare_version. But it takes packages. What's the ordering on
200 >>> foo/bar-1 vs bar/baz-1?
201 >> Currently it would return: ("bar-1", "baz-1") as bar < baz. But this
202 >> can easily specified different. And a good point to think about error
203 >> handling again.
204 >
205 > Why the ordering on PN rather than CATEGORY/PN?
206
207 Hehe ;) - my fault... misread it. Of course it is first sorted using the
208 category. But haven't seen, they are different.
209
210 >>> And what's the return value? What about when || is in operation?
211 >> WWPMD (what would the package manager do): Simplified: Pass the
212 >> dep-string to the package manager and see what he does with it. The
213 >> result is returned.
214 >
215 > The package manager has to have special handling for || throughout. The
216 > behaviour of || blocks is rather tricky.
217
218 I guess it is a major problem if the package manager isn't able to
219 handle "||", right? - So I can't see your point here.
220
221 >>> - get_iuse_flags. What does this do for IUSE defaults? For installed
222 >>> packages, all flags are forced.
223 >> defaults are returned verbatim. I used to define "forced flags" as:
224 >> "The flags the user can't change." (like userland_GNU or use.mask'ed
225 >> flags)
226 >
227 > The user can't change any flags for installed packages.
228
229 True. But he can re-install it using the changed flags. (Though he isn't
230 using the flags of the installed packages here, but the ones of the
231 uninstalled and overwriting the installed one.)
232 In other words: For this use case, the useflags of installed packages
233 are not seen as "forced flags" per se.
234
235 >>> - get_masking_reason. Is the return value supposed to be used by
236 >>> anything other than a human?
237 >> I doubt it.
238 >
239 > Specify that.
240
241 I guess I'm again missing something ;). But I can't see, why it matters
242 if it is intended for human readers or not :). And if there _is_ a
243 difference, there should be no problem in adding a "for_humans" boolean
244 argument to this call. :)
245 Though I don't know, what the masking reason should look like for
246 non-human targets.
247
248 >>> - get_overlay_path. What if it's in an overlay with no on-disk
249 >>> location? What if it's in some format the end tool doesn't
250 >>> recognise?
251 >> The end tool's problem I'd say.
252 >
253 > You're providing API calls that make this sort of thing difficult. Not
254 > an ideal situation...
255
256 Just return some kind of an URL. The end tool has to deal with it.
257
258 >>> or when expanded keys aren't known.
259 >> When should that happen?
260 >
261 > Installed packages. USE_EXPAND wasn't (and still isn't by some package
262 > managers iirc) saved to VDB.
263
264 Ok - so you are trying to cover the case, that USE_EXPAND changes after
265 installation of a package.
266 My answer would be: This is the fault of the underlying package manager.
267 If USE_EXPAND can't be resolved correctly, the wrong result (what ever
268 that means in the special case) is passed back.
269
270 Catapult should try to get rid of some flaws - but if it is not
271 possible, we can't do anything here. Bad luck.
272
273 >>> What's the point in using DBus? What does it add over a simplified
274 >>> library with bindings?
275 >> Library bindings have several disadvantages:
276 >> - - Providers have to be coded in C.
277 >> - - How to access portage internals from C-Code? Yes: You can
278 >> implement python-calls in C... but I think this is messy.
279 >
280 > You can do the translation either way.
281
282 Right - but I consider it messy. (And I personally am a Python fan boy
283 and really dislike to code in C or even C++).
284 And I think it is quite strange, if you have a Python app, that accesses
285 Catapult-Portage:
286
287 Python (app) <---> Python (catapult bindings) <---> C (catapult) <--->
288 Python (portage)
289
290 >>> How does the whole privs thing work? Should anyone who can talk by
291 >>> DBus be allowed to perform privileged operations? Should anyone who
292 >>> can't perform privileged operations be allowed to do unprivileged
293 >>> operations?
294 >> I thought of having Catapult being a passive thing. So there is no way
295 >> of doing privileged actions.
296 >
297 > Things like querying an uncached package are privileged.
298
299 Yes? - Why? Any user can open an ebuild and have a look at the internals.
300
301 And if it still matters: DBus allows to define in config files, which
302 users are allowed to do which actions on which bus.
303
304 >>> What about persistence? What's classed as a session? Why force it
305 >>> down to a single session at once?
306 >> Easier to implement. But it isn't forced. If the provider implements
307 >> sessions (e.g. using the Dbus-sending-adress as a key) w/o extending
308 >> API, I can't see a problem.
309 >
310 > But without well-defined session management, you're stuck when it comes
311 > to multiple configurations and the like.
312
313 What exactly do you want to store in / link to the session?
314 -----BEGIN PGP SIGNATURE-----
315 Version: GnuPG v2.0.7 (GNU/Linux)
316 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
317
318 iD8DBQFH8BYr4UOg/zhYFuARAlLnAJ0fdoxjIa3tj3vOz8iMjUDOgLD7cACghPk5
319 AnSwpVHV1KRy0txxDGHJ0a4=
320 =XoHx
321 -----END PGP SIGNATURE-----
322 --
323 gentoo-guis@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-guis] Why I don't like catapult Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>