Closed Bug 1416924 Opened 8 years ago Closed 2 years ago

Cannot run mach eslint --setup, Too many levels of symbolic links

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mossop, Unassigned)

References

Details

Overwriting /Users/dave/mozilla/build/nightly-artifact/_virtualenv/lib/python2.7/orig-prefix.txt with new content New python executable in /Users/dave/mozilla/build/nightly-artifact/_virtualenv/bin/python Traceback (most recent call last): File "/Users/dave/mozilla/source/trunk/third_party/python/virtualenv/virtualenv.py", line 2325, in <module> main() File "/Users/dave/mozilla/source/trunk/third_party/python/virtualenv/virtualenv.py", line 711, in main symlink=options.symlink and hasattr(os, 'symlink')) # MOZ: Make sure we don't use symlink when we don't have it File "/Users/dave/mozilla/source/trunk/third_party/python/virtualenv/virtualenv.py", line 924, in create_environment site_packages=site_packages, clear=clear, symlink=symlink)) File "/Users/dave/mozilla/source/trunk/third_party/python/virtualenv/virtualenv.py", line 1385, in install_python raise e OSError: [Errno 62] Too many levels of symbolic links Error running mach: ['eslint', '--setup'] 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: Exception: Failed to create virtualenv: /Users/dave/mozilla/build/nightly-artifact/_virtualenv File "/Users/dave/mozilla/source/trunk/tools/lint/mach_commands.py", line 63, in eslint argv=extra_args, **kwargs) File "/Users/dave/mozilla/source/trunk/python/mach/mach/registrar.py", line 129, in dispatch return self._run_command_handler(handler, context=context, **kwargs) File "/Users/dave/mozilla/source/trunk/python/mach/mach/registrar.py", line 90, in _run_command_handler result = fn(**kwargs) File "/Users/dave/mozilla/source/trunk/tools/lint/mach_commands.py", line 43, in lint self._activate_virtualenv() File "/Users/dave/mozilla/source/trunk/python/mozbuild/mozbuild/base.py", line 744, in _activate_virtualenv self.virtualenv_manager.ensure() File "/Users/dave/mozilla/source/trunk/python/mozbuild/mozbuild/virtualenv.py", line 166, in ensure return self.build(python) File "/Users/dave/mozilla/source/trunk/python/mozbuild/mozbuild/virtualenv.py", line 439, in build self.create(python) File "/Users/dave/mozilla/source/trunk/python/mozbuild/mozbuild/virtualenv.py", line 203, in create 'Failed to create virtualenv: %s' % self.virtualenv_root)
This is on OSX 10.13.1 python2.7 is /usr/local/bin/python2.7 -> ../Cellar/python/2.7.14/bin/python2.7
/usr/local/Cellar/python/2.7.14/bin/python2.7 -> ../Frameworks/Python.framework/Versions/2.7/bin/python2.7
Is this from a fresh objdir? Does it reproduce if there is no objdir? (Use `rm -rf objdir` since `mach clobber` doesn't fully delete the objdir.) Does it reproduce after running e.g. `mach configure`?
Flags: needinfo?(dtownsend)
If I delete the objdir then I get to a different error that is likely a different bug for me to file. If I delete the objdir, run mach configure then run mach eslint --setup again I get the same error as here.
Flags: needinfo?(dtownsend)
What is the error if you run from a fresh objdir? I'm interested in reproducing from that state because it is easier to debug. Can you try to narrow this down to the smallest STR possible?
Component: mach → Build Config
(In reply to Gregory Szorc [:gps] from comment #5) > What is the error if you run from a fresh objdir? I'm interested in > reproducing from that state because it is easier to debug. Can you try to > narrow this down to the smallest STR possible? That ended up being because I didn't have node installed so from a fresh objdir it worked ok. It's just from an unclean one it is broken.
I solved my problems by symlinking /usr/local/bin/python to /usr/local/bin/python2
Component: Build Config → Lint
Product: Core → Testing
Product: Testing → Firefox Build System

I reproduced this error. I did a fresh install off virtualenv in another terminal tab while I had a built version of Gecko in the other tab. I did a full clobber and rebuild and the error went away.

I get the same error ("too many levels of symbolic links") in a clean clone with no objdir (having done git checkout . and git clean -dfx) of mozilla-central by running "./mach test python/mozbuild/mozbuild/test". Running macOS mojave (10.14.6). Interestingly, once the clone gets into this state, I have to wipe everything out or a "./mach build" will fail with the same error.

Fyi you can probably get away with wiping <objdir>/_virtualenvs in the future.

Is the traceback you're seeing the same as comment 0? I've noticed this is an issue that gets raised from time to time for Mac users in the greater Python community. Usually related to virtualenv.

I wonder if upgrading our vendored virtualenv would magically fix this, it's pretty badly out of date right now (see bug 1464038). I have some patches I haven't had a chance to push through, I'll at least upload them there.

See Also: → 1464038

I just ran into this problem too and tried doing comment 7, cleared the obj dir, then did a clobber build, which seemed to fix my problem.

Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3

Dave no longer has a symlink so doesn't see this any more. Given this was python 2 and there's a lot changed since the last comment, I'm marking as incomplete - we can re-open or file a new issue if necessary.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.