From: Brian Harring <ferringb@gmail.com>
To: Zac Medico <zmedico@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFD: EAPI specification in ebuilds
Date: Mon, 12 Mar 2012 01:36:12 -0700 [thread overview]
Message-ID: <20120312083612.GF7579@localhost> (raw)
In-Reply-To: <4F5D76B8.5040102@gentoo.org>
On Sun, Mar 11, 2012 at 09:08:24PM -0700, Zac Medico wrote:
> On 03/11/2012 06:55 PM, Brian Harring wrote:
> > On Sat, Mar 10, 2012 at 08:06:50AM -0800, Zac Medico wrote:
> >> Yeah. Another way of putting it is that the requirement to spawn a bash
> >> process and source the ebuild adds a ridiculous amount of unnecessary
> >> complexity, in violation of the KISS principle [1].
> >
> > This statement is incorrect.
> >
> > Even if EAPI could be parsed via some non sourcing approach, we
> > *still* have to source the ebuild to get the metadata for when the
> > EAPI is supported (the vast majority of usage). That complexity is
> > there one way or another- we wouldn't be trying to extract the EAPI
> > from the ebuild unless the cache was invalid/missing.
>
> There are a couple of other cases worth considering:
>
> 1) User downloads an overlay that doesn't provide cache. We want the
> package manager to give a pretty "EAPI unsupported" message, rather than
> spit out some bash syntax errors.
This criticsm pretty much applies *strictly to the existing
implementation*. It's disenguous busting it in this fashion.
EAPI as a function explicitly gives it an out before hitting any of
that, eliminating your entire critique. Same goes for parsing it out
of the ebuild, or renaming the extension.
> 2) You're assuming that a package manager can validate cache for an EAPI
> that it doesn't necessarily support.
Actually, I'm not.
> That's a somewhat fragile
> assumption, given the complexities of cache validation, which involve
> verification all files that affect metadata and those files may vary
> depending on the EAPI.
This is a fair bit of handwavey bullshit. The same "complexities of
cache validation" we have to by default deal with for valid/supported
EAPIs; the case for unsupported EAPIs is actually simpler than
for supported EAPis, and up until 7ddb7d30, was likely working fine in
portage. Tweaking portage to restore that support is pretty easy.
Also note that with the sole exception of g55, every implementation
has to deal with this specific issue, even g55 isn't fully exempt from
it since in cleansing a cache, there is the open question of pruning
cache entries for ebuilds known, but not understood by the local PM.
Either way, the algo is as follows: PM pulls EAPI from the ebuild
(regardless of method); PM recognizes that it can't handle it- thus
it stores EAPI:-$EAPI, and the normal cache ebuild checksumming;
whether it be mtime, md5 for md5-dict, or whatever form new caches
choose to use.
For attempts to load, the cache subsystem checks that validation
before trusting the cache entry- this is in place and has been for a
very, very long time. This isn't anything new.
So... the entry point is the ebuild; we have checksums for it, and a
prefixed versions of it's EAPI stored. The sole deal breaker here is
if we were to decide to allow eclasses to set EAPI (rather than the
current "you're not supposed to, although we don't explicitly block
it"- which could be tightened to be disallowed at the implementation
level for EAPI>4).
The following scenarios exist:
1) PM still doesn't support that EAPI, looks at the cache/ebuild:
checksums are the same, thus the stored EAPI is trustable, leading to
the PM knowing it still can't process that ebuild and masking it
appropriately.
2) PM still doesn't support that EAPI, looks, sees that the checksums
no longer match the ebuild. Re-pulls metadata/EAPI; if the ebuild has
been changed to a supported EAPI, continues on its way. If not,
stores the checksum/negated EAPI, and masks appropriately.
3) PM now supports that EAPI, looks, sees the negated eapi and
recognizes it as one it knowns, and forces regeneration.
All of those scenarios are there, and easy enough to handle- this
applies for the existing EAPI implementation additionally.
Now, this isn't to say that someone can't go and try to structure new
features explicitly to defeat the existing validations. They could.
The question here is whether or not new features would actually
*break* that w/out intentionally going out of their way to do so (aka,
skip the strawman arguments, actual examples required).
> > Phrasing it more bluntly: you can only avoid the sourcing step if you
> > can isolate that the EAPI is unsupported (which is extremely rare in
> > terms of actual user experience). For the rest of the time (well past
> > the 99% mark) sourcing is the immediate step following.
>
> For the sake of being robust in all possible cases, it's just a lot
> simpler if we can obtain the EAPI simply and reliably, without spawning
> bash to source the ebuild.
This still is arguable; any performant PM is going to have to do the
cache dance I mentioned above, or maintain an in memory list of
ebuilds it knows it can't handle (which if you want to talk robust,
fails miserably if the API isn't designed for sync invalidation of
that global list). Complexity, oh my.
That's the kicker from where I'm sitting; you're so focused on
avoiding bash that you ignore the complexities surrounding it that are
unavoidable regardless.
The EAPI function route resolve this issue w/out penalizing the normal
(aka supported) pathways, and does so at the same robustness as
everything sans g55 (which aims to allow us to use things other
than bash such as the mocked xml ebuild format). Frankly, the
function route gives us a bit more robustness- rather than allowing
the scenario of a PM that doesn't parse seeing a version that requires
it, via the function route doing `eapi 5 || die` has no such failure
mode.
> > Also, stop referencing wikipedia. People know what "trivial
> > objection" and "KISS" is.
>
> You can't assume that. On this list we've got potential to have readers
> and responders with lots of different backgrounds.
You might want to include links to Linux, gentoo, and bash while
you're at it.
Ya know, just in case.
> Your insistence on
> using bash to obtain the EAPI would make me wonder if you understood the
> KISS principle, if I didn't know you better.
Zing.
What I'd like to see, is accuracy in this discussion. Skip the
handwavey "complexity! complexity! complexity!" crap, same for
selective robustness definitions. Past attempts at this discussion
mostly failed due to people pulling crap like this and frankly it just
pisses people off.
Like it or not, each solution has technical pros/cons, more
importantly, it has an impact on developers meaning what they *like*
carries weight (rather than what you want them to do).
Shebang/parsing EAPI w/out bash, EAPI as a function, all are reliant
on the same cache mechanism. That's fact. G55 is the sole exception.
The question of what mechanism to use is dependant on what people
actually want, and how far we're willing to stretch the ebuild format
(versus defining a new one rather than new versions of it).
For the lifespan of gentoo thus far, our format has been bash; trying
to shift away from bash is fine, but as long as it *is* bash we should
be designing w/ that flow, including what is least likely to have a
developer screw up. Pragmatic reality, especially since we're still
stuck w/ compatibility issues getting to the new mechanism.
Frankly I'm starting to think I should just write up a table of
pros/cons, extending what Ulm has started; in particular, including
accurate statement of the transition costs of each (something people
seem to be ignoring- compatibility mechanisms are *not* cheap to get
in place).
~harring
next prev parent reply other threads:[~2012-03-12 8:37 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 20:41 [gentoo-dev] RFD: EAPI specification in ebuilds Ulrich Mueller
2012-03-07 20:44 ` Ciaran McCreesh
2012-03-07 21:07 ` Alexis Ballier
2012-03-07 22:04 ` David Leverton
2012-03-07 22:14 ` Michael Orlitzky
2012-03-08 0:17 ` Ulrich Mueller
2012-03-08 12:03 ` Michał Górny
2012-03-08 15:56 ` Michael Orlitzky
2012-03-08 17:28 ` Michał Górny
2012-03-08 17:48 ` Michael Orlitzky
2012-03-08 17:53 ` Ciaran McCreesh
2012-03-08 18:37 ` Michael Orlitzky
2012-03-08 18:48 ` Ciaran McCreesh
2012-03-08 21:35 ` Michael Orlitzky
2012-03-08 23:31 ` Alec Warner
2012-03-09 3:05 ` Michael Orlitzky
2012-03-09 5:04 ` Michał Górny
2012-03-09 5:35 ` Michael Orlitzky
2012-03-09 5:51 ` Zac Medico
2012-03-09 14:42 ` Michael Orlitzky
2012-03-09 15:05 ` Zac Medico
2012-03-09 15:21 ` Michael Orlitzky
2012-03-09 15:41 ` Zac Medico
2012-03-09 15:51 ` Alexis Ballier
2012-03-09 15:58 ` Zac Medico
2012-03-09 16:49 ` Michael Orlitzky
2012-03-09 16:57 ` Zac Medico
2012-03-09 19:20 ` Ciaran McCreesh
2012-03-10 16:06 ` Zac Medico
2012-03-12 1:55 ` Brian Harring
2012-03-12 4:08 ` Zac Medico
2012-03-12 8:36 ` Brian Harring [this message]
2012-03-12 15:35 ` Ciaran McCreesh
2012-03-12 16:05 ` Zac Medico
2012-03-12 16:12 ` Ciaran McCreesh
2012-03-12 16:28 ` Zac Medico
2012-03-14 2:01 ` Brian Harring
2012-03-14 2:16 ` Zac Medico
2012-03-09 15:52 ` Ian Stakenvicius
2012-03-09 16:15 ` Zac Medico
2012-03-09 16:33 ` Eray Aslan
2012-03-09 16:43 ` Zac Medico
2012-03-09 16:29 ` Michał Górny
2012-03-09 16:57 ` Michael Orlitzky
2012-03-09 17:11 ` Ulrich Mueller
2012-03-09 17:31 ` Michael Orlitzky
2012-03-09 17:47 ` Zac Medico
2012-03-09 18:03 ` Michael Orlitzky
2012-03-09 19:08 ` Rich Freeman
2012-03-12 2:03 ` Brian Harring
2012-03-12 2:20 ` Rich Freeman
2012-03-12 2:24 ` Alec Warner
2012-03-12 6:57 ` Kent Fredric
2012-03-12 6:50 ` Kent Fredric
2012-03-12 7:08 ` Zac Medico
2012-03-12 7:39 ` Kent Fredric
2012-03-12 8:27 ` Michał Górny
2012-03-12 8:30 ` Ciaran McCreesh
2012-03-12 9:09 ` Michał Górny
2012-03-12 9:16 ` Kent Fredric
2012-03-12 9:48 ` Ulrich Mueller
2012-03-12 10:12 ` Kent Fredric
2012-03-12 15:20 ` Rich Freeman
2012-03-12 17:01 ` Zac Medico
2012-03-12 17:30 ` Rich Freeman
2012-03-12 17:46 ` Zac Medico
2012-03-12 19:20 ` Rich Freeman
2012-03-12 8:39 ` Kent Fredric
2012-03-12 9:10 ` Michał Górny
2012-03-12 3:55 ` Zac Medico
2012-03-09 17:52 ` Michał Górny
2012-03-12 1:00 ` Brian Harring
2012-03-09 18:02 ` James Broadhead
2012-03-09 18:24 ` Alexis Ballier
2012-03-09 18:29 ` Zac Medico
2012-03-09 18:33 ` Michael Orlitzky
2012-03-09 18:56 ` Zac Medico
2012-03-09 19:23 ` Ciaran McCreesh
2012-03-09 20:09 ` Michael Orlitzky
2012-03-19 1:12 ` [gentoo-dev] " Steven J Long
2012-03-19 1:36 ` Kent Fredric
2012-03-19 3:21 ` Brian Harring
2012-03-24 13:24 ` [gentoo-dev] " Steven J Long
2012-03-07 22:36 ` [gentoo-dev] " Alexandre Rostovtsev
2012-03-08 2:22 ` Jeroen Roovers
2012-03-08 16:14 ` [gentoo-dev] Ebb (eb) was: " Todd Goodman
2012-03-08 4:12 ` [gentoo-dev] " Alec Warner
2012-03-08 7:27 ` Ulrich Mueller
2012-03-08 8:13 ` Alec Warner
2012-03-08 15:27 ` Zac Medico
2012-03-08 16:11 ` David Leverton
2012-03-08 16:21 ` Zac Medico
2012-03-08 16:29 ` Ciaran McCreesh
2012-03-08 16:50 ` Zac Medico
2012-03-08 16:59 ` Alexandre Rostovtsev
2012-03-08 17:03 ` Ciaran McCreesh
2012-03-08 19:17 ` Ulrich Mueller
2012-03-08 19:31 ` Ciaran McCreesh
2012-03-08 19:48 ` Alexis Ballier
2012-03-08 9:42 ` Marc Schiffbauer
2012-03-08 16:30 ` Zac Medico
2012-03-08 16:35 ` Ciaran McCreesh
2012-03-08 17:07 ` Zac Medico
2012-03-08 17:14 ` Ciaran McCreesh
2012-03-08 17:30 ` Jeroen Roovers
2012-03-08 17:37 ` Ciaran McCreesh
2012-03-10 1:06 ` Kent Fredric
2012-03-10 13:53 ` Ciaran McCreesh
2012-03-09 11:28 ` Marc Schiffbauer
2012-03-08 12:06 ` Michał Górny
2012-03-08 15:58 ` Michael Orlitzky
2012-03-08 16:51 ` Ulrich Mueller
2012-03-08 17:03 ` Rich Freeman
2012-03-08 16:47 ` Mike Gilbert
2012-03-08 17:52 ` Michał Górny
2012-03-08 17:56 ` Ciaran McCreesh
2012-03-08 18:22 ` Zac Medico
2012-03-08 19:04 ` Ulrich Mueller
2012-03-08 19:38 ` Alexis Ballier
2012-03-09 0:50 ` Walter Dnes
2012-03-18 7:23 ` Ralph Sennhauser
2012-03-18 11:18 ` Rich Freeman
2012-03-18 11:27 ` Ulrich Mueller
2012-04-12 19:53 ` [gentoo-dev] " Ulrich Mueller
2012-04-12 20:19 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120312083612.GF7579@localhost \
--to=ferringb@gmail.com \
--cc=gentoo-dev@lists.gentoo.org \
--cc=zmedico@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox