Closed Bug 1336857 Opened 7 years ago Closed 6 years ago

mach lint -l wpt fails on Windows with "WindowsError: [Error 193] <no description>"

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

x86_64
Windows 10
defect
Not set
normal

Tracking

(firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: birtles, Assigned: ahal)

Details

Attachments

(2 files)

According to [1] I should be able to run lint on web-platform-tests with:

  mach lint -l wpt -l wpt_manifest

However, on Windows, doing the above, or just "mach lint -l wpt", I get the following:

  ['c:\\moz\\src2\\tools\\lint\\..\\..\\testing\\web-platform\\tests\\lint', '--json']
  Traceback (most recent call last):
    File "c:\moz\src2\python/mozlint\mozlint\roller.py", line 56, in _run_worker
      return _run_linters(*args, **lintargs)
    File "c:\moz\src2\python/mozlint\mozlint\roller.py", line 43, in _run_linters
      res = func(paths, linter, **lintargs) or []
    File "c:\moz\src2\python/mozlint\mozlint\types.py", line 37, in __call__
      return self._lint(paths, linter, **lintargs)
    File "c:\moz\src2\python/mozlint\mozlint\types.py", line 104, in _lint
      return payload(files, **lintargs)
    File "c:\moz\src2\tools\lint\wpt.lint", line 42, in lint
      run_process()
    File "c:\moz\src2\tools\lint\wpt.lint", line 34, in run_process
      proc.run()
    File "c:\moz\src2\testing/mozbase/mozprocess\mozprocess\processhandler.py", line 739, in run
      self.proc = self.Process([self.cmd] + self.args, **args)
    File "c:\moz\src2\testing/mozbase/mozprocess\mozprocess\processhandler.py", line 114, in __init__
      universal_newlines, startupinfo, creationflags)
    File "c:\mozilla-build\python\lib\subprocess.py", line 710, in __init__
      errread, errwrite)
    File "c:\moz\src2\testing/mozbase/mozprocess\mozprocess\processhandler.py", line 280, in _execute_child
      cwd, startupinfo)
    File "c:\moz\src2\testing/mozbase/mozprocess\mozprocess\winprocess.py", line 200, in ErrCheckCreateProcess
      ErrCheckBool(result, func, args)
    File "c:\moz\src2\testing/mozbase/mozprocess\mozprocess\winprocess.py", line 57, in ErrCheckBool
      raise WinError()
  WindowsError: [Error 193] <no description>
  Error running mach:

      ['lint', '-l', 'wpt']

  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:

  WindowsError: [Error 193] <no description>

    File "c:\moz\src2\tools/lint/mach_commands.py", line 43, in lint
      return cli.run(*runargs, **lintargs)
    File "c:\moz\src2\python/mozlint\mozlint\cli.py", line 108, in run
      workdir=workdir)
    File "c:\moz\src2\python/mozlint\mozlint\roller.py", line 150, in roll
      results, failed = worker.get()
    File "c:\mozilla-build\python\lib\multiprocessing\pool.py", line 567, in get
      raise self._value

I tried running just "mach lint" by itself and it installed some npm modules, but still the same error remains.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/QA/web-platform-tests#Lint
What happens if you try to run the lint script in testing/web-platform/tests directly?
Flags: needinfo?(bbirtles)
It passes? I'm not sure it just sits there for a minute or so then terminates with no message. In any case, there is no error message.
Flags: needinfo?(bbirtles)
OK, then it seems like this might be a more general problem with mozlint.

ahal: idk if you have some easy way to look at this? I could reinstall my Windows VM, but I guess I won't get to it for a few days.
Flags: needinfo?(ahalberstadt)
I don't have a way to easily test this, but I think you need to prepend "python.exe" to the command here:
https://dxr.mozilla.org/mozilla-central/source/tools/lint/wpt.lint#31

I did some googling and Error 139 usually means that the command isn't a valid binary, which makes sense because the command is trying to run a python script with #!/usr/bin/env python at the top (which won't do much on Windows). I'm not sure why in this case it says <No description> though..
Flags: needinfo?(ahalberstadt)
I also think this would also work if the script was called 'lint.py' because then Windows would associate it with the python interpreter.. But because it's just 'lint' it doesn't know what to do.
It's possible the "<No description>" part is because I'm on Japanese Windows. Maybe it tries to print a Japanese error message but realizes the terminal can't display non-ASCII characters, so just displays "<No description>" instead.
I can reproduce this problem on English Windows, with the same "<No description>" message.

Attached is a quick workaround that hard codes the python path.
Is this still an issue? There's been some changes recently that may/may not have helped this.
(In reply to Mark Banner (:standard8) from comment #8)
> Is this still an issue? There's been some changes recently that may/may not
> have helped this.

Brian ^^^
Flags: needinfo?(bbirtles)
Sorry for the delay -- I stopped using Windows because of issues like this but I've just confirmed again now that this is still an issue on trunk m-c.
Flags: needinfo?(bbirtles)
I think there was some confusion over who was owning this and it got forgotten. I'll take this.
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Comment on attachment 8936879 [details]
Bug 1336857 - [lint] Fix 'wpt' linter on Windows,

https://reviewboard.mozilla.org/r/207600/#review213494
Attachment #8936879 - Flags: review?(james) → review+
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6ba05c2b2ae
[lint] Fix 'wpt' linter on Windows, r=jgraham
https://hg.mozilla.org/mozilla-central/rev/f6ba05c2b2ae
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Product: Testing → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: