[Scons-dev] SConstruct processing order
anatoly techtonik
techtonik at gmail.com
Mon Dec 3 15:43:31 EST 2012
On Mon, Nov 26, 2012 at 8:25 PM, Evan Driscoll <driscoll at cs.wisc.edu> wrote:
> 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.
>
That's not good. =) I thought it should work this way. Does multiple tools
provide the same Program() builder? And who wins if both are present? And
if I want to adjust the order? And how can I add my rules? And is this
documented?
I imagined that for every documented *core* SCons builder like Program()
there is a list of alternatives tools, who challenge over the right to be
executed and "Hey, MSVS isn't present" is just what happens behind the
scene. But you say it is not the case and every tool just pushes its own
builder. And who wins if multiple tools push the same Program() into
environment?
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.
DefaultEnvironment(tools=[]) fixes warning, but it still happens with
empty SConstruct.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20121203/22278f8a/attachment-0001.html>
More information about the Scons-dev
mailing list