Closed
Bug 782847
Opened 13 years ago
Closed 13 years ago
Pymake native commands don't pass the correct environment to subprocesses
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla17
People
(Reporter: rain1, Assigned: rain1)
References
Details
Attachments
(1 file)
|
3.07 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
http://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/file/7d221562bc4a/pymake/process.py#l209 sets os.environ to a new dictionary. However, os.environ is actually a magic dictionary which calls os.putenv and affects the environment of subprocesses, while this one doesn't.
Oh, Python...
| Assignee | ||
Comment 1•13 years ago
|
||
Assignee: nobody → sagarwal
Status: NEW → ASSIGNED
Attachment #651965 -
Flags: review?(ted.mielczarek)
Comment 2•13 years ago
|
||
Comment on attachment 651965 [details] [diff] [review]
use clear() and update() instead
Review of attachment 651965 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good to me.
Please note in the commit message that this is backwards incompatible but it brings native command behavior inline with what it should have been.
::: tests/pycmd.py
@@ +9,5 @@
> f.write(os.environ[args[1]])
>
> +def writesubprocessenvtofile(args):
> + with open(args[0], 'w') as f:
> + p = subprocess.Popen([sys.executable, "-c",
whitespace.
@@ +12,5 @@
> + with open(args[0], 'w') as f:
> + p = subprocess.Popen([sys.executable, "-c",
> + "import os; print os.environ['%s']" % args[1]],
> + stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> + stdout, stderr = p.communicate()
Shouldn't there be a p.wait() here?
Attachment #651965 -
Flags: review?(ted.mielczarek) → review+
| Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #2)
> @@ +12,5 @@
> > + with open(args[0], 'w') as f:
> > + p = subprocess.Popen([sys.executable, "-c",
> > + "import os; print os.environ['%s']" % args[1]],
> > + stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> > + stdout, stderr = p.communicate()
>
> Shouldn't there be a p.wait() here?
communicate implies wait: http://docs.python.org/library/subprocess.html#subprocess.Popen.communicate
| Assignee | ||
Comment 4•13 years ago
|
||
Pushed to the Pymake repository.
http://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/rev/8360595070d6
I'll push to mozilla-inbound once it reopens.
| Assignee | ||
Comment 5•13 years ago
|
||
Flags: in-testsuite+
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Updated•8 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•