[Scons-dev] SConstruct processing order

anatoly techtonik techtonik at gmail.com
Mon Dec 3 15:27:32 EST 2012


On Mon, Dec 3, 2012 at 10:16 PM, Gary Oberbrunner <garyo at oberbrunner.com>wrote:


> The problem is there's a difference between

>

> env['CXXFLAGS'] = '-initialflags' # in the tool

> env.Append('CXXFLAGS'='-xyz') # user specifies this, giving -initialflags

> -xyz

>

> and this:

> env.Append('CXXFLAGS'='-xyz') # user specifies this

> env['CXXFLAGS'] = '-initialflags' # in the tool, later

>

> Even if the tool appends to existing flags, it'll sometimes be wrong. But

> the worst case is people often assume the tool has set things up and check

> vars which are supposed to be set by the tool, e.g. MSVC_VERSION. If you

> can't check those (because they haven't been set up yet due to lazy tool

> initialization) then it makes existing scripts fail -- with no clear way to

> help fix them.

>


In this case they need to specify which tool they want to use beforehand.
If SCons can lookup how contributes MSVC_VERSION and ask that tool to
initialize during the check, then the problem is solved. Will this work?



> BTW, I like your idea about which tool created a variable -- and on a

> similar topic I've always wanted a (file,line-number) reference attached to

> a node saying where each target is created.

>


Then it should be recorded in some kind of roadmap. Right now it has all
chances to get lost. I want to catch the moment when a Node
is created too. Can we signal somehow when a Node is created?

Usually it is made using events, but I am against async complexity in Trac
code. I'd prefer a callback function passed to Node constructor. Maybe a
list of callback functions which want to be called at this point. If
somebody knows Trac or Eclipse code, it is basically an ExtensionPoint.

If we are going to implement such thing, then it should be good if all such
things are grepable and we can control when callbacks are assigned and
removed, because it adds additional layer of complexity, especially if
people start to manipulate state with these callbacks. From the other side,
overarchitecturing upfront can stop some great things from being happen. )
--
anatoly t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20121203/41b4f3a8/attachment.html>


More information about the Scons-dev mailing list