Closed
Bug 1300577
Opened 8 years ago
Closed 6 years ago
"error: must call (at least) setupterm() first" in blessings when running mach lint/mach eslint
Categories
(Developer Infrastructure :: Lint and Formatting, defect, P5)
Tracking
(firefox59 fixed)
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: janx, Assigned: ahal)
References
Details
(Keywords: thirdparty)
Attachments
(2 files)
1.29 KB,
patch
|
Details | Diff | Splinter Review | |
59 bytes,
text/x-review-board-request
|
gps
:
review+
|
Details |
Steps to reproduce: git clone https://github.com/mozilla/gecko-dev cd gecko-dev ./mach eslint --setup Expected result: eslint is successfully set up. Actual result: abort: no repository found in '/home/user/firefox' (.hg not found)! 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: error: must call (at least) setupterm() first File "/home/user/firefox/tools/lint/mach_commands.py", line 60, in eslint linters=['eslint'], paths=paths, **kwargs) File "/home/user/firefox/python/mach/mach/registrar.py", line 123, in dispatch return self._run_command_handler(handler, context=context, **kwargs) File "/home/user/firefox/python/mach/mach/registrar.py", line 90, in _run_command_handler result = fn(**kwargs) File "/home/user/firefox/tools/lint/mach_commands.py", line 42, in lint return cli.run(*runargs, **lintargs) File "/home/user/firefox/python/mozlint/mozlint/cli.py", line 103, in run formatter = formatters.get(fmt) File "/home/user/firefox/python/mozlint/mozlint/formatters/__init__.py", line 25, in get return all_formatters[name](**fmtargs) File "/home/user/firefox/python/mozlint/mozlint/formatters/stylish.py", line 53, in __init__ self.num_colors = self.term.number_of_colors File "/home/user/firefox/python/blessings/blessings/__init__.py", line 257, in number_of_colors colors = tigetnum('colors') # Returns -1 if no color support, -2 if no such cap.
Reporter | ||
Comment 1•8 years ago
|
||
Patrick, do you know who handles eslint setup bugs nowadays?
Flags: needinfo?(pbrosset)
Component: Build Config → Lint
Flags: needinfo?(pbrosset) → needinfo?(ahalberstadt)
Product: Core → Testing
Assignee | ||
Comment 2•8 years ago
|
||
I wasn't able to reproduce this. The '.hg not found' error is a red herring. Mozlint first tries to run `hg root`, and if that fails, runs `git rev-parse --show-toplevel`. We should redirect stderr to prevent that hg warning from showing up. Jan, what is the output of: <objdir>/_virtualenv/bin/pip freeze I suspect this might be due to an old version of blessings or something. P.s, |mach eslint| will now just run the setup function automatically if you don't have the proper versions, so --setup isn't really necessary anymore.
Flags: needinfo?(ahalberstadt) → needinfo?(janx)
Reporter | ||
Comment 3•8 years ago
|
||
Thanks for your replies. I don't currently have an <objdir>, as I haven't built Firefox in the repository yet, but: $ pip freeze You are using pip version 8.1.1, however version 8.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. dblatex==0.3.7.post1 meld3==1.0.2 mercurial==3.7.3 pygobject==3.20.0 python-apt==1.1.0b1 requests==2.11.1 supervisor==3.2.0 Also, running `pip install --upgrade pip` doesn't fix my problem.
Reporter | ||
Updated•8 years ago
|
Flags: needinfo?(janx)
Assignee | ||
Comment 4•8 years ago
|
||
It looks like you might be hitting an open issue in blessings: https://github.com/erikrose/blessings/issues/39 What is your $TERM set to? I don't really understand the bug there though, Erik do you have any hints here? Jan, in the meantime as a workaround you can run: ./mach lint -l eslint -f treeherder <path> And that will both handle the setup for you and bypass the problem by using a formatter that doesn't use of blessings.
Flags: needinfo?(erik)
Assignee | ||
Updated•8 years ago
|
Summary: "./mach eslint --setup" no longer works in Git repositories → "error: must call (at least) setupterm() first" in blessings when running mach lint/mach eslint
Comment 5•8 years ago
|
||
This is a pretty deep bug on the blessings end, so I don't have an estimate of when it'll be fixed. In the meantime, you can work around it by setting TERM to something valid, like 'ansi'. In the worst case, you get some invalid escape sequences looking garbagey on your terminal.
Flags: needinfo?(erik)
Comment 6•8 years ago
|
||
I use mach eslint together with vim's makeprg and errorformat, which seemed to have worked before but now doesn't. I can consistently reproduce this using ./mach eslint -f compact | cat The github issue is fixed in the blessed-integration branch for over a year, what are the chances of that branch being merged? It would be great to get this fixed.
Assignee | ||
Comment 7•8 years ago
|
||
Somewhat unrelated, but |mach eslint -f compact| won't work anymore even with this issue fixed since bug 1258341. This is because |mach eslint| no longer directly calls the eslint binary, but goes through a framework called mozlint[1]. mozlint reads structured JSON output from eslint and now handles the formatting itself. Good news is support for the compact formatter can be relatively easy to add, and doesn't even need to depend on blessings, so this issue is probably irrelevant to your needs. As a workaround, try using -f treeherder instead of -f compact, and see if it works then. Also feel free to file a bug about the compact formatter under Testing::Lint if the treeherder formatter doesn't cut it. [1] http://gecko.readthedocs.io/en/latest/tools/lint/index.html
Comment 8•8 years ago
|
||
Ah, I was already wondering why --no-color doesn't work anymore, this explains it! I've adapted my script to the treeherder output format, that works fine for me. Therefore I don't need the compact formatter. If you are curious, put this in your ~/.vim/compiler/mach-eslint.vim CompilerSet errorformat=TEST-UNEXPECTED-WARNING\ \|\ %f:%l:%c\ \|\ %m CompilerSet makeprg=./mach\ lint\ -l\ eslint\ -f\ treeherder then run :compiler mach-eslint and one of :make / :make path/to/file / :make % Thanks for the hints!
Assignee | ||
Comment 9•8 years ago
|
||
Awesome, I was actually planning to look into vim integration soon. You could probably remove the "-l eslint" argument and let mozlint figure out which linters to run on the given file automatically. Doing this probably wouldn't benefit you in the short term (unless you also edit python files regularly), but may in the future if new linters get added.
Updated•7 years ago
|
Priority: -- → P5
Updated•7 years ago
|
Keywords: thirdparty
Comment 10•6 years ago
|
||
Can we workaround this issue using something like this? Aside from the vim issue I worked around, I hit this simply when doing ./mach eslint > issues.txt. I've tried various values of TERM but they all don't work for me.
Attachment #8938317 -
Flags: feedback?(erik)
Assignee | ||
Comment 11•6 years ago
|
||
I submitted a related PR for this: https://github.com/erikrose/blessings/pull/125 I *think* that should fix the issue in here too, though haven't tested. Fallen, btw if you set $EDITOR=vim and run ./mach lint --edit, that should now automatically open up errors in vim's quickfix window.
Assignee | ||
Comment 12•6 years ago
|
||
We could use this bug to track updating blessings once that PR reaches a release.
Comment 13•6 years ago
|
||
The PR is released in version 1.6.1: https://pypi.python.org/pypi/blessings/. I've also released wheels, so you should be able to enjoy quicker installs if you wish.
Comment 14•6 years ago
|
||
Comment on attachment 8938317 [details] [diff] [review] Workaround - v1 (In reply to Andrew Halberstadt [:ahal] from comment #11) > I submitted a related PR for this: > https://github.com/erikrose/blessings/pull/125 > > I *think* that should fix the issue in here too, though haven't tested. Sounds great, thanks for working on this! > Fallen, btw if you set $EDITOR=vim and run ./mach lint --edit, that should > now automatically open up errors in vim's quickfix window. Ah perfect, I like it! Thanks for the tip :)
Attachment #8938317 -
Flags: feedback?(erik)
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Comment 16•6 years ago
|
||
mozreview-review |
Comment on attachment 8940804 [details] Bug 1300577 - Upgrade blessings to version 1.6.1, https://reviewboard.mozilla.org/r/211066/#review216848
Attachment #8940804 -
Flags: review?(gps) → review+
Comment 17•6 years ago
|
||
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/176e82e199fe Upgrade blessings to version 1.6.1, r=gps
Comment 18•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/176e82e199fe
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•6 years ago
|
Product: Testing → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•