Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: "Michał Górny" <gentoo@××××××××××.pl>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass: scons.eclass
Date: Mon, 23 Aug 2010 23:24:38
Message-Id: 201008231927.22830.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] New eclass: scons.eclass by "Michał Górny"
1 On Monday, August 23, 2010 19:02:21 Michał Górny wrote:
2 > On Mon, 23 Aug 2010 16:22:35 -0400 Mike Frysinger wrote:
3 > > On Monday, August 23, 2010 13:16:38 Michał Górny wrote:
4 > > > On Mon, 23 Aug 2010 12:39:50 -0400 Mike Frysinger wrote:
5 > > > > i'm not sure caching the value and using it in between runs is a
6 > > > > good idea. unless you also cache the thing you're caching and
7 > > > > compare it to make sure your cache is no longer invalid.
8 > > > >
9 > > > > i.e. export _SCONSOPTS_MAKEOPTS=${MAKEOPTS}, and then on every
10 > > > > escons invocation, make sure ${MAKEOPTS} hasnt changed in which
11 > > > > case you need to regenerate it. or just avoid the cache
12 > > > > altogether and leave SCONSOPTS as a hook specific to scons.
13 > > >
14 > > > Can do, though I don't see a reason why anyone would mangle
15 > > > MAKEOPTS in a middle of an ebuild using SCons.
16 > >
17 > > i agree, but you might as have it work properly in all cases instead
18 > > of flaking out randomly on ebuild authors.
19 >
20 > We're hitting another corner case then. What if user modifies SCONSOPTS
21 > in the middle of an ebuild? We could export another variable keeping
22 > resulting SCONSOPTS and comparing it with the current SCONSOPTS -- but
23 > what if the ebuild author randomly hit the same flags that resulted
24 > from MAKEOPTS->SCONSOPTS conversion (and changed MAKEOPTS at the same
25 > time)?
26 >
27 > If we consider it like that, we end up with the idea that re-generating
28 > SCONSOPTS every time escons() is called is the only feasible solution
29 > -- but I don't really think it is worth to waste the time considering
30 > it.
31
32 then keep it simple and separate:
33 escons() {
34 debug-print-function ${FUNCNAME} "${@}"
35
36 set -- scons $(scons_clean_makeopts) ${SCONSOPTS} ${EXTRA_ESCONS} "${@}"
37 echo "${@}" >&2
38 "${@}"
39 }
40
41 now you dont have to worry about changes between invocations and the developer
42 has a clear path -- if they need to force a serial build for example, they can
43 either append MAKEOPTS, SCONSOPTS, or pass it straight to escons. no cache
44 confusion or desync between the vars.
45 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] New eclass: scons.eclass "Michał Górny" <gentoo@××××××××××.pl>