Closed
Bug 878089
Opened 12 years ago
Closed 12 years ago
mach: blessings/curses fails to setup terminal when TERM is not set
Categories
(Firefox Build System :: Mach Core, enhancement)
Tracking
(firefox21 unaffected, firefox22 affected, firefox23 affected, firefox24 fixed)
RESOLVED
FIXED
mozilla24
| Tracking | Status | |
|---|---|---|
| firefox21 | --- | unaffected |
| firefox22 | --- | affected |
| firefox23 | --- | affected |
| firefox24 | --- | fixed |
People
(Reporter: gaston, Assigned: gps)
References
Details
Attachments
(1 file, 1 obsolete file)
|
1.33 KB,
patch
|
ted
:
review+
gaston
:
feedback+
|
Details | Diff | Splinter Review |
With 22.0b3, running configure within tmux (TERM=screen)
creating ./config.status
Traceback (most recent call last):
File "./config.status", line 1008, in <module>
config_status(**args)
File "/usr/obj/firefox-22.0beta3/mozilla-beta/build/ConfigStatus.py", line 117, in config_status
log_manager.add_terminal_logging(level=log_level)
File "/usr/obj/firefox-22.0beta3/mozilla-beta/python/mach/mach/logging.py", line 177, in add_terminal_logging
if self.terminal:
File "/usr/obj/firefox-22.0beta3/mozilla-beta/python/mach/mach/logging.py", line 149, in terminal
terminal = blessings.Terminal(stream=sys.stdout)
File "/usr/obj/firefox-22.0beta3/mozilla-beta/python/blessings/blessings/__init__.py", line 98, in __init__
self._init_descriptor)
_curses.error: setupterm: could not find terminal
python 2.7.4
| Reporter | ||
Comment 1•12 years ago
|
||
Same problem outside of tmux with TERM=xterm
| Reporter | ||
Comment 2•12 years ago
|
||
Running mach itself from trunk is fine, fwiw.
| Reporter | ||
Comment 3•12 years ago
|
||
Same with 22.0b1
| Reporter | ||
Comment 4•12 years ago
|
||
In a python shell, import curses + from curses import tigetstr, tigetnum, setupterm, tparm
doesnt throw an exception.
| Reporter | ||
Comment 5•12 years ago
|
||
import sys
import blessings
blessings.Terminal(stream=sys.stdout)
also works in a shell, so mach might be doing something strange here.
| Reporter | ||
Comment 6•12 years ago
|
||
Interestingly, running gmake -f client.mk configure from a mozilla-beta tree works fine on the same host. So something in the configure machineray ? In the build env ?
| Reporter | ||
Comment 7•12 years ago
|
||
Ah, running configure directly from the 22.0b3 tarball seems to pass :
mozilla-beta/ $CC=egcc CXX=eg++ ./configure --disable-necko-wifi
so probably something in the build env set by our port infrastructure....
| Reporter | ||
Comment 8•12 years ago
|
||
Ok, found it, and it's nasty.
our build infrastructure ignores the environment via env -i, so TERM is unset when it reaches blessings -> boom.
$env -i CC=egcc CXX=eg++ ./configure --disable-necko-wifi
that reproduces the issue here.
So:
- i can workaround this locally by setting TERM in the port build env, but this is ugly
- blessings/python curses ought to fallback sanely if TERM is empty/not set ?
| Reporter | ||
Updated•12 years ago
|
Summary: mach fails to setup terminal → mach: blessings/curses fails to setup terminal when TERM is not set
| Reporter | ||
Comment 9•12 years ago
|
||
Easily reproducible in a shell:
Python 2.7.4 (default, May 20 2013, 14:23:42)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>> from curses import setupterm
>>> setupterm('unknown',1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_curses.error: setupterm: could not find terminal
>>> setupterm('screen',1)
>>>
| Assignee | ||
Comment 10•12 years ago
|
||
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → gps
| Assignee | ||
Comment 11•12 years ago
|
||
Attachment #760556 -
Flags: review?(ted)
| Assignee | ||
Updated•12 years ago
|
Attachment #760555 -
Attachment is obsolete: true
| Reporter | ||
Comment 12•12 years ago
|
||
Comment on attachment 760556 [details] [diff] [review]
mach shouldn't fail if terminal couldn't be configured
Review of attachment 760556 [details] [diff] [review]:
-----------------------------------------------------------------
Att 760555 & 760556 were the same, was this intended ?
While i dont really like the idea of silently ignoring an error (i'd rather have blessings default to xterm or smth instead of 'unknown' when TERM is unset..) , with that patch i can run make configure in my ffx 22.0b3 port (which unsets TERM in the infrastructure) it doesnt blow, and i still get the output of configure & build logged on the terminal.
Attachment #760556 -
Flags: feedback+
| Assignee | ||
Comment 13•12 years ago
|
||
Without blessings configured, you would miss out on color and the build footer. That set may increase over time, of course. i.e. output would look very similar to |make -f client.mk|.
Comment 14•12 years ago
|
||
Comment on attachment 760556 [details] [diff] [review]
mach shouldn't fail if terminal couldn't be configured
Review of attachment 760556 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mach/mach/logging.py
@@ +157,4 @@
>
> + if terminal.is_a_tty:
> + self._terminal = terminal
> + except Exception as e:
Don't really need the "as e" bit here if you're just going to ignore it.
Attachment #760556 -
Flags: review?(ted) → review+
| Assignee | ||
Comment 15•12 years ago
|
||
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla24
Comment 16•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 17•12 years ago
|
||
Needs backport to aurora/beta..
status-firefox21:
--- → unaffected
status-firefox22:
--- → affected
status-firefox23:
--- → affected
status-firefox24:
--- → fixed
| Assignee | ||
Comment 18•12 years ago
|
||
Why should we backport this? Just build those trees without mach. It should be a trivial backport if we want to take it though.
| Reporter | ||
Comment 19•12 years ago
|
||
It's not a question of mach. I first saw the issue (see comment #1) when running the configure script from the 22.0b3 tarball, not planning at all to call mach.....
| Reporter | ||
Comment 20•12 years ago
|
||
I'm afraid this will hit distributors who build in a clean environment and will end up failing to run configure, but at that point it's too late for 22.0 which is already at candidate build2...
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•