Closed Bug 1274604 Opened 8 years ago Closed 6 years ago

`mach eslint --setup` fails with "No such file or directory: ~/bin/testing/eslint` when mach is invoked via ~/bin/mach symlink

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mcomella, Unassigned)

Details

Full trace:

Error running mach:

    ['eslint', '--setup']

The error occurred in the implementation of the invoked mach command.

This should never occur and is likely a bug in the implementation of that
command. 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 2] No such file or directory: '/Users/mcomella/bin/testing/eslint'

  File "/Users/mcomella/dev/moz/python/mach_commands.py", line 222, in eslint
    return self.eslint_setup()
  File "/Users/mcomella/dev/moz/python/mach_commands.py", line 296, in eslint_setup
    os.chdir(module_path)
---

fwiw, I don't think it should be trying to install things into path or my bin directory. Using absolute paths via .mozbuild seems more correct to me.
I have this issue, too. A workaround is to manually create the `/usr/local/bin/testing` directory, run `mach eslint --setup` once, then doing (from within a mozilla-central checkout) `cp -r testing/eslint/eslint-plugin-mozilla /usr/local/bin/testing/eslint/`, then running `mach eslint --setup` a second time. Yes, it's ugly.
I had this too. Turns out it was because I have mach symlinked in ~/bin/ and call it with "mach", not "./mach"
(In reply to Magnus Melin from comment #2)
> I had this too. Turns out it was because I have mach symlinked in ~/bin/ and
> call it with "mach", not "./mach"

I also have this configuration.
I left the symlink in ~/bin & ran `./mach eslint --setup`: setup was successful.
Summary: `mach eslint --setup` fails with "No such file or directory: ~/bin/testing/eslint` → `mach eslint --setup` fails with "No such file or directory: ~/bin/testing/eslint` when mach is invoked via ~/bin/mach symlink
Does anyone still have this issue? I just tried it locally and couldn't reproduce.
Component: Build Config → Lint
Flags: needinfo?(till)
Flags: needinfo?(mkmelin+mozilla)
Product: Core → Testing
Yes - at least my case for comm central, a symlink doesn't work.

/opt/comm-central/src$ mach eslint --setup
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:

OSError: [Errno 2] No such file or directory: '/opt/comm-central/src/build/virtualenv_packages.txt'

  File "/opt/comm-central/src/mozilla/tools/lint/mach_commands.py", line 62, in eslint
    argv=extra_args, **kwargs)
  File "/opt/comm-central/src/mozilla/python/mach/mach/registrar.py", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "/opt/comm-central/src/mozilla/python/mach/mach/registrar.py", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "/opt/comm-central/src/mozilla/tools/lint/mach_commands.py", line 42, in lint
    self._activate_virtualenv()
  File "/opt/comm-central/src/mozilla/python/mozbuild/mozbuild/base.py", line 623, in _activate_virtualenv
    self.virtualenv_manager.ensure()
  File "/opt/comm-central/src/mozilla/python/mozbuild/mozbuild/virtualenv.py", line 164, in ensure
    if self.up_to_date(python):
  File "/opt/comm-central/src/mozilla/python/mozbuild/mozbuild/virtualenv.py", line 127, in up_to_date
    dep_mtime = max(os.path.getmtime(p) for p in deps)
  File "/opt/comm-central/src/mozilla/python/mozbuild/mozbuild/virtualenv.py", line 127, in <genexpr>
    dep_mtime = max(os.path.getmtime(p) for p in deps)
  File "/usr/lib/python2.7/genericpath.py", line 62, in getmtime
    return os.stat(filename).st_mtime
Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(till)
Comment 6 seems slightly different to comment 0. Comment 6 looks more about issues with the virtualenv setup, whereas comment 0 is about the eslint setup itself.

As I can't reproduce, I can't really help, however eslint.lint is the place to start looking.
Priority: -- → P4
Product: Testing → Firefox Build System
We made some recent changes to ESLint, especially with how node is installed. I don't know if these or earlier changes may have helped or not, but given no complaints recently I'm marking this as WFM.

Magnus, for the comment 6 issue, that looks more like virtualenv, rather than ESLint, so you might want to file a separate bug on those if you're still having an issue.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.