Discussion:
[Scons-users] Getting build action details
Nacho Piqueras
2018-04-10 06:05:20 UTC
Permalink
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?

Best regards!
Bill Deegan
2018-04-10 13:58:02 UTC
Permalink
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.
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-04-10 13:58:17 UTC
Permalink
Also, can you paste an small example.
Post by Bill Deegan
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.
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Mats Wichmann
2018-04-10 20:36:51 UTC
Permalink
Post by Bill Deegan
Also, can you paste an small example.
Post by Bill Deegan
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.
Post by Nacho Piqueras
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.)
Bill Deegan
2018-04-10 21:07:56 UTC
Permalink
Mats,

It can actually be more than just the Environment()'s and their clones
depending what additional flags you pass to each builder.

env.Program(target,source, CPPPATH=['my','special','paths'])

Will create an OverrideEnvironment() which is a lightweight shell over a
regular Environment which overrides specific variables.

So to get the correct Subst() expansion you'd need the OverrideEnvironment.
If you knew that no variables were set in the OE when the builder was
called, then env.Subst() would be sufficient.
Post by Nacho Piqueras
Post by Bill Deegan
Also, can you paste an small example.
Post by Bill Deegan
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
Post by Bill Deegan
Post by Bill Deegan
have tried already.
Post by Nacho Piqueras
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
Post by Bill Deegan
Post by Bill Deegan
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Bill Deegan
Post by Bill Deegan
Post by Nacho Piqueras
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.)
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Nacho Piqueras
2018-04-11 06:04:08 UTC
Permalink
Thanks Bill, I will try to explain the rationale.

My project contain several SConscripts in different directories
(components) beneath the SConstruct. Each SConscript tells SCons how to
build object files for that component.

The environment in each component is a clone of the original environment,
which loads the tools for that project and sets project-width compiler
settings (might be overridden in each SConscript!).

After loading all SConscripts I got a list with all objects to be built.
Then I call Program to generate the binary file in the SConstruct file.

The question is: I want to run a static analyzer on each source file. To be
run, the static analyzer needs to be passed some compiler-alike
information: defined symbols and include search path. I do not want to
modify any SConscript, but to do that in the SConstruct file. I though I
could do it getting the info from the Object nodes to be built, as
explained in my original message.

An example containing only one component called "foo":

+ SConstruct
+ inc
- types.h
+ foo
- foo.sconscript
- foo.c
+ inc
- foo.h

if `foo.sconscript` contains:

Import('env')
env.Object('foo.c', CPPPATH=["#inc", "inc"])

then foo.o is built correctly with CPPPATH (assuming default settings)
"-Iinc -Ifoo/inc"

but if in the SConstruct I use the overriden CPPPATH (as got from the File
node object) as construction variable in the command line generator for the
action that runs the static analyzer, then the resulting command line is:

"-Iinc -Iinc"

which obviously I do not want.

