public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Harring <ferringb@gmail.com>
To: Walter Dnes <waltdnes@waltdnes.org>
Cc: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFD : .ebuild is only bash
Date: Tue, 13 Mar 2012 18:42:31 -0700	[thread overview]
Message-ID: <20120314014231.GA7731@localhost> (raw)
In-Reply-To: <20120314002903.GA2872@waltdnes.org>

On Tue, Mar 13, 2012 at 08:29:03PM -0400, Walter Dnes wrote:
> On Tue, Mar 13, 2012 at 07:30:22AM +0000, Ciaran McCreesh wrote
> 
> > EAPI is special. You need to know EAPI to be able to get the rest of
> > the metadata.
> > 
> > > 2) Any potential ebuild processor that's incapable of looking for
> > > regex "^EAPI=" in a textfile, amd parsing the numbers that follow,
> > > has no business being used to process ebuilds.
> > 
> > That doesn't get you the EAPI.
> 
> On Tue, Mar 13, 2012 at 12:03:34AM -0700, Brian Harring wrote
> 
> > Perfectly valid, if stupid, bash:
> >
> > EAPI=3
> > EAPI=4
> >
> > Which is the PM to choose?  Because if your answer is "the first",
> > then you need to keep in mind that any following code (including
> > eclasses that test eapi) will be seeing the second during sourcing.
> > Nice little gotcha, that one.
> >
> > I'm aware people have suggested "make EAPI readonly" to try and deal
> > w/ this; that however means it'll break any PM that uses eval for
> > loading the ebuild, and means that every ebuild sourcing for phase
> > running will throw a complaint about EAPI being readonly.
> >
> > I don't hugely expect PMs to screw up the ordering of which to chose,
> > although it exists; trying to ban secondary settings is also an
> > approach... but all of it points to the fact it's a fricking hack and
> > isn't really worth doing.
> 
>   I'm answering Ciaran's and Brian's posts together, because the answer
> is the same for both... namely, we need a 2-pass processor, regardless
> of whether it's bash/perl/python/whatever.  Pass 1 checks for syntax
> errors and retrieves "special" variables, answering Ciaran's concern.
> Today, it's EAPI.  In future, there may be others.  Pass 2 does the
> build, assuming no errors detected in pass 1.

With respect, this statement carries no actual weight nor usefulness.  
PMs, by nature of dep resolution/building, already have that effective 
seperation.

The point of this whole discussion is how to get metadata out of the 
ebuild w/out excessive burdens on future formats.  This pass1/pass2 
doesn't address that at all, nor actually relevant to the discussion 
at hand.  Not trying to be a complete dick here, but you completely 
missed the points being discussed including actually responding to 
ciaran's point.

I suggest you grab the sources of whichever PM you use, and audit how 
it gets metadata- it would help for understanding and contributing to 
this discussion.  At the very least it would be useful having another 
person besides the Ulm/3 PM authors who actually are familiar w/ how 
this actually works at the core.


