digitalmars.D.bugs - [Issue 10580] New: spawnShell/pipeShell changes some environment variables (incl. PATH)
- d-bugmail puremagic.com (39/39) Jul 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10580
- d-bugmail puremagic.com (8/8) Jul 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10580
- d-bugmail puremagic.com (6/6) Jul 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10580
- d-bugmail puremagic.com (21/21) Jul 28 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10580
- d-bugmail puremagic.com (9/9) Jul 28 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10580
- d-bugmail puremagic.com (8/8) Aug 06 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10580
http://d.puremagic.com/issues/show_bug.cgi?id=10580 Summary: spawnShell/pipeShell changes some environment variables (incl. PATH) Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: thelastmammoth gmail.com ----main.d: import std.process; import std.stdio; void main(){ writeln(environment["PATH"]); system("echo $PATH"); spawnShell("echo $PATH").wait; spawnShell("echo $0").wait; } ---- (on OSX if that matters, and I've set my shell to zsh but this isn't the problem) export PATH=/usr/bin path/to/dmd -run path/to/main.d #this prints: /usr/bin /usr/bin /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:... (+ other stuff) /go/bin /bin/zsh The bug is that spawnShell("echo $PATH") should IMO return the same as system("echo $PATH"). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10580 it also changes these (at least on OSX): MANPATH SHLVL ( this one is normal though) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10580 furthermore the output of command env is returned in a different order -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10580 Lars T. Kyllingstad <bugzilla kyllingen.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla kyllingen.net 07:54:24 PDT --- I cannot reproduce this on Linux, so it's hard to say what the issue is. It would be great if someone else could try this on OSX. spawnShell() does not touch the environment unless explicitly requested, so I think the answer lies somewhere else. It looks almost like spawnShell() starts the shell as a login shell. In that case it would read various startup scripts, and re-set PATH along with some other environment variables. Could you please run the following commands in a terminal? export PATH=/usr/bin $SHELL -c 'echo $PATH' $SHELL -l -c 'echo $PATH' (Note the single quotes, which delay expansion of the PATH variable.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 28 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10580 Lars T. Kyllingstad <bugzilla kyllingen.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|nobody puremagic.com |bugzilla kyllingen.net -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 28 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10580 Lars T. Kyllingstad <bugzilla kyllingen.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |major -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 06 2013