[Scons-users] scons and module files

Bill Deegan bill at baddogconsulting.com
Mon Mar 14 17:55:23 EDT 2016


Certainly you could setup a builder to initialize your path/environment
variables via the module load,etc to get the shell the way you want and
then get the paths into SCons.

If you did that, then you'd want to make sure you initialized your
Environment(tools=[]), and manually added each tool you wanted after
running all the module commands and capturing that environment.

That said, it seems much simpler to just wrap your scons run with the
module commands in a script., and then use Environment(ENV=os.environ).
I suppose you could also fire up a shell in your SConstruct or other scons
scripts build the environemnt you want, capture the output of running set
or env depending on what platform you're on and then filter those as you
see fit and provide those to Environment(ENV=my_filtered_env).

It really depends how careful you want to be about the environment you
provide to SCons to initialize it's builders with.

-Bill


On Mon, Mar 14, 2016 at 5:02 PM, John Robinson <jsrobin at gmail.com> wrote:

> What is the appropriate manner to use SCons in the context of a "module"
> environment (http://modules.sourceforge.net/).
>
> I know that one strategy is to just initialize the SConstruct environment
> with the command:
> env = Environment(ENV = os.environ)
> after loading the appropriate module files.
>
> Naturally, this kills the "Environment independent" build feature of
> SCons. In particular, the "builder" may have almost any type of "overrides"
> occurring in his Linux startup environment after the modules have been
> loaded.
>
> Is it possible for a SConstruct file to start off by "sourcing" "module
> load" and "module unload" commands and then continuing execution with a
> repeatable "os.environ".
>
> Alternatively, is there an easy for for SConstruct to create a subshell
> initialized with the selected module commands, and then invoke an
> appropriate "SConstruct" to continue the build.
>
>
> Any and all comments and help would be appreciated on this issue.
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160314/ccff9b11/attachment.html>


More information about the Scons-users mailing list