[Scons-dev] SConstruct processing order

Evan Driscoll driscoll at cs.wisc.edu
Mon Nov 26 12:25:52 EST 2012


On 11/26/2012 11:07 AM, anatoly techtonik wrote:

> On Fri, Nov 23, 2012 at 12:47 AM, William Deegan

> <bill at baddogconsulting.com <mailto:bill at baddogconsulting.com>> wrote:

>> Should the Tools do their checks after they are actually used in

>> dependency tree?

>

> By "should" do you mean "the current could will do this", or do you

> mean "it would be better to change scons to do it this way"?

>

>

> The latter, actually. I prefer to use MinGW on Windows, but I can't

> understand SCons initialization logic. Is there a reason that it tries

> to push as much as possible to the default environment?


It's basically just the way things work. For instance, you suggest that
SCons should wait until the tool is used to detect it: but it CAN'T
really wait until you use "Program()" (or Object() or whatever) to
detect Visual Studio, because by then it's too late -- the Program()
(etc.) builder is added by the Visual Studio tool, which figures out
what builders to add in the first place based on what it detects!

You could, I guess, have it speculatively register the Program() builder
and, when it's called, do the detection and if VS isn't present throw
some kind of error, but without a bunch of infrastructure changes that
would allow it to say "Hey, MSVS isn't present, try MinGW", that
situation basically be the same as the current one.


You said that it was trying to detect VS even with an SConstruct; this
surprises me, as I thought that the default environment wasn't created
until it was actually used. If you didn't say that, I'd say you should
be able to write
DefaultEnvironment(tools=[])
at the start of your SConstruct and that would stop it from doing
detection of MSVS. (Or you could pass tools=["mingw"] or whatever you
need.) But if you're seeing that happen even with an empty SConstruct, I
don't have any ideas.

Evan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
Url : <http://two.pairlist.net/pipermail/scons-dev/attachments/20121126/dfe91654/attachment.pgp>


More information about the Scons-dev mailing list