Closed
Bug 1476147
Opened 7 years ago
Closed 7 years ago
'mach bootstrap' fails to get hg version
Categories
(Firefox Build System :: Bootstrap Configuration, defect)
Tracking
(firefox63 fixed)
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: scarrillo, Assigned: TYLin)
Details
Attachments
(1 file)
Error running mach:
['bootstrap']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
OSError: [Errno 13] Permission denied
File "/home/mozilla/src/gecko/python/mozboot/mozboot/mach_commands.py", line 32, in bootstrap
bootstrapper.bootstrap()
File "/home/mozilla/src/gecko/python/mozboot/mozboot/bootstrap.py", line 283, in bootstrap
hg_installed, hg_modern = self.instance.ensure_mercurial_modern()
File "/home/mozilla/src/gecko/python/mozboot/mozboot/base.py", line 472, in ensure_mercurial_modern
installed, modern, version = self.is_mercurial_modern()
File "/home/mozilla/src/gecko/python/mozboot/mozboot/base.py", line 465, in is_mercurial_modern
our = self._parse_version(hg, 'version', self._hg_cleanenv())
File "/home/mozilla/src/gecko/python/mozboot/mozboot/base.py", line 434, in _parse_version
stderr=subprocess.STDOUT)
File "/home/mozilla/src/gecko/python/mozboot/mozboot/base.py", line 363, in check_output
return fn(*args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 216, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
I debugged a little and found that in 460 of base.py, 'which hg' is getting my cinnabar path: /home/mozilla/src/git-cinnabar/hg instead of /usr/bin/hg (the output of 'which hg' from terminal)
| Reporter | ||
Updated•7 years ago
|
Flags: needinfo?(mh+mozilla)
Comment 1•7 years ago
|
||
At the very least we should have better error messages for things like this that say what we failed to execute.
Comment 2•7 years ago
|
||
ISTR we've hit this problem before, where which.py happily considers directories as a valid result. Shells' which doesn't, and properly skip those and return the next result.
You could place your cinnabar path last in your PATH as a workaround.
Flags: needinfo?(mh+mozilla)
| Reporter | ||
Comment 3•7 years ago
|
||
hmm... I do have it last. Any other ideas on how to fix?
Comment 4•7 years ago
|
||
O_o How does which.py not find /usr/bin/hg if /usr/bin is before the git-cinnabar path?
| Reporter | ||
Comment 5•7 years ago
|
||
¯\_(ツ)_/¯ going to try restarting, bc even in a new shell, the cinnabar path was found. Thanks for your help!
| Reporter | ||
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Comment 6•7 years ago
|
||
FWIW, with the git-cinnabar path *before* /usr/bin in my PATH, the following python script prints /usr/bin/hg:
from which import which
which('hg')
And instrumenting which does show it looking at the hg directory in the git-cinnabar directory. (it also revealed a pretty explicit os.path.isfile() in the code). I really don't know what's going on on your machine.
Comment 7•7 years ago
|
||
(I will, however, rename the directory in git-cinnabar)
| Reporter | ||
Comment 8•7 years ago
|
||
Yes, I did notice that the hg directory in cinnabar was new so maybe renaming that would help... but honestly I've been having a bunch of issues on my machine so I wasn't surprised by the weirdness. I restarted and 'mach bootstrap' worked now, so I have no idea what made the difference. gps encouraged me to file the bug though just to check out what was happening :)
| Assignee | ||
Comment 9•7 years ago
|
||
This excludes directories, and returns true only if it's an executable file.
Comment 10•7 years ago
|
||
Comment on attachment 9000087 [details]
Bug 1476147 - Use path.isfile() instead of patch.exists() in which().
Mike Hommey [:glandium] has approved the revision.
Attachment #9000087 -
Flags: review+
Comment 11•7 years ago
|
||
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c9d65d413d06
Use path.isfile() instead of patch.exists() in which(). r=glandium
Comment 12•7 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → aethanyc
status-firefox63:
--- → fixed
Resolution: INVALID → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•