Open Bug 1779653 Opened 3 years ago Updated 3 years ago

Build fails inside tmux on macOS due to `_curses.error: setupterm: could not find terminfo database`

Categories

(Firefox Build System :: General, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: mcomella, Unassigned)

References

Details

When I try to build inside tmux on mozilla-central revision 0242545b34ca (from Jun 22), I get the following error:

_curses.error: setupterm: could not find terminfo database

  File "/Users/mcomella/dev/mozilla-central/python/mozbuild/mozbuild/build_commands.py", line 221, in build
    return driver.build(
  File "/Users/mcomella/dev/mozilla-central/python/mozbuild/mozbuild/controller/building.py", line 1240, in build
    footer = BuildProgressFooter(self.log_manager.terminal, monitor)
  File "/Users/mcomella/dev/mozilla-central/python/mozbuild/mozbuild/controller/building.py", line 657, in __init__
    Footer.__init__(self, terminal)
  File "/Users/mcomella/dev/mozilla-central/python/mozterm/mozterm/widgets.py", line 12, in __init__
    self.term = terminal or Terminal()
  File "/Users/mcomella/dev/mozilla-central/python/mozterm/mozterm/terminal.py", line 53, in Terminal
    return blessings.Terminal(**kwargs)
  File "/Users/mcomella/dev/mozilla-central/third_party/python/blessings/blessings/__init__.py", line 97, in __init__
    setupterm(kind or environ.get('TERM', 'unknown'),

I found bug 1432867, which suggests this is an issue in the blessings library where it doesn't recognize certain terminal configurations (in their case, emacs). My tmux $TERM is tmux-256color. As a workaround, I can build outside of tmux fine where $TERM is xterm-256color or by setting $TERM inside tmux to xterm-256color.


Related note: It seems problematic that blessings would crash for unknown values in this environment variable that can be set arbitrarily, especially since it fails on what I assume to be a common configuration (e.g. tmux on macOS). It seems like blessings isn't actively maintained (at least in 2019) so I wonder if we should find an alternative?

See Also: → 878089

Related note: It seems problematic that blessings would crash for unknown values in this environment variable that can be set arbitrarily,

I also get the same problem with lldb:

$ lldb
terminals database is inaccessible

So I wonder if failing if the terminfo is unavailable is a common behavior. I'm not sure what package was updated that caused all of this to start breaking.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.