Best regards!
Send Scons-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."
1. Getting build action details (Nacho Piqueras)
2. Re: Getting build action details (Bill Deegan)
3. Re: Getting build action details (Bill Deegan)
4. Re: Fortran dependency in a higher directory (GUEZ Lionel)
5. Re: Getting build action details (Mats Wichmann)
----------------------------------------------------------------------
Message: 1
Date: Tue, 10 Apr 2018 08:05:20 +0200
Subject: [Scons-users] Getting build action details
mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
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?
Best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20180410/c6e72ff9/attachment-0001.html>
------------------------------
Message: 2
Date: Tue, 10 Apr 2018 09:58:02 -0400
Subject: Re: [Scons-users] Getting build action details
<CAEyG4CEegB+axS2ih_JxUWuguBiZ-KpM9xOvSEv_+
Content-Type: text/plain; charset="utf-8"
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.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20180410/b9d58c96/attachment-0001.html>
------------------------------
Message: 3
Date: Tue, 10 Apr 2018 09:58:17 -0400
Subject: Re: [Scons-users] Getting build action details
gmail.com>
Content-Type: text/plain; charset="utf-8"
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20180410/c0aea79f/attachment-0001.html>
------------------------------
Message: 4
Date: Tue, 10 Apr 2018 17:53:48 +0200
Subject: Re: [Scons-users] Fortran dependency in a higher directory
Content-Type: text/plain; charset=UTF-8
On Mon, 9 Apr 2018 10:48:40 -0400
Post by Nacho Piqueras
It's been a LONG time since I've worked with fortran.
I'm pointing you at the variables listed in the docs for you to
figure it out yourself.
I'm not in anyway contradicting what's in the docs..
I am not ignoring what you say: I read the description of all
Fortran variables in the doc (and I read the SCons 3.0.1 user guide
completely down to chapter 15).
I will try to be more precise. It is ambiguous to refer to "module
files". "Module file" could mean a compiled module interface (with
usually a .mod suffix) or it could mean a source Fortran file
containing one or more modules. The compilation system must be able to
search for compiled module interfaces (.mod files) in a set of
directories, without corresponding source files: this happens when a
program uses a Fortran library. And the compilation system must be able
to search for source module files, to be compiled, in another set of
directories, in order to figure out the order of compilation.
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) module files."
I guess that, here, "module files" means compiled module interfaces. So
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) compiled module interfaces
(files with suffix $FORTRANMODSUFFIX)."
"The Fortran implicit dependency scanner will search these directories
for include files (but not module files since they are autogenerated
and, as such, may not actually exist at the time the scan takes place)."
Here I guess that "module files" also means compiled module interfaces.
But there misses the information that the dependency scanner
WILL search these directories for source module files.
"The Fortran implicit dependency scanner will search these directories
for include files and source module files (but not compiled module
interfaces (files with suffix $FORTRANMODSUFFIX) since they are
autogenerated and, as such, may not actually exist at the time the scan
takes place)."
--
Lionel GUEZ
Laboratoire de m?t?orologie dynamique
?cole normale sup?rieure
24 rue Lhomond
75005 Paris
------------------------------
Message: 5
Date: Tue, 10 Apr 2018 14:36:51 -0600
Subject: Re: [Scons-users] Getting build action details
Content-Type: text/plain; charset=utf-8
Post by Nacho Piqueras
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
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.)
------------------------------
Subject: Digest Footer
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
End of Scons-users Digest, Vol 77, Issue 4
******************************************
Bill Deegan
2018-04-11 14:44:34 UTC
Permalink
Are you trying to run the clang static analyzer and want the json file it
reads?
Post by Nacho Piqueras
Thanks Bill, I will try to explain the rationale.
My project contain several SConscripts in different directories
(components) beneath the SConstruct. Each SConscript tells SCons how to
build object files for that component.
The environment in each component is a clone of the original environment,
which loads the tools for that project and sets project-width compiler
settings (might be overridden in each SConscript!).
After loading all SConscripts I got a list with all objects to be built.
Then I call Program to generate the binary file in the SConstruct file.
The question is: I want to run a static analyzer on each source file. To
be run, the static analyzer needs to be passed some compiler-alike
information: defined symbols and include search path. I do not want to
modify any SConscript, but to do that in the SConstruct file. I though I
could do it getting the info from the Object nodes to be built, as
explained in my original message.
+ SConstruct
+ inc
- types.h
+ foo
- foo.sconscript
- foo.c
+ inc
- foo.h
Import('env')
env.Object('foo.c', CPPPATH=["#inc", "inc"])
then foo.o is built correctly with CPPPATH (assuming default settings)
"-Iinc -Ifoo/inc"
but if in the SConstruct I use the overriden CPPPATH (as got from the File
node object) as construction variable in the command line generator for the
"-Iinc -Iinc"
which obviously I do not want.
Best regards!
Send Scons-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."
1. Getting build action details (Nacho Piqueras)
2. Re: Getting build action details (Bill Deegan)
3. Re: Getting build action details (Bill Deegan)
4. Re: Fortran dependency in a higher directory (GUEZ Lionel)
5. Re: Getting build action details (Mats Wichmann)
----------------------------------------------------------------------
Message: 1
Date: Tue, 10 Apr 2018 08:05:20 +0200
Subject: [Scons-users] Getting build action details
gmail.com>
Content-Type: text/plain; charset="utf-8"
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?
Best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/c6e72ff9/attachment-0001.html>
------------------------------
Message: 2
Date: Tue, 10 Apr 2018 09:58:02 -0400
Subject: Re: [Scons-users] Getting build action details
gmail.com>
Content-Type: text/plain; charset="utf-8"
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.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/b9d58c96/attachment-0001.html>
------------------------------
Message: 3
Date: Tue, 10 Apr 2018 09:58:17 -0400
Subject: Re: [Scons-users] Getting build action details
ail.com>
Content-Type: text/plain; charset="utf-8"
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/c0aea79f/attachment-0001.html>
------------------------------
Message: 4
Date: Tue, 10 Apr 2018 17:53:48 +0200
Subject: Re: [Scons-users] Fortran dependency in a higher directory
Content-Type: text/plain; charset=UTF-8
On Mon, 9 Apr 2018 10:48:40 -0400
Post by Nacho Piqueras
It's been a LONG time since I've worked with fortran.
I'm pointing you at the variables listed in the docs for you to
figure it out yourself.
I'm not in anyway contradicting what's in the docs..
I am not ignoring what you say: I read the description of all
Fortran variables in the doc (and I read the SCons 3.0.1 user guide
completely down to chapter 15).
I will try to be more precise. It is ambiguous to refer to "module
files". "Module file" could mean a compiled module interface (with
usually a .mod suffix) or it could mean a source Fortran file
containing one or more modules. The compilation system must be able to
search for compiled module interfaces (.mod files) in a set of
directories, without corresponding source files: this happens when a
program uses a Fortran library. And the compilation system must be able
to search for source module files, to be compiled, in another set of
directories, in order to figure out the order of compilation.
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) module files."
I guess that, here, "module files" means compiled module interfaces. So
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) compiled module interfaces
(files with suffix $FORTRANMODSUFFIX)."
"The Fortran implicit dependency scanner will search these directories
for include files (but not module files since they are autogenerated
and, as such, may not actually exist at the time the scan takes place)."
Here I guess that "module files" also means compiled module interfaces.
But there misses the information that the dependency scanner
WILL search these directories for source module files.
"The Fortran implicit dependency scanner will search these directories
for include files and source module files (but not compiled module
interfaces (files with suffix $FORTRANMODSUFFIX) since they are
autogenerated and, as such, may not actually exist at the time the scan
takes place)."
--
Lionel GUEZ
Laboratoire de m?t?orologie dynamique
?cole normale sup?rieure
24 rue Lhomond
75005 Paris
------------------------------
Message: 5
Date: Tue, 10 Apr 2018 14:36:51 -0600
Subject: Re: [Scons-users] Getting build action details
Content-Type: text/plain; charset=utf-8
Post by Nacho Piqueras
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
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.)
------------------------------
Subject: Digest Footer
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
End of Scons-users Digest, Vol 77, Issue 4
******************************************
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Nacho Piqueras
2018-04-12 11:00:34 UTC
Permalink
"Are you trying to run the clang static analyzer and want the json file it
reads? "

