Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 654316 - www-client/firefox-59.0.2 : error: setupterm: could not find terminal
Summary: www-client/firefox-59.0.2 : error: setupterm: could not find terminal
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
: 663702 665522 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-04-29 11:34 UTC by Toralf Förster
Modified: 2018-09-09 02:45 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,15.78 KB, text/plain)
2018-04-29 11:34 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,78.42 KB, text/plain)
2018-04-29 11:35 UTC, Toralf Förster
Details
environment (environment,203.38 KB, text/plain)
2018-04-29 11:35 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,11.40 KB, application/x-bzip)
2018-04-29 11:35 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,30.52 KB, application/x-bzip)
2018-04-29 11:35 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,96.13 KB, application/x-bzip)
2018-04-29 11:35 UTC, Toralf Förster
Details
www-client:firefox-59.0.2:20180427-174049.log (www-client:firefox-59.0.2:20180427-174049.log,49.38 KB, text/plain)
2018-04-29 11:35 UTC, Toralf Förster
Details
emerge-info.txt (emerge-info.txt,16.77 KB, text/plain)
2018-09-07 21:16 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,245.06 KB, text/plain)
2018-09-07 21:16 UTC, Toralf Förster
Details
environment (environment,208.35 KB, text/plain)
2018-09-07 21:16 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,23.68 KB, application/x-bzip)
2018-09-07 21:17 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,30.44 KB, application/x-bzip)
2018-09-07 21:17 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,97.17 KB, application/x-bzip)
2018-09-07 21:17 UTC, Toralf Förster
Details
www-client:firefox-62.0-r1:20180907-204449.log (www-client:firefox-62.0-r1:20180907-204449.log,49.73 KB, text/plain)
2018-09-07 21:17 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2018-04-29 11:34:55 UTC
The details of the failure are as follows:

error: setupterm: could not find terminal

  File "/var/tmp/portage/www-client/firefox-59.0.2/work/mozilla-release-239e434d6d2b8e1e2b697c3416d1e96d48fe98e5/python/mozbuild/mozbuild/mach_commands.py", line 171, in build
    mach_context=self._mach_context)

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0-desktop-gnome_20180425-205446

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.0 *

Available Python interpreters, in order of preference:
  [1]   python3.5
  [2]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby22 (with Rubygems)
  [2]   ruby23 (with Rubygems) *
java-config:
The following VMs are available for generation-2:
1)	IcedTea JDK 3.7.0 [icedtea-8]
*)	IcedTea JDK 3.7.0 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-8 
  [2]   icedtea-bin-8  system-vm

emerge -qpv www-client/firefox
[ebuild  N    ] www-client/firefox-59.0.2  USE="dbus gmp-autoupdate pulseaudio screenshot startup-notification -bindist -custom-cflags -custom-optimization -debug -eme-free -hardened -hwaccel -jack (-neon) (-selinux) -system-harfbuzz -system-icu -system-jpeg -system-libevent -system-libvpx -system-sqlite {-test} -wifi" L10N="-ach -af -an -ar -as -ast -az -bg -bn-BD -bn-IN -br -bs -ca -cak -cs -cy -da -de -dsb -el -en-GB -en-ZA -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mai -mk -ml -mr -ms -nb -nl -nn -or -pa -pl -pt-BR -pt-PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv -ta -te -th -tr -uk -uz -vi -xh -zh-CN -zh-TW"
Comment 1 Toralf Förster gentoo-dev 2018-04-29 11:34:58 UTC
Created attachment 528806 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-04-29 11:35:01 UTC
Created attachment 528808 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2018-04-29 11:35:04 UTC
Created attachment 528810 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2018-04-29 11:35:07 UTC
Created attachment 528812 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2018-04-29 11:35:10 UTC
Created attachment 528814 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2018-04-29 11:35:13 UTC
Created attachment 528816 [details]
temp.tbz2
Comment 7 Toralf Förster gentoo-dev 2018-04-29 11:35:16 UTC
Created attachment 528818 [details]
www-client:firefox-59.0.2:20180427-174049.log
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-30 06:57:22 UTC
I get the same error when building packages from systemd's timers unit (empty environment)

My theory is the following:
- new ncurses now returns an error when TERM variable is not set instead of defaulting to dumb
- binaries that rely on TERM to be set fail now

It looks like in this case user has to set TERM manually somewhere.
Comment 9 Ian Stakenvicius (RETIRED) gentoo-dev 2018-08-15 18:41:33 UTC
*** Bug 663702 has been marked as a duplicate of this bug. ***
Comment 10 Zac Medico gentoo-dev 2018-08-15 18:49:02 UTC
Maybe do something like this in the ebuild or eclass:

export TERM=${TERM:-dumb}
Comment 11 Larry the Git Cow gentoo-dev 2018-08-15 19:30:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=10516a58d09b92067afd195622d2b021563582b8

commit 10516a58d09b92067afd195622d2b021563582b8
Author:     Ian Stakenvicius <axs@gentoo.org>
AuthorDate: 2018-08-15 19:29:35 +0000
Commit:     Ian Stakenvicius <axs@gentoo.org>
CommitDate: 2018-08-15 19:29:35 +0000

    mozcoreconf: attempt workaround for occasional setupterm-based build error
    
    Bug: http://bugs.gentoo.org/654316

 eclass/mozcoreconf-v6.eclass | 3 +++
 1 file changed, 3 insertions(+)
