Closed
Bug 772186
Opened 13 years ago
Closed 13 years ago
Support return values from pymake native commands
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla16
People
(Reporter: gps, Assigned: rain1)
References
Details
Attachments
(1 file, 1 obsolete file)
4.36 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
This is an offshoot of bug 770702 to have pymake native commands support return values.
I think we want to interpret int return values as exit codes and all other values as whatever behavior we do today.
Assignee | ||
Comment 1•13 years ago
|
||
I also added tests for failing sys.exit and return calls.
Comment 2•13 years ago
|
||
Comment on attachment 640988 [details] [diff] [review]
patch
Review of attachment 640988 [details] [diff] [review]:
-----------------------------------------------------------------
After further review, we might also consider following what Python does for sys.exit:
http://docs.python.org/library/sys.html#sys.exit
"The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object."
"If another type of object is passed, None is equivalent to passing zero, and any other object is printed to stderr and results in an exit code of 1."
::: pymake/process.py
@@ +214,5 @@
> + if isinstance(rv, int) and rv != 0:
> + print >>sys.stderr, (
> + "Native command '%s %s' returned value '%s'" %
> + (self.module, self.method, rv))
> + return -127
Do we want to propogate the return code here? If you look at PopenJob.run, we return the value of .wait() for actual shell commands.
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Ted Mielczarek [:ted] from comment #2)
> Comment on attachment 640988 [details] [diff] [review]
> patch
>
> Review of attachment 640988 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> After further review, we might also consider following what Python does for
> sys.exit:
> http://docs.python.org/library/sys.html#sys.exit
> "The optional argument arg can be an integer giving the exit status
> (defaulting to zero), or another type of object."
> "If another type of object is passed, None is equivalent to passing zero,
> and any other object is printed to stderr and results in an exit code of 1."
That is pretty much what I originally wanted to do, but gcp thought we might run into trouble with functions that already exist and return objects even on success. On the other hand, I don't think finding and fixing such cases is going to be an issue.
Assignee | ||
Comment 4•13 years ago
|
||
I prefer this one (plus going in and fixing any native commands that need to be fixed), but I'm going to leave both up and let you decide.
Attachment #641023 -
Flags: review?(khuey)
Assignee | ||
Comment 5•13 years ago
|
||
I just did a full pymake build using the second patch (attachment 641023 [details] [diff] [review]) and had no issues. I think we should go with that.
Attachment #641023 -
Flags: review?(khuey) → review+
Comment on attachment 640988 [details] [diff] [review]
patch
I'm assuming the other patch supersedes this one.
Attachment #640988 -
Flags: review?(khuey)
Reporter | ||
Comment 7•13 years ago
|
||
(In reply to Siddharth Agarwal [:sid0] from comment #3)
> (In reply to Ted Mielczarek [:ted] from comment #2)
> > Comment on attachment 640988 [details] [diff] [review]
> > patch
> >
> > Review of attachment 640988 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > After further review, we might also consider following what Python does for
> > sys.exit:
> > http://docs.python.org/library/sys.html#sys.exit
> > "The optional argument arg can be an integer giving the exit status
> > (defaulting to zero), or another type of object."
> > "If another type of object is passed, None is equivalent to passing zero,
> > and any other object is printed to stderr and results in an exit code of 1."
>
> That is pretty much what I originally wanted to do, but gcp thought we might
> run into trouble with functions that already exist and return objects even
> on success. On the other hand, I don't think finding and fixing such cases
> is going to be an issue.
I didn't realize sys.exit's behavior was what it is. I think we should copy that behavior.
Assignee | ||
Updated•13 years ago
|
Attachment #640988 -
Attachment is obsolete: true
Assignee | ||
Comment 8•13 years ago
|
||
(Sorry for getting your nick wrong, gps. Gah, two three-letter nicks with two letters common :( )
Assignee | ||
Comment 9•13 years ago
|
||
Comment 10•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•