[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: PATH & Perl 5.6 on Win32 ?
From: |
Eric Brown |
Subject: |
RE: PATH & Perl 5.6 on Win32 ? |
Date: |
Tue, 10 Apr 2001 18:00:04 -0700 |
The bug isn't that the copy of the path passed to the child is wrong, it's
that the environment *at the time CreateProcess() is called* is wrong.
Running everything in a subshell will work, at the cost of losing the exit
code - cmd -c and cmd -k return the exit code of *cmd.exe*, not the
executed process.
My followup to #1342 indicated where I had tracked the bug down to.
> -----Original Message-----
> From: Trent Mick [mailto:address@hidden
> Sent: Tuesday, April 10, 2001 5:01 PM
> To: Eric Brown
> Cc: 'Johan Holmberg'; address@hidden
> Subject: Re: PATH & Perl 5.6 on Win32 ?
>
>
> On Tue, Apr 10, 2001 at 10:26:39AM -0700, Eric Brown wrote:
> > It's definitely a bug in ActiveState Perl 5.6 (up to and
> including build
> > 623). If you want, I can send you a patch to the Perl
> sources that fixes
> > the problem.
> >
> > I've sent a message to ActiveState, and it's in their bug
> system (#1342),
> > but in 4 months, it hasn't been assigned to a developer to fix.
>
> c.f. http://bugs.activestate.com/ActivePerl/incoming?id=1342
>
> I had Sarathy (the ActivePerl main dude here) take a quick look at it.
> Unfortunately he could not find the problem in Perl (if
> indeed that is where
> the problem is).
>
> I can (weakly) say that it (modifying PATH and using it)
> works in Python.
> Maybe Steven Knight can finish up ScCons
> (http://software-carpentry.codesourcery.com/entries/build/ScCo
ns/ScCons.html)
real quick so we can use it. :)
[Sarathy]:
> AFAIK, this is not a perl bug.
>
> C:\> copy con penv.c
> #include <stdio.h>
>
> int
> main(int argc, char **argv, char **env)
> {
> printf("PATH=%s\n", getenv("PATH"));
> return 0;
> }
> ^Z
> C:\> cl penv.c
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
> 80x86
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>
> penv.c
> Microsoft (R) Incremental Linker Version 6.00.8447
> Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
>
> /out:penv.exe
> penv.obj
> C:\> perl -we "$ENV{PATH} = 'xyz'; system './penv'"
> PATH=xyz
> C:\> perl -v
>
> This is perl, v5.6.0 built for MSWin32-x86-multi-thread
> (with 1 registered patch, see perl -V for more detail)
>
> Copyright 1987-2000, Larry Wall
>
> Binary build 620 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 18:31:05 Oct 31 2000
>
> I suspect this is Windows NT/2000 playing tricks with the "user"
environment
> vs. the "system" environment under the covers...
Trent
--
Trent Mick
address@hidden