Closed
Bug 1509387
Opened 4 years ago
Closed 4 years ago
./mach lint -l eslint doesn't look for node in ~/.mozbuild
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement, P1)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox65 fixed)
RESOLVED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: kats, Assigned: standard8)
References
Details
Attachments
(1 file)
Bug 1509387 - When setting up ESLint, call npm via node so that node doesn't need to be in the path.
47 bytes,
text/x-phabricator-request
|
Details | Review |
I tried to run `./mach lint -l eslint`. It failed because it couldn't find node, and told me to run `./mach bootstrap --no-system-changes`. So I ran that, which downloaded a new clang, cbindgen, and node into my ~/.mozbuild. Then I ran `./mach lint -l eslint` again, and again it failed with the same thing. After I ran `PATH=$PATH:$HOME/.mozbuild/node/bin` it worked. Seems to me like the mach command should look in .mozbuild for node.
Reporter | ||
Comment 1•4 years ago
|
||
(This was on Ubuntu 16.04, in case it matters)
Assignee | ||
Comment 2•4 years ago
|
||
This should be getting the mozbuild directory from: https://searchfox.org/mozilla-central/rev/876022232b15425bb9efde189caf747823b39567/python/mozboot/mozboot/util.py#10 Which is called from: https://searchfox.org/mozilla-central/rev/876022232b15425bb9efde189caf747823b39567/python/mozbuild/mozbuild/nodeutil.py#108 https://searchfox.org/mozilla-central/rev/876022232b15425bb9efde189caf747823b39567/python/mozbuild/mozbuild/nodeutil.py#21 Could you try tracing it through and see if you can see what's going wrong?
Flags: needinfo?(kats)
Reporter | ||
Comment 3•4 years ago
|
||
Those bits seem to work ok. The problem is that found_exe ends up pointing to the npm binary at /home/kats/.mozbuild/node/bin/npm, and the very first line of that is "#!/usr/bin/env node". So when we run said npm binary to check the version, it fails to run because there's no `node` binary on the PATH and /usr/bin/env won't find it.
Flags: needinfo?(kats)
Reporter | ||
Comment 4•4 years ago
|
||
Here's what I see at the top of the output with a printout that I added: $ ./mach lint -l eslint gfx/wr/ found_exe: nodejs /usr/bin/nodejs found_exe: node /usr/bin/nodejs found_exe: npm /home/kats/.mozbuild/node/bin/npm /usr/bin/env: ‘node’: No such file or directory Could not find npm executable later than 5.6.
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
Thank you for that, very helpful. Looks like we need to wrap the calls to npm. We're already doing this for eslint itself, but obviously need to do npm as well. Could you try the patch I've just attached? I think that will fix it. If you've already worked around it, then trying this should be enough (as long as node isn't in your path): - Remove <topsrcdir>/node_modules - ./mach eslint --setup
Assignee: nobody → standard8
Flags: needinfo?(kats)
Priority: -- → P1
Assignee | ||
Comment 8•4 years ago
|
||
Great, thanks for checking, I'll get that reviewed :-)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f851c3e82c2b When setting up ESLint, call npm via node so that node doesn't need to be in the path. r=ahal
Comment 10•4 years ago
|
||
Backed out for build bustages Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=f851c3e82c2bad0afd8a2460245c9054c908e79f Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=214074746&repo=autoland&lineNumber=1172 Backout: https://hg.mozilla.org/integration/autoland/rev/02c470cc3f8dcd686cdcda402a514d3c8501ce89
Flags: needinfo?(standard8)
Assignee | ||
Comment 11•4 years ago
|
||
Oops: def check_executable_version(exe, wrap_call_with_node=True): that default should have been False. That could quite easily cause a continuous loop.
Flags: needinfo?(standard8)
Comment 12•4 years ago
|
||
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a177ba2ca668 When setting up ESLint, call npm via node so that node doesn't need to be in the path. r=ahal
Comment 13•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a177ba2ca668
Status: NEW → RESOLVED
Closed: 4 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Updated•4 years ago
|
Target Milestone: Firefox 65 → mozilla65
Updated•7 months ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•