No, it is another static analyzer.

Following my previous example, I would expect to execute something like
this:

(imagine foo.sconscript executes env.Object('foo.c', CPPPATH=["#inc",
"inc"], CPPDEFINES=[' ENABLE_FLAG1'])

linter.exe [linter flags] -DENABLE_FLAG1 -Iinc -Ifoo/inc foo/foo.c

So i need to obtain CPPDEFINES and CPPPATH information for each object
file, because, as I said, they might be overriden in each sconscript.

For the CPPPATH the problem reading the info from the overriden environment
is that it contains relative paths to the sconscript (foo/foo.sconscript)
which are resolved as relative to the sconstruct when the action is
executed. So I end up executing something like:

linter.exe [linter flags] -DENABLE_FLAG1 -Iinc -Iinc foo/foo.c

SCons knows how to build the object files resolving correctly the CPPPATH
even executing from the SConstruct path, and I thought I could get the
information from the File node representing the Object and the executor,
but I do not know how to do it.

Best regards,
Send Scons-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."
1. Re: Getting build action details (Bill Deegan)
----------------------------------------------------------------------
Message: 1
Date: Wed, 11 Apr 2018 10:44:34 -0400
Subject: Re: [Scons-users] Getting build action details
<CAEyG4CF0S7_ftcQVwxm8gUXdVTQVjJr8GHnkDz2Q=
Content-Type: text/plain; charset="utf-8"
Are you trying to run the clang static analyzer and want the json file it
reads?
Post by Nacho Piqueras
Thanks Bill, I will try to explain the rationale.
My project contain several SConscripts in different directories
(components) beneath the SConstruct. Each SConscript tells SCons how to
build object files for that component.
The environment in each component is a clone of the original environment,
which loads the tools for that project and sets project-width compiler
settings (might be overridden in each SConscript!).
After loading all SConscripts I got a list with all objects to be built.
Then I call Program to generate the binary file in the SConstruct file.
The question is: I want to run a static analyzer on each source file. To
be run, the static analyzer needs to be passed some compiler-alike
information: defined symbols and include search path. I do not want to
modify any SConscript, but to do that in the SConstruct file. I though I
could do it getting the info from the Object nodes to be built, as
explained in my original message.
+ SConstruct
+ inc
- types.h
+ foo
- foo.sconscript
- foo.c
+ inc
- foo.h
Import('env')
env.Object('foo.c', CPPPATH=["#inc", "inc"])
then foo.o is built correctly with CPPPATH (assuming default settings)
"-Iinc -Ifoo/inc"
but if in the SConstruct I use the overriden CPPPATH (as got from the
File
Post by Nacho Piqueras
node object) as construction variable in the command line generator for
the
Post by Nacho Piqueras
"-Iinc -Iinc"
which obviously I do not want.
Best regards!
Send Scons-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."
1. Getting build action details (Nacho Piqueras)
2. Re: Getting build action details (Bill Deegan)
3. Re: Getting build action details (Bill Deegan)
4. Re: Fortran dependency in a higher directory (GUEZ Lionel)
5. Re: Getting build action details (Mats Wichmann)
----------------------------------------------------------------------
Message: 1
Date: Tue, 10 Apr 2018 08:05:20 +0200
Subject: [Scons-users] Getting build action details
gmail.com>
Content-Type: text/plain; charset="utf-8"
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
Post by Nacho Piqueras
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?
Best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/c6e72ff9/attachment-0001.html>
------------------------------
Message: 2
Date: Tue, 10 Apr 2018 09:58:02 -0400
Subject: Re: [Scons-users] Getting build action details
gmail.com>
Content-Type: text/plain; charset="utf-8"
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
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/b9d58c96/attachment-0001.html>
------------------------------
Message: 3
Date: Tue, 10 Apr 2018 09:58:17 -0400
Subject: Re: [Scons-users] Getting build action details
ail.com>
Content-Type: text/plain; charset="utf-8"
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
Hello,
Given a list a nodes representing object files built by SCons, I
would
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/c0aea79f/attachment-0001.html>
------------------------------
Message: 4
Date: Tue, 10 Apr 2018 17:53:48 +0200
Subject: Re: [Scons-users] Fortran dependency in a higher directory
Content-Type: text/plain; charset=UTF-8
On Mon, 9 Apr 2018 10:48:40 -0400
Post by Nacho Piqueras
It's been a LONG time since I've worked with fortran.
I'm pointing you at the variables listed in the docs for you to
figure it out yourself.
I'm not in anyway contradicting what's in the docs..
I am not ignoring what you say: I read the description of all
Fortran variables in the doc (and I read the SCons 3.0.1 user guide
completely down to chapter 15).
I will try to be more precise. It is ambiguous to refer to "module
files". "Module file" could mean a compiled module interface (with
usually a .mod suffix) or it could mean a source Fortran file
containing one or more modules. The compilation system must be able to
search for compiled module interfaces (.mod files) in a set of
directories, without corresponding source files: this happens when a
program uses a Fortran library. And the compilation system must be able
to search for source module files, to be compiled, in another set of
directories, in order to figure out the order of compilation.
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) module files."
I guess that, here, "module files" means compiled module interfaces. So
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) compiled module interfaces
(files with suffix $FORTRANMODSUFFIX)."
"The Fortran implicit dependency scanner will search these directories
for include files (but not module files since they are autogenerated
and, as such, may not actually exist at the time the scan takes place)."
Here I guess that "module files" also means compiled module interfaces.
But there misses the information that the dependency scanner
WILL search these directories for source module files.
"The Fortran implicit dependency scanner will search these directories
for include files and source module files (but not compiled module
interfaces (files with suffix $FORTRANMODSUFFIX) since they are
autogenerated and, as such, may not actually exist at the time the scan
takes place)."
--
Lionel GUEZ
Laboratoire de m?t?orologie dynamique
?cole normale sup?rieure
24 rue Lhomond
75005 Paris
------------------------------
Message: 5
Date: Tue, 10 Apr 2018 14:36:51 -0600
Subject: Re: [Scons-users] Getting build action details
Content-Type: text/plain; charset=utf-8
Post by Nacho Piqueras
Also, can you paste an small example.
On Tue, Apr 10, 2018 at 9:58 AM, Bill Deegan <
Post by Nacho Piqueras
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
Post by Nacho Piqueras
you
Post by Nacho Piqueras
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
Hello,
Given a list a nodes representing object files built by SCons, I
would
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
like to get the resolved $CPPPATH list for each one.
Inspecting each file object I can see they contain a reference to
the
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
executor object, and I tried using the overriden environment with
the
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
executor to subst the variable, but without luck.
Given that some entries in CPPPATH list contain '#', others are
absolute
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript
that
Post by Nacho Piqueras
told
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
SCons to generate that Object, I cannot find a way to easily get
that
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
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.)
------------------------------
Subject: Digest Footer
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
End of Scons-users Digest, Vol 77, Issue 4
******************************************
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20180411/5946dbdb/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
End of Scons-users Digest, Vol 77, Issue 7
******************************************
Matthew Marinets
2018-04-12 16:30:10 UTC
Permalink
If you want to get CPPDEFINES and CPPPATH from the overridden environment, you can just get SCons to print it out with a post action

