Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
Date: Fri, 23 Mar 2012 18:18:37
Message-Id: CAAr7Pr91B+S31r-wnzUm6OjJA3XCx9rnwYF3y7QAMtdW5e3H-g@mail.gmail.com
In Reply to: Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages. by Alexandre Rostovtsev
1 On Fri, Mar 23, 2012 at 10:09 AM, Alexandre Rostovtsev
2 <tetromino@g.o> wrote:
3 > On Fri, 2012-03-23 at 12:50 -0400, Mike Gilbert wrote:
4 >> On Fri, Mar 23, 2012 at 12:02 PM, Ciaran McCreesh
5 >> <ciaran.mccreesh@××××××××××.com> wrote:
6 >> > On Fri, 23 Mar 2012 11:58:47 -0400
7 >> > Mike Gilbert <floppym@g.o> wrote:
8 >> >> > oasis_src_compile() {
9 >> >> >     oasis_src_compile_no_doc
10 >> >> >     if has doc ${IUSE} && use doc; then
11 >> >> >             ocaml setup.ml -doc || die
12 >> >> >     fi
13 >> >> > }
14 >> >>
15 >> >> This should probably call use_if_iuse from eutils.eclass, which
16 >> >> handles IUSE="[+-]doc".
17 >> >
18 >> > Actually, neither way works. The spec says:
19 >> >
20 >> >    Global variables must only contain invariant values
21 >> >    (see~\ref{sec:metadata-invariance}). If a global variable's value is
22 >> >    invariant, it may have the value that would be generated at any
23 >> >    given point in the build sequence.
24 >> >
25 >> > So you can't rely upon IUSE having the "merged" value in an eclass.
26 >> >
27 >>
28 >> use_if_iuse is called from functions in several eclasses already in
29 >> the tree. See chromium, kde4-base, qt4-build, and toolchain.
30 >>
31 >> Are all of these usages incorrect? Do you have an alternate solution?
32 >
33 > By my count, there are already at least 19 eclasses in the tree that
34 > access an ebuild's IUSE from eclass code (autotools-utils, chromium,
35 > clutter, db, enlightenment, eutils, gnome2, gnome-python-common,
36 > java-ant-2, java-pkg-2, java-utils-2, mozconfig-3, pam, qt4-build,
37 > qt4-r2, ruby-ng, xfconf, x-modular, and xorg-2).
38
39 Lets be clear here. Just because we do already it does not mean we
40 should keep doing it.
41
42 In general if you are going to say 'this usage is wrong' then you need
43 some kind of tool to detect and report on it; otherwise a subset of
44 developers will get it wrong. Don't make it easy to do the wrong
45 thing, make it easy to do the right thing.
46
47 -A
48
49 >
50 > -Alexandre Rostovtsev.
51 >
52 >

Replies

Subject Author
Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages. Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>