[Scons-users] env.Command and _process_ environment variables :-(
Pedro Larroy
pedro.larroy.lists at gmail.com
Tue Oct 16 14:19:15 EDT 2012
Hi
I reproduced with a minimal setup. I think it's a bug, see the
attached zip file. When executing run.bat the two environments
differ, the one that is displayed by show.py lacks VS11 related stuff
in the PATH.
https://www.dropbox.com/sh/h6c8w3wjnfw5z6i/tAEBi2eHuE/path.zip
Should I fill a ticket?
Pedro.
On Tue, Oct 16, 2012 at 7:46 PM, Pedro Larroy
<pedro.larroy.lists at gmail.com> wrote:
> Hi William
>
> Thanks a lot for your reply. I'm using Visual studio 2012, the problem
> only happens in VS2012 with Windows7. In windows 8 the path of the
> environment was propagated fine IIRC.
>
> I tried now with env = Environment(ENV={PATH: os.environ['PATH']})
> and it works, but before I was doing env = Environment(ENV=os.environ)
> hoping to export the full env and didn't work
>
> I'm creating the environment as:
>
> env = Environment(MSVS_ARCH='amd64', MSVC_VERSION='11.0', ENV={'PATH':
> os.envrion['PATH']})
>
> And as you say, compiling SConscript files is fine, as CL is found
> automatically, the only problem was when calling env.Command oddly
> enough.
>
> Pedro.
>
> On Tue, Oct 16, 2012 at 7:29 PM, William Deegan
> <bill at baddogconsulting.com> wrote:
>> Pedro,
>>
>> On Oct 16, 2012, at 8:13 AM, Pedro Larroy <pedro.larroy.lists at gmail.com> wrote:
>>
>>> Hi
>>>
>>> Is there a way to pass the process environment to env.Command target?
>>> I think the environment is not being passed correctly.
>>>
>>> I have an env.Command statement to build some artifacts. Before
>>> calling Scons I call vcvarsall.bat to set the environment variables
>>> that Visual Studio needs, PATH etc.
>>>
>>> This env.Command ends up calling Microsoft's "cl" compiler.
>>>
>>> The problem that I have is that "cl" is not found in the PATH, as when
>>> executing env.Command seems the environment variables are not being
>>> passed.
>>>
>>> I tried creating env with Environment(ENV=os.environ)
>>>
>>> When I call the Sconscript, os.environ has the correct environment.
>>> And when I call the env.Command target manually after setting
>>> vcvarsall.bat it works fine.
>>
>>
>> In general SCons should detect the location of your visual studio/VC install. so you shouldn't need to source the vcvarsall.bat.
>>
>> Which version of visual studio/VC/other are you using?
>> Which version of windows? (and is it 32 or 64bits)?
>>
>> Thanks,
>> Bill
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> http://four.pairlist.net/mailman/listinfo/scons-users
More information about the Scons-users
mailing list