someObject = env.Object('foo.c', CPPPATH=["#inc", "inc"], CPPDEFINES=[' ENABLE_FLAG1'])
someObject.AddPostAction( ‘echo CPPDEFINES: $CPPDEFINES’ )
someObject.AddPostAction( ‘echo CPPPATH: $CPPPATH’ )

That’s the approach I would use. If you want this information in a file, you can redirect the output to a file with >file.info in the command, or you could wrap this in a python function.
You could also look into the possibility of just adding this to the Object builder. The online documentation for the SCons Builder module ( http://scons.org/doc/HTML/scons-api/SCons.Builder-module.html ) says there’s an add_action() method, but I’m not sure if that would work like AddPostAction or if it would replace the action entirely.

Hope this helps

-Matthew


From: Scons-users <scons-users-***@scons.org> On Behalf Of Nacho Piqueras
Sent: April 12, 2018 04:01
To: scons-***@scons.org
Subject: Re: [Scons-users] Getting build action details

"Are you trying to run the clang static analyzer and want the json file it reads? "

No, it is another static analyzer.
Following my previous example, I would expect to execute something like this:
(imagine foo.sconscript executes env.Object('foo.c', CPPPATH=["#inc", "inc"], CPPDEFINES=[' ENABLE_FLAG1'])

linter.exe [linter flags] -DENABLE_FLAG1 -Iinc -Ifoo/inc foo/foo.c

So i need to obtain CPPDEFINES and CPPPATH information for each object file, because, as I said, they might be overriden in each sconscript.
For the CPPPATH the problem reading the info from the overriden environment is that it contains relative paths to the sconscript (foo/foo.sconscript) which are resolved as relative to the sconstruct when the action is executed. So I end up executing something like:

linter.exe [linter flags] -DENABLE_FLAG1 -Iinc -Iinc foo/foo.c
SCons knows how to build the object files resolving correctly the CPPPATH even executing from the SConstruct path, and I thought I could get the information from the File node representing the Object and the executor, but I do not know how to do it.
Best regards,

On Wed, Apr 11, 2018 at 4:44 PM, <scons-users-***@scons.org<mailto:scons-users-***@scons.org>> wrote:
Send Scons-users mailing list submissions to
scons-***@scons.org<mailto:scons-***@scons.org>

To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
scons-users-***@scons.org<mailto:scons-users-***@scons.org>

You can reach the person managing the list at
scons-users-***@scons.org<mailto:scons-users-***@scons.org>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."


Today's Topics:

1. Re: Getting build action details (Bill Deegan)


----------------------------------------------------------------------

Message: 1
Date: Wed, 11 Apr 2018 10:44:34 -0400
From: Bill Deegan <***@baddogconsulting.com<mailto:***@baddogconsulting.com>>
To: SCons users mailing list <scons-***@scons.org<mailto:scons-***@scons.org>>
Subject: Re: [Scons-users] Getting build action details
Message-ID:
<CAEyG4CF0S7_ftcQVwxm8gUXdVTQVjJr8GHnkDz2Q=***@mail.gmail.com<mailto:***@mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Are you trying to run the clang static analyzer and want the json file it
reads?
Post by Nacho Piqueras
Thanks Bill, I will try to explain the rationale.
My project contain several SConscripts in different directories
(components) beneath the SConstruct. Each SConscript tells SCons how to
build object files for that component.
The environment in each component is a clone of the original environment,
which loads the tools for that project and sets project-width compiler
settings (might be overridden in each SConscript!).
After loading all SConscripts I got a list with all objects to be built.
Then I call Program to generate the binary file in the SConstruct file.
The question is: I want to run a static analyzer on each source file. To
be run, the static analyzer needs to be passed some compiler-alike
information: defined symbols and include search path. I do not want to
modify any SConscript, but to do that in the SConstruct file. I though I
could do it getting the info from the Object nodes to be built, as
explained in my original message.
+ SConstruct
+ inc
- types.h
+ foo
- foo.sconscript
- foo.c
+ inc
- foo.h
Import('env')
env.Object('foo.c', CPPPATH=["#inc", "inc"])
then foo.o is built correctly with CPPPATH (assuming default settings)
"-Iinc -Ifoo/inc"
but if in the SConstruct I use the overriden CPPPATH (as got from the File
node object) as construction variable in the command line generator for the
"-Iinc -Iinc"
which obviously I do not want.
Best regards!
Send Scons-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."
1. Getting build action details (Nacho Piqueras)
2. Re: Getting build action details (Bill Deegan)
3. Re: Getting build action details (Bill Deegan)
4. Re: Fortran dependency in a higher directory (GUEZ Lionel)
5. Re: Getting build action details (Mats Wichmann)
----------------------------------------------------------------------
Message: 1
Date: Tue, 10 Apr 2018 08:05:20 +0200
Subject: [Scons-users] Getting build action details
Content-Type: text/plain; charset="utf-8"
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?
Best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/c6e72ff9/attachment-0001.html>
------------------------------
Message: 2
Date: Tue, 10 Apr 2018 09:58:02 -0400
Subject: Re: [Scons-users] Getting build action details
Content-Type: text/plain; charset="utf-8"
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.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/b9d58c96/attachment-0001.html>
------------------------------
Message: 3
Date: Tue, 10 Apr 2018 09:58:17 -0400
Subject: Re: [Scons-users] Getting build action details
ail.com<http://ail.com>>
Content-Type: text/plain; charset="utf-8"
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
Post by Nacho Piqueras
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?
Best regards!
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachment
s/20180410/c0aea79f/attachment-0001.html>
------------------------------
Message: 4
Date: Tue, 10 Apr 2018 17:53:48 +0200
Subject: Re: [Scons-users] Fortran dependency in a higher directory
Content-Type: text/plain; charset=UTF-8
On Mon, 9 Apr 2018 10:48:40 -0400
Post by Nacho Piqueras
It's been a LONG time since I've worked with fortran.
I'm pointing you at the variables listed in the docs for you to
figure it out yourself.
I'm not in anyway contradicting what's in the docs..
I am not ignoring what you say: I read the description of all
Fortran variables in the doc (and I read the SCons 3.0.1 user guide
completely down to chapter 15).
I will try to be more precise. It is ambiguous to refer to "module
files". "Module file" could mean a compiled module interface (with
usually a .mod suffix) or it could mean a source Fortran file
containing one or more modules. The compilation system must be able to
search for compiled module interfaces (.mod files) in a set of
directories, without corresponding source files: this happens when a
program uses a Fortran library. And the compilation system must be able
to search for source module files, to be compiled, in another set of
directories, in order to figure out the order of compilation.
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) module files."
I guess that, here, "module files" means compiled module interfaces. So
"The list of directories that the Fortran compiler will search for
include files and (for some compilers) compiled module interfaces
(files with suffix $FORTRANMODSUFFIX)."
"The Fortran implicit dependency scanner will search these directories
for include files (but not module files since they are autogenerated
and, as such, may not actually exist at the time the scan takes place)."
Here I guess that "module files" also means compiled module interfaces.
But there misses the information that the dependency scanner
WILL search these directories for source module files.
"The Fortran implicit dependency scanner will search these directories
for include files and source module files (but not compiled module
interfaces (files with suffix $FORTRANMODSUFFIX) since they are
autogenerated and, as such, may not actually exist at the time the scan
takes place)."
--
Lionel GUEZ
Laboratoire de m?t?orologie dynamique
?cole normale sup?rieure
24 rue Lhomond
75005 Paris
------------------------------
Message: 5
Date: Tue, 10 Apr 2018 14:36:51 -0600
Subject: Re: [Scons-users] Getting build action details
Content-Type: text/plain; charset=utf-8
Post by Nacho Piqueras
Also, can you paste an small example.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
have tried already.
Post by Nacho Piqueras
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
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
paths and others are relative to the directory of the sconscript that
told
Post by Nacho Piqueras
Post by Nacho Piqueras
Post by Nacho Piqueras
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.)
------------------------------
Subject: Digest Footer
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
End of Scons-users Digest, Vol 77, Issue 4
******************************************
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180411/5946dbdb/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Scons-users mailing list
Scons-***@scons.org<mailto:Scons-***@scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users


------------------------------

End of Scons-users Digest, Vol 77, Issue 7
******************************************

Loading...