delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/05/05:40:53

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <CE5C042F6A0CD411BBE000A0C9558F2C0BE473@exchange.cs.cornell.edu>
From: Paul Stodghill <stodghil AT cs DOT cornell DOT edu>
To: "Cygwin Mailing List (E-mail)" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Very weird MAKE/PYTHON/ASH problem.
Date: Mon, 5 Jun 2000 05:39:56 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id FAA24147

I've got a very weird MAKE/PYTHON/ASH problem.

Synopsis: Python running under Make cannot export a new PATH value unless 
SHELL variable in Make is overridden to something other than "sh.exe"

"Huh?" I hear you say.

Ok, Let's look at this one step at a time. Consider the following Makefile:

    milhouse% cat Makefile
    default:
            python foo.py
    other:
            echo ${SHELL}

And the following Python file.

    milhouse% cat foo.py
    import os, os.path

    os.environ['PATH'] = "/some/junk" + os.pathsep + os.environ['PATH']
    os.environ['PATHX'] = "fooness"

    os.system("printenv")


Now, typing "make" should print an environment in which /some/junk is
prepended to PATH, right? Wrong!

    milhouse% make | egrep '^PATH'
    PATH=/home/stodghil/bib/bin:...
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PATHX=fooness

What gives? I have no idea, but I discovered that overriding Make's SHELL
variable seems to fix the problem. First, here is what Make's SHELL variable
is initially set to

    milhouse% make other
    echo sh.exe
    sh.exe

I tried setting SHELL to /bin/sh, /bin/bash, bash.exe, and sh.exe. Of the
four, the first three work and the last fails.

    milhouse% make SHELL=/bin/sh | egrep '^PATH'
    PATH=/some/junk:/home/stodghil/bib/bin:...
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PATHX=fooness

    milhouse% make SHELL=/bin/bash | egrep '^PATH'
    PATH=/some/junk:/home/stodghil/bib/bin:...
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PATHX=fooness

    milhouse% make SHELL=bash.exe | egrep '^PATH'
    PATH=/some/junk:/home/stodghil/bib/bin:...
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PATHX=fooness

    milhouse% make SHELL=sh.exe | egrep '^PATH'
    PATH=/home/stodghil/bib/bin:...
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PATHX=fooness

Does anyone have any idea what is going wrong?

Thanks.
----
Paul Stodghill <stodghil AT cs DOT cornell DOT edu>
4128 Upson Hall, Dept of CS, Cornell Univ., Ithaca, NY 14853
http://www.cs.cornell.edu/stodghil/
Voice: 607-254-8838 Fax: 607-255-4428

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019