Comment 12 Ian Stakenvicius (RETIRED) gentoo-dev 2018-08-16 17:47:07 UTC
(In reply to Larry the Git Cow from comment #11)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/proj/mozilla.git/commit/
> ?id=10516a58d09b92067afd195622d2b021563582b8

So that failed -- the issue is not the TERM variable it seems.  

setupterm is being called from a python lib 'blessings' that enables pretty-printing; for some unknown reason its not only failing, but the try..catch that looks to surround it to provide a fallback is also not working properly.

Working with toralf on this directly via irc, since tinderboxing seems to be the easiest way to reproduce.
Comment 13 Toralf Förster gentoo-dev 2018-09-07 21:16:48 UTC
got at the unstable amd64 chroot image 17.0-developer_abi32+64_20180831-160502 this too, so attach files here too to help to find the root cause
Comment 14 Toralf Förster gentoo-dev 2018-09-07 21:16:51 UTC
Created attachment 546208 [details]
emerge-info.txt
Comment 15 Toralf Förster gentoo-dev 2018-09-07 21:16:55 UTC
Created attachment 546210 [details]
emerge-history.txt
Comment 16 Toralf Förster gentoo-dev 2018-09-07 21:16:59 UTC
Created attachment 546212 [details]
environment
Comment 17 Toralf Förster gentoo-dev 2018-09-07 21:17:02 UTC
Created attachment 546214 [details]
etc.portage.tbz2
Comment 18 Toralf Förster gentoo-dev 2018-09-07 21:17:05 UTC
Created attachment 546216 [details]
logs.tbz2
Comment 19 Toralf Förster gentoo-dev 2018-09-07 21:17:09 UTC
Created attachment 546218 [details]
temp.tbz2
Comment 20 Toralf Förster gentoo-dev 2018-09-07 21:17:12 UTC
Created attachment 546220 [details]
www-client:firefox-62.0-r1:20180907-204449.log
Comment 21 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-08 12:10:48 UTC
> TERM="unknown"

is  your problem. Please fix your setup and set a known/supported TERM.

See the bug added to "See also" for more details (for example it is possible that an upgrade in the past went wrong causing TERM=unknown for you).

Please re-open is this is still a problem with a known TERM environment variable.
Comment 22 Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-08 12:14:32 UTC
What should be the TERM value if there is not terminal present at all? (cron-based builds)
Comment 23 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-08 12:32:05 UTC
Some packages using blessing are forcing "linux" or "xterm" for CI runs to workaround this limitation. I am wondering if you have explicit set this to TERM="unknown" on your own? In this case I would say "That's an error caused by an invalid user configuration. What did user expect when setting TERM to something its system doesn't support?"

But I just found the following fix: https://github.com/erikrose/blessings/pull/137

So this should be go away in future.

Can you tell me if you set this on your own or did you haven't set TERM at all?

Maybe I'll add the blessing fix to our Mozilla patch set...
Comment 24 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-08 12:48:25 UTC
(In reply to Thomas Deutschmann from comment #23)
> Can you tell me if you set this on your own or did you haven't set TERM at
> all?

Answered on my own, I can reproduce with no TERM set. So I'll bump patch set.
Comment 25 Larry the Git Cow gentoo-dev 2018-09-08 13:34:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46adb588dc7afaec3745c9672ea481f2302d5e52

commit 46adb588dc7afaec3745c9672ea481f2302d5e52
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-09-08 13:20:17 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-09-08 13:34:18 +0000

    www-client/firefox: allow building without TERM being set
    
    Link 1: https://bugzilla.mozilla.org/show_bug.cgi?id=1432867
    Link 2: https://github.com/erikrose/blessings/pull/137
    Closes: https://bugs.gentoo.org/654316
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 .../files/firefox-52.9.0-blessings-TERM.patch      | 56 ++++++++++++++++++++++
 .../files/firefox-60.0-blessings-TERM.patch        | 56 ++++++++++++++++++++++
 www-client/firefox/firefox-52.9.0.ebuild           |  4 +-
 www-client/firefox/firefox-60.2.0.ebuild           |  3 +-
 www-client/firefox/firefox-62.0-r1.ebuild          |  2 +
 5 files changed, 119 insertions(+), 2 deletions(-)
Comment 26 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-09 01:50:02 UTC
*** Bug 665522 has been marked as a duplicate of this bug. ***
Comment 27 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-09 01:51:18 UTC
Confirmed, calling with TERM= fails.
Comment 28 Larry the Git Cow gentoo-dev 2018-09-09 02:43:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61f2b686d018838df528cb143f6fe3458331de5d

commit 61f2b686d018838df528cb143f6fe3458331de5d
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-09-09 02:25:40 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-09-09 02:43:44 +0000

    www-client/firefox: update blessings patch to force TERM value
    
    Closes: https://bugs.gentoo.org/654316
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 www-client/firefox/files/firefox-52.9.0-blessings-TERM.patch | 2 +-
 www-client/firefox/files/firefox-60.0-blessings-TERM.patch   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 29 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-09 02:45:28 UTC
A bad TERM value like " " or a real bad value (e.g. unsupported terminal) may still cause the same failure but we are not going to catch them all. Unset TERM variable or empty TERM variable must be enough (I hope).