>   Under the heading of "syntax errors", I would include multiple EAPI
> declarations.  My response to Brian is that portage should not try to
> outguess or fix or override an obviously broken ebuild.  It should
> return an error message (in this case "Multiple EAPI declarations not
> allowed") and then halt.  It is the ebuild-writer's job to come up with
> a syntactically correct ebuild.

And it's the PMs responsibility to enforce the rules of the 
environment; there in is part of the problem- portage is generally 
pretty lax about any form of strictness there, and has historically 
been that way.  Even if one couldn't just point at portage, there 
still would be the problem of 3 different managers all needing to 
enforce the same tricky environment restrictions.

Leaving it such that the PM has to enforce things like "don't have 
multiple EAPI assignments" means by default, one of them isn't going 
to... leading to the ebuilds breaking... specifically the common case 
being the ebuild becoming acclimated to some quirk of portage.  EAPI 
was started to try and address that sensitivity (including rolling out 
new features), and the literal history of EAPI has involved dealing w/ 
quirks of portages past behaviour- including pre EAPI0.

Generally speaking, the less ways something can be screwed up means 
less ways something *will* be screwed up.

My point was that this can be pretty easily screwed up, and isn't as 
simple to enforce as people seem to think- that's not counting just 
flat out issues w/ the actual usage of it.

~brian



  parent reply	other threads:[~2012-03-14  1:43 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAATnKFD=9VEkpUcABbhHbAu96Qn+dP+YEuUu2YCqDUNKUxe+Cw@mail.gmail.com>
2012-03-12 15:57 ` [gentoo-dev] RFD : .ebuild is only bash Kent Fredric
2012-03-12 15:59   ` Ciaran McCreesh
2012-03-12 16:51     ` Rich Freeman
2012-03-12 17:05       ` Ulrich Mueller
2012-03-12 17:12         ` Ciaran McCreesh
2012-03-12 17:17           ` Michael Orlitzky
2012-03-12 17:22             ` Ciaran McCreesh
2012-03-12 17:30             ` Zac Medico
2012-03-12 17:22           ` Zac Medico
2012-03-12 18:00             ` Ulrich Mueller
2012-03-12 18:04               ` Ciaran McCreesh
2012-03-12 18:17                 ` Ulrich Mueller
2012-03-12 18:28                   ` Ciaran McCreesh
2012-03-12 18:50                     ` Ulrich Mueller
2012-03-12 18:58                       ` Ian Stakenvicius
2012-03-12 19:01                         ` Ciaran McCreesh
2012-03-12 19:49                           ` Ulrich Mueller
2012-03-12 20:10                             ` Ciaran McCreesh
2012-03-12 20:21                               ` James Broadhead
2012-03-12 21:14                                 ` Ulrich Mueller
2012-03-12 21:28                                   ` Kent Fredric
2012-03-12 21:49                                     ` Alec Warner
2012-03-12 22:02                                       ` Mike Gilbert
2012-03-12 22:37                                         ` Kent Fredric
2012-03-12 22:53                                           ` Alec Warner
2012-03-13  6:31                                             ` [gentoo-dev] " Duncan
2012-03-12 22:55                                           ` [gentoo-dev] " James Broadhead
2012-03-13  6:06                                       ` Ulrich Mueller
2012-03-12 22:06                                   ` James Broadhead
2012-03-12 22:17                                     ` Alec Warner
2012-03-12 19:00                       ` Ciaran McCreesh
2012-03-12 19:38                         ` Ulrich Mueller
2012-03-12 19:42                           ` Ciaran McCreesh
2012-03-13 20:33                       ` Brian Harring
2012-03-13  0:51                     ` Patrick Lauer
2012-03-12 18:29                   ` Kent Fredric
2012-03-13  4:31                   ` Brian Harring
2012-03-13  5:14                     ` Kent Fredric
2012-03-13  6:22                       ` Brian Harring
2012-03-13 16:10                         ` Wulf C. Krueger
2012-03-13 19:08                           ` Brian Harring
2012-03-13  7:11                       ` [gentoo-dev] " Duncan
2012-03-12 18:01             ` [gentoo-dev] " Michał Górny
2012-03-12 17:53           ` Ulrich Mueller
2012-03-12 18:03             ` Kent Fredric
2012-03-13  0:46           ` Patrick Lauer
2012-03-13  6:41           ` Walter Dnes
2012-03-13  6:56             ` Kent Fredric
2012-03-13  7:03             ` Brian Harring
2012-03-13  8:50               ` Ulrich Mueller
2012-03-13 15:52               ` Zac Medico
2012-03-13  7:30             ` Ciaran McCreesh
2012-03-14  0:29               ` Walter Dnes
2012-03-14  0:48                 ` Michael Orlitzky
2012-03-14  1:42                 ` Brian Harring [this message]
2012-03-14  2:05                   ` Zac Medico
2012-03-14  2:23                     ` Michael Orlitzky
2012-03-14  2:36                       ` Zac Medico
2012-03-14  2:38                         ` Michael Orlitzky
2012-03-14  2:38                     ` Brian Harring
2012-03-14  2:47                       ` Zac Medico
2012-03-12 16:56   ` Ulrich Mueller
2012-03-12 18:04   ` Michał Górny
2012-03-13  6:29   ` Richard Yao
2012-03-13 11:52     ` Rich Freeman

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=20120314014231.GA7731@localhost \
    --to=ferringb@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=waltdnes@waltdnes.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