[Scons-users] environment variables

Gary Oberbrunner garyo at oberbrunner.com
Thu Jul 10 11:12:48 EDT 2014


On Thu, Jul 10, 2014 at 10:17 AM, Keith Brown <keith6014 at gmail.com> wrote:

> I would like all my tasks (shell scripts and octave and r scripts)to
> inherit a few environment variables what is the best way to acheive this?
>

Hi Keith.  The shell environment for commands run by SCons comes from
env['ENV'].  Whatever is in there is what they'll get.
You can populate that any way you like; by default it doesn't pass through
the user's shell environment, because that easily leads to non-reproducible
builds.  However it's easy to pass through the shell env or any part of it
if you want to: right up at the top of the man page it shows how, for
instance, to pass through $PATH:

import os
env = Environment(ENV = {'PATH' : os.environ['PATH']})

or the whole env:

import os
env = Environment(ENV = os.environ)

-- 
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140710/8d3f080a/attachment-0001.html>


More information about the Scons-users mailing list