Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-dev@l.g.o
Cc: dolsen@g.o
Subject: Re: [gentoo-dev] A more natural (human-friendly) syntax for dependencies
Date: Tue, 25 Sep 2012 23:44:21
Message-Id: 20120925234112.GG26094@localhost
In Reply to: Re: [gentoo-dev] A more natural (human-friendly) syntax for dependencies by "Michał Górny"
1 On Sat, Sep 22, 2012 at 07:19:09PM +0200, Micha?? G??rny wrote:
2 > On Sat, 22 Sep 2012 10:05:41 -0700
3 > Brian Dolbec <dolsen@g.o> wrote:
4 >
5 > > On Sat, 2012-09-22 at 09:55 +0200, Micha?? G??rny wrote:
6 > > > Hello,
7 > > >
8 > > > The current dependency syntax:
9 > > >
10 > > > [VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]
11 > > >
12 > > > suffers a few problems:
13 > > >
14 > > >
15 > > > 1. It is not really human-friendly.
16 > > >
17 > > > People don't say things like:
18 > > >
19 > > > I need newer than monkey-1.2.
20 > > >
21 > > > They say instead:
22 > > >
23 > > > I need monkey, newer than version 1.2.
24 > > >
25 > > [snip :/ ]
26 > >
27 > > > 4. It follows the syntax used by bash (for conditionals), pkg-config
28 > > > -- it is more natural in the environment.
29 > > >
30 > >
31 > > The BIG problem with that is bash has nothing to do with evaluating
32 > > dependencies. All bash does is source the *DEPEND and pass the value
33 > > to the package manager which does all the processing. And all 3
34 > > current package managers are set up to parse those dep strings with a
35 > > set syntax and whitespace. None of the PM's dependency resolvers are
36 > > written in bash, two are python based, one C++. This proposal would
37 > > throw a big monkey wrench into parsing those strings. Introducing
38 > > lots of bugs, both in the PM and the ebuilds.
39 >
40 > It has all to do with people writing ebuilds.
41 >
42 > Also, I don't really see a problem with parsing it. Bash is not really
43 > relevant here; Python and C++ doesn't have a problem with either
44 > syntax. It's just about correct tokenizer design.
45 >
46 > > And this after all the fuss about the unified DEPENDENCIES proposal,
47 > > which is a small syntax change for the current processing code, easily
48 > > incorporated into the PM's.
49 >
50 > Err, no, it isn't. It requires redesigning ebuilds, cache, and probably
51 > a lot of code paths in the dependency parser unless the new syntax is
52 > going to be converted back to old one.
53
54 It requires none of those things you claim.
55
56 I know this since I actually wrote patches for it already.
57
58 You should know this since you responded to that exact email, and
59 have been very active in that thread. I laid out exactly how this
60 plugged into our existing design and posted patches proving it.
61
62 Phrased as nicely as I can, you're trolling, poorly at that. Please
63 desist.
64
65 Reiterating it again for others who weren't as active in that thread,
66 patches are here:
67 http://dev.gentoo.org/~ferringb/unified-dependencies/patches/
68
69
70 > Mine is easily incorporated into the PM; it is just a change
71 > in a single place splitting and parsing the tokens.
72
73 You really need to do a walk through portage internals.
74
75 All ebuild based parsers are whitespace based parsing; the sole
76 exception is for src_uri's -> file rename, and by large that code is a
77 bit icky for each; in portages case, doubly so frankly
78 (pkgcore/paludis use a reversible iterator design in that case; less
79 icky, but it throws off the normal flow ).
80
81 This isn't a simple change for the PM; worse, it'll require two parse
82 tree codebases since trying to inline your notion in would fuck the
83 code up something fierce in terms of maintenence/flow.
84
85 If you'd like to argue that, I'd suggest you take pkgcore and modify
86 it for your intent (the parse code is pkgcore/ebuild/conditionals.py;
87 it's the simplest but full implementation out there imo, thus the
88 suggestion), while preserving parsing support for the old format;
89 just the python side, you don't need to do the c extension.
90
91 Post that patch and prove it; else... bluntly, you're arguing w/
92 authors about their own code. That usually isn't a scenario people
93 win. Some authors may be retards, hell, I may be, but I'm not wrong
94 on that section of code across the managers.
95
96
97 > > AND has definite, measurable advantages.
98 >
99 > We still didn't get a single one.
100 >
101 > So, I think you just don't like it and are inventing disadvantages
102 > without even caring enough to consider them before writing.
103
104
105 Just kicking the corpse to make damn sure it stays down, here's the
106 flaws I saw pretty much immediately in reading the first email; if an
107 hour was spent, I'm sure worse issues could be found.
108
109 *) cocks up emerge invocation. Previously `emerge
110 =dev-util/diffball-1`; your proposal, `emerge 'dev-util/diffball =
111 1'`. You argue "well you already have to quote for > or <"; thing is,
112 we don't have to quote for equals, and you now require it- globbed
113 versions, same thing.
114
115 *) If you argue "emerge should just collapse the args if given
116 `emerge dev-util/diffball = 1`, then I suggest *you* write that code,
117 and maintain it. It'd take a strong council action before I did that
118 in pkgcore. I think it's that level of wrong.
119
120 *) The proposal completely overlooked profiles. We'd have to
121 use the old form through out the entirety of the profiles. Woot,
122 maintaining two dep syntax/parse trees indefinitely...
123
124 * *) This requires changing the parsing rules of every single atom
125 based file in the profile tree. Anything use related
126 (package.use.mask) is whitespace split; not anymore it ain't. Code
127 duplication baby, lots of it.
128
129 *) The proposal ignores metadata/updates; more importantly, updates
130 are unversioned- we have no EAPI awareness in there. Meaning updates
131 would have to be the old form indefinitely.
132
133 *) The proposal completely ignored slot deps, repository deps, use
134 deps. You're arguing thus:
135
136 sys-apps/portage[build] >= 2.1
137 sys-apps/portage:0[build] =~ 2.2
138 sys-apps/portage::gentoo <= 2.2
139
140 *) This force duplication of atom parsing implementations; currently,
141 they all basically extract a cpv out of it if '<>=~' are seen; if
142 those operators aren't there, they split on '/'. Either the PM would
143 have to maintain duplicate parsing pathways/validation, or it would
144 (most likely) collapse your form down into the old form since we
145 already have well tested code that handles that.
146
147 *) This doesn't address profiles/news at all. I expect complications
148 to ensue there too, especially considering... wait for it... the atoms
149 in use there aren't EAPI versioned. Meaning old form is required
150 indefinitely.
151
152
153 Again, I suggest you read up on the guts of existing package managers;
154 read he source. Additionally, please at least do a basic validation
155 of the notion before just throwing it at the dev ml; it may not matter
156 to you, but that's 21 more emails people have to read due to the basic
157 legwork not being done.
158
159 ~harring