[Scons-users] Getting build action details

Mats Wichmann mats at wichmann.us
Tue Apr 10 16:36:51 EDT 2018

On 04/10/2018 07:58 AM, Bill Deegan wrote:
> Also, can you paste an small example.
> On Tue, Apr 10, 2018 at 9:58 AM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
>> Can you explain what you are trying to do?
>> (Why do you want to do this?)
>> That may point out other ways to accomplish what you need than the way you
>> have tried already.
>> On Tue, Apr 10, 2018 at 2:05 AM, Nacho Piqueras <natxo.piq at gmail.com>
>> wrote:
>>> Hello,
>>> Given a list a nodes representing object files built by SCons, I would
>>> like to get the resolved $CPPPATH list for each one.
>>> Inspecting each file object I can see they contain a reference to the
>>> executor object, and I tried using the overriden environment with the
>>> executor to subst the variable, but without luck.
>>> Given that some entries in CPPPATH list contain '#', others are absolute
>>> paths and others are relative to the directory of the sconscript that told
>>> SCons to generate that Object, I cannot find a way to easily get that
>>> information.
>>> Is there something in the Subst module that I can use?

I have at times sought something slightly similar so I'll point out: I
may be misunderstanding but the settings you care about are not
per-node, but per-construction-environment.

If there's just one construction environment, Dump() it. Since all the
scripts are executed first, that is the environment are built up before
the targets are acted on, put this at the end of your SConstruct and you
know what each of the targets will be encountering as they build. You
certainly don't have to dump the whole environment if you are just
interested in one variable from it, just extract that one instead.

However, if there are many environments you would need to Dump at
suitable places for each one you care about. I know of no great answer
in this case.  [[this has driven me nuts in our project - just counted
again and there are 179 Clone() calls in this beast. sadly I can't wave
a magic wand and simplify this, I have to improve things piecemeal]]
This kind of edit-something-in-to-debug becomes painful if you have to
fiddle with a bunch of sconscripts, and doing it at the top, in the
SConstruct, is also problematic because it's not going to have the
context - it has no idea what environments have been created in the
things it has called (that may then have then called other things etc.)

More information about the Scons-users mailing list