[Scons-users] env.command fails on mingw shell

Evan Driscoll driscoll at cs.wisc.edu
Thu Oct 25 18:28:57 EDT 2012


On 10/25/2012 05:20 PM, Kraus Philipp wrote:

> I posted the last 3 answer in one

>

> I run this Scons code

>

> import os

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

> env.Command("test", "", "ls;") # ls; and ls ; are the same

>

> and get

>

> Administrator at win7mingw /c/Users/Administrator/Documents

> $ scons

> scons: Reading SConscript files ...

> scons: done reading SConscript files.

> scons: Building targets ...

> ls;

> ls: ;: No such file or directory

> scons: *** [test] Error 2

> scons: building terminated because of errors.


Bmitry Mikhin already explained that: scons is executing "ls;" through
cmd.exe, because that's the value of env["SHELL"]. (Note: not
os.environ["SHELL"]).


Theoretically you could get it to use the MinGW shell by setting
env["SHELL"] = env.WhereIs("bash")
or whatever, but this won't actually work: SCons will try to run
bash /C ls
instead of
bash -c ls
because /C is what cmd uses. I'm not sure how to fix this -- any
suggestions?


Evan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20121025/299512f5/attachment.pgp>


More information about the Scons-users mailing list