Closed
Bug 1212047
Opened 11 years ago
Closed 10 years ago
mach eslint --setup does not report errors
Categories
(Firefox Build System :: Mach Core, enhancement)
Firefox Build System
Mach Core
Tracking
(firefox45 fixed)
RESOLVED
FIXED
mozilla45
| Tracking | Status | |
|---|---|---|
| firefox45 | --- | fixed |
People
(Reporter: tromey, Assigned: miker)
References
Details
Attachments
(1 obsolete file)
I tried mach eslint --setup and was puzzled when it didn't have
any effect.
It turns out that the setup code ignores errors from the subprocesses
it invokes, and furthermore redirects their output to /dev/null, e.g.:
with open(os.devnull, "w") as fnull:
subprocess.call([npmPath, "install", "eslint", "-g"],
stdout=fnull, stderr=fnull)
In the end I got this working by running the commands myself (I am
not using a global install and "-g" will fail for me...); but this
would have been easier if mach had reported the errors.
| Assignee | ||
Comment 1•10 years ago
|
||
I agree... we should simply show output as it can only help with debugging (and reproducing issues).
Assignee: nobody → mratcliffe
| Assignee | ||
Comment 2•10 years ago
|
||
Bug 1212047 - Improve ESLint logging in case of error r?=mh+mozilla
Rather than always showing verbose and confusing information I have chosen to only show command output when errors occur.
| Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=mh+mozilla
Rather than always showing verbose and confusing information I have chosen to only show command output when errors occur.
Attachment #8678208 -
Flags: review?(mh+mozilla)
Updated•10 years ago
|
Attachment #8678208 -
Flags: review?(mh+mozilla)
Comment 4•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
https://reviewboard.mozilla.org/r/23131/#review20835
::: python/mach_commands.py:264
(Diff revision 1)
> + print("\nInstalling " + name + " using \"" + " ".join(cmd) + "\"...")
Please use string formatting (either `"{}".format()` or `"%s" % ()`)
::: python/mach_commands.py:277
(Diff revision 1)
> + return 1
> +
> + return 0
You might as well return True/False.
| Assignee | ||
Updated•10 years ago
|
Attachment #8678208 -
Attachment description: MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=mh+mozilla → MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Attachment #8678208 -
Flags: review?(mh+mozilla)
| Assignee | ||
Comment 5•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Rather than always showing verbose and confusing information I have chosen to only show command output when errors occur.
| Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Rather than always showing verbose and confusing information I have chosen to only show command output when errors occur.
Attachment #8678208 -
Flags: review?(mh+mozilla)
| Assignee | ||
Comment 7•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Rather than always showing verbose and confusing information I have chosen to only show command output when errors occur.
| Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Rather than always showing verbose and confusing information I have chosen to only show command output when errors occur.
Attachment #8678208 -
Flags: review?(mh+mozilla)
| Assignee | ||
Comment 9•10 years ago
|
||
This patch correctly displays errors when installing. This means that it is much clearer why an installation has failed.
Comment 10•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
https://reviewboard.mozilla.org/r/23131/#review20951
::: python/mach_commands.py:235
(Diff revisions 1 - 3)
> - return 1
> + return False
I was only asking for True/False being returned from callProcess. It's fine that you change it here too, albeit unrelated to the changes from this bug, but you're also inverting the return value, without adjusting the caller, which uses the returned value as a return code, so the new values are now opposite to what they ought to be.
Attachment #8678208 -
Flags: review?(mh+mozilla)
| Assignee | ||
Comment 11•10 years ago
|
||
https://reviewboard.mozilla.org/r/23131/#review20951
> I was only asking for True/False being returned from callProcess. It's fine that you change it here too, albeit unrelated to the changes from this bug, but you're also inverting the return value, without adjusting the caller, which uses the returned value as a return code, so the new values are now opposite to what they ought to be.
Well spotted.
| Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Fix return codes
Attachment #8678208 -
Flags: review?(mh+mozilla)
| Assignee | ||
Comment 13•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Bug 1212047 - Improve ESLint logging in case of error r?=glandium
Fix *all* return codes
Comment 14•10 years ago
|
||
Comment on attachment 8678208 [details]
MozReview Request: Bug 1212047 - Improve ESLint logging in case of error r?=glandium
https://reviewboard.mozilla.org/r/23131/#review21091
::: python/mach_commands.py:274
(Diff revision 5)
> + return False
> +
> + return True
Random thought: if you raise an exception instead of returning False, the caller can become:
try:
self.callProcess("eslint"...)
self.callProcess("eslint-plugin-mozilla"...)
self.callProcess("eslint-plugin-react"...)
except:
return 1
But I won't block you on this.
Attachment #8678208 -
Flags: review?(mh+mozilla) → review+
| Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 15•10 years ago
|
||
Keywords: checkin-needed
Comment 16•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 17•10 years ago
|
||
| bugherder uplift | ||
status-b2g-v2.5:
--- → fixed
Comment 18•10 years ago
|
||
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
status-b2g-v2.5:
fixed → ---
| Assignee | ||
Updated•10 years ago
|
Attachment #8678208 -
Attachment is obsolete: true
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
•