Gentoo Archives: gentoo-guis

From: "René 'Necoro' Neumann" <lists@××××××.eu>
To: Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>
Cc: gentoo-guis@l.g.o
Subject: Re: [gentoo-guis] Why I don't like catapult
Date: Tue, 01 Apr 2008 14:09:13
Message-Id: 47F2427E.4070704@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 >
6 > Sounds like you need a layered architecture. A low level catapult to
7 > package manager layer, and a high level package manager independent
8 > extras layer.
9 >
10
11 Currently working on transforming it ... Will post the results later on :)
12
13 >> Ok. Perhaps we can postpone this until it gets real. (And then perhaps
14 >> use scpvr's ;) ... like: cpan:bla-foo/SomePerlPkg-0.13)
15 >
16 > Paludis does it already.
17 >
18
19 So we can set it as the package format? (Though needing further
20 definitions.)
21
22 >>> Paludis supports multiple configurations. You can, for example,
23 >>> have /etc/paludis, /etc/paludis-mychroot and
24 >>> ~/.paludis-anotherchroot, and Paludis can operate with all of thse.
25 >>> Paludis can also operate on systems where there's no configuration
26 >>> -- for example, you shouldn't need a full config setup just to be
27 >>> able to run QA checks on one particular repository.
28 >>>
29 >>> Portage also sort of has some of this in a very crude way, through
30 >>> PORTAGE_CONFIGROOT.
31 >> As catapult only queries, this can be resolved _inside_ the paludis
32 >> provider.
33 >> This of course gets hairy if it comes to libcatapult to provide
34 >> config-file manipulation...
35 >
36 > How does Paludis know which configuration set it should be using to
37 > respond to queries?
38 >
39
40 Ok - so we need sessions ...
41
42 I see two possibilites to implement it:
43 - - pass it as a parameter each time to each function ... Problems:
44 + each function needs an additional parameter ...
45 + how and what to pass using DBus? - I only can think of id-strings ...
46 but this leads to the second possibility
47 - - use the unique dbus service name and store sessions internally: see
48 http://lists.freedesktop.org/archives/dbus/2008-March/009550.html -->
49 now it is back to provider logic
50
51 In other words: The provider, which needs sessions, can use an internal
52 hashmap with the dbus service name of the client as the key and store
53 the data. This service name is defined to be unique as long as the dbus
54 bus is running. -> No need to support sessions in the official API.
55
56 >> A "set" is a "set of packages" for me. You mention a "set of specs" -
57 >> don't get what kind of "specs" you are referring to here.
58 >
59 > A set isn't a set of packages. It's a set of dependency specifications
60 > (foo/bar or >=foo/bar-2 or whatever).
61 >
62
63 k - understood
64
65 >>>>> - find_packages. As find_best_match for search key. What
66 >>>>> disambiguation is performed upon the atom? What happens if you
67 >>>>> pass it something like 'git', which is ambiguous?
68 >>>> Return everything that fits. It should be on the users side to
69 >>>> translate it into something useful.
70 >>> That's messy.
71 >> Why? - It's a search function. And I guess in most cases the "return
72 >> everything that matches" is in case intended.
73 >
74 > Have a look at what existing tools do when given an ambiguous package
75 > name part. They generally error, not do everything. Coding various
76 > things gets tricky when you have to manually check that you've only
77 > been given a single package name.
78 >
79
80 As written above, I'm currently working on changing this.
81
82 >>>>> - get_config_path. Unportable. What if the user is using some
83 >>>>> other config format?
84 >>>> But the configs (read: package.mask, package.use etc.) have to be
85 >>>> at a specified unique location, don't they?
86 >>> For Paludis? No. NoConfigEnvironment, for example, uses no
87 >>> configuration directory at all.
88 >>>
89 >> This really is an issue... And what is happening if the user wants to
90 >> set an option (e.g. a useflag) in the "NoConfigEnvironment"? - Is a
91 >> config directory created and the environment switched?
92 >
93 > No. Users can't set options in NoConfigEnvironment. There is literally
94 > no configuration beyond the constructing parameters.
95
96 For the moment we can remove this call. But as soon as we want to have
97 libcatapult to provide a central place to allow config file changes, we
98 need a solution for this problem.
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 That's true. But I want it for three reasons:
124 - - no security issues
125 - - safe way is more important than nice way: In case the information
126 catapult provided (e.g. dep tree) is not correct (for whatever reason),
127 I don't want it to crash the users system. Thus, it is better to let the
128 package manager to have the final say. - This reason gets obsolete if
129 the providers are maintained by the package manager teams themselves,
130 but this is not the case atm.
131 - - at least in portage I can't see a way to say "hey - portage: install
132 the following packages please", as the logic behind this is done in
133 emerge itself.
134
135 Is there any other reason to vote against this besides "isn't the nice way"?
136
137 >>>>> - split_cpv. Why the weird revision thing?
138 >>>> What's so weired about it?
139 >>> Why is the revision considered special?
140 >> I'm waiting what's the result of the "-r0"-thread on gentoo-dev before
141 >> giving an anwer ;)
142 >
143 > Doesn't make much difference either way... Why is the revision the only
144 > version part you treat specially?
145
146 We could also return "" instead "-r0" if no revision is given. Does not
147 make a difference.
148
149 >> We have the following cases:
150 >> 1.) "DEPEND" is a fixed catapult term/constant. Then the provider has
151 >> to map to "DEPENDENCIES" if it encounters the term and EAPI2 is used.
152 >
153 > Not doable. DEPENDENCIES can't map to DEPEND. DEPEND isn't powerful
154 > enough syntactically.
155
156 Now I see, why you want the user to know of the EAPI... Do you think it
157 would be enough to allow to query the EAPI value of a package? Then
158 (taking this example) the client can decide whether to ask for "DEPEND"
159 or "DEPENDENCIES" depending on the EAPI.
160 If for some reason, he asks for "DEPEND" and the package uses EAPI2 an
161 EAPIError or something similar is being thrown.
162
163 >>>>> And what's the return value? What about when || is in operation?
164 >>>> WWPMD (what would the package manager do): Simplified: Pass the
165 >>>> dep-string to the package manager and see what he does with it. The
166 >>>> result is returned.
167 >>> The package manager has to have special handling for || throughout.
168 >>> The behaviour of || blocks is rather tricky.
169 >> I guess it is a major problem if the package manager isn't able to
170 >> handle "||", right? - So I can't see your point here.
171 >
172 > The package manager handles || on a case by case basis. Anything
173 > containing || cannot be flattened to a simple list.
174
175 When installing the the package the package manager is taking one of the
176 choices of "||", based on certain information. A similar approach should
177 be used here too.
178
179 >>>>> - get_iuse_flags. What does this do for IUSE defaults? For
180 >>>>> installed packages, all flags are forced.
181 >>>> defaults are returned verbatim. I used to define "forced flags" as:
182 >>>> "The flags the user can't change." (like userland_GNU or
183 >>>> use.mask'ed flags)
184 >>> The user can't change any flags for installed packages.
185 >> True. But he can re-install it using the changed flags. (Though he
186 >> isn't using the flags of the installed packages here, but the ones of
187 >> the uninstalled and overwriting the installed one.)
188 >> In other words: For this use case, the useflags of installed packages
189 >> are not seen as "forced flags" per se.
190 >
191 > They are forced for the installed ID. They aren't necessarily forced
192 > for other different IDs that can be installed to replace the currently
193 > installed ID.
194 >
195 > The foo/bar-2.0 that you have installed is a completely different ID to
196 > any foo/bar-2.0 you happen to have in a repository somewhere.
197
198 Postponing this ... have to think about it.
199
200 >>>>> - get_masking_reason. Is the return value supposed to be used by
201 >>>>> anything other than a human?
202 >>>> I doubt it.
203 >>> Specify that.
204 >> I guess I'm again missing something ;). But I can't see, why it
205 >> matters if it is intended for human readers or not :). And if there
206 >> _is_ a difference, there should be no problem in adding a
207 >> "for_humans" boolean argument to this call. :)
208 >> Though I don't know, what the masking reason should look like for
209 >> non-human targets.
210 >
211 > If it's intended to be machine usable, the format has to be fixed.
212
213 So let's decide to have it human readable only.
214
215 >>>>> - get_overlay_path. What if it's in an overlay with no on-disk
216 >>>>> location? What if it's in some format the end tool doesn't
217 >>>>> recognise?
218 >>>> The end tool's problem I'd say.
219 >>> You're providing API calls that make this sort of thing difficult.
220 >>> Not an ideal situation...
221 >> Just return some kind of an URL. The end tool has to deal with it.
222 >
223 > Then the name needs changing, and it needs to be documented that the
224 > return value is entirely meaningless.
225
226 Name change ok - perhaps s/path/url/ ?
227
228 "entirely meaningless" - I would use "might be meaningless" instead.
229
230 >>>>> How does the whole privs thing work? Should anyone who can talk by
231 >>>>> DBus be allowed to perform privileged operations? Should anyone
232 >>>>> who can't perform privileged operations be allowed to do
233 >>>>> unprivileged operations?
234 >>>> I thought of having Catapult being a passive thing. So there is no
235 >>>> way of doing privileged actions.
236 >>> Things like querying an uncached package are privileged.
237 >> Yes? - Why? Any user can open an ebuild and have a look at the
238 >> internals.
239 >
240 > But they can't write to cache on disk. Remember that Portage needs you
241 > to be in the 'portage' group to do anything, and anyone in the
242 > 'portage' group can easily obtain root on the box.
243
244 Nope - you can query even if you are not in the portage group.
245
246 Despite the current open issues (btw: I tried to collect them on a wiki
247 page: http://catapult.origo.ethz.ch/wiki/current_issues ), do you think
248 that the whole system can be brought to something useful in the end?
249 -----BEGIN PGP SIGNATURE-----
250 Version: GnuPG v2.0.7 (GNU/Linux)
251 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
252
253 iD8DBQFH8kJ+4UOg/zhYFuARAjGOAJ9P4D5kZBJPu5FgS7ONmXw7T7E6kACaA0IU
254 YNS2iJrPw7gxB8dJy8U/mEY=
255 =UAQ9
256 -----END PGP SIGNATURE-----
257 --
258 gentoo-guis@l.g.o mailing list

Replies

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