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

Kraus Philipp philipp.kraus at flashpixx.de
Thu Oct 25 18:20:30 EDT 2012


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.

On this code:

import os
env = Environment(ENV = {'PATH' : os.environ["PATH"]})
env.Command("test", "", "ls")

I get:

Administrator at win7mingw /c/Users/Administrator/Documents
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
ls
SConstruct desktop.ini
scons: done building targets.

On Mingw I use as shell /bin/sh, it is the default shell after mingw install.

The path variable has got this values:
PATH=.:/usr/local/bin:/mingw/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Program Files/Python/2.7.3

IMHO Scons on cygwin-python works without any problem. I'm testing Scons on 3 different systems: Win 7 & Visual Studio, Win 7 & MinGW, Win 7 & Cygwin. Python installation on the
VS & MinGW systems are from the www.python.org with version 2.7.3 and on Cygwin I use the Python package from Cygwin itself. (I have tested it also on OSX 10.5, 10.6, 10.7 & Linux).

I describe here the Win7 with MinGW shell system and I get only on this systems the errors with the semicolon. If I run the command above in the native shell window (not from env.Command)
the combination with the ; works without errors, so there is a difference on calling env.Command with the same command.

Phil




Am 25.10.2012 um 23:43 schrieb Evan Driscoll:


> Kraus Philipp: Since you've asked about a couple related things

> yesterday and today, it's worth pointing out that only in very rare

> cases will a program's behavior change depending on what shell you run

> it from. (Provided you're actually running the same program and not just

> a program with the same name found in a different place because PATH is

> different or whatever.)

>

> Thus the fact that you're running SCons starting from the MinGW shell

> doesn't really enter the picture -- it behaves the same as if you were

> to start it from the standard Windows shell cmd. This is as it should be

> -- e.g. on Linux, why should something behave differently if I run it

> from Bash vs Csh vs Zsh?

>

>

>

> On 10/25/2012 04:30 PM, Gary Oberbrunner wrote:

>> On Windows, all Commands are by default executed by cmd.exe. Set

>> env['SHELL'] to whatever shell you'd like to use.

>

> It's worth pointing out (even if not completely relevant to *this*

> discussion, so that people who stumble across this thread aren't

> confused) that the above only applies if you install the "native"

> version of SCons -- that is, using a Python that's a native build.

>

> The Cygwin version of SCons (if you install SCons with Cygwin Python)

> will use a Cygwin shell.

>

>

> Evan

>

> _______________________________________________

> 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