Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 651644 - dev-java/gradle-bin with sys-libs/ncurses-6.1-r2 - TERM=xterm-256color issue: Could not open terminal for stdout: could not get termcap entry
Summary: dev-java/gradle-bin with sys-libs/ncurses-6.1-r2 - TERM=xterm-256color issue:...
Status: RESOLVED DUPLICATE of bug 648720
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ncurses-6.1
  Show dependency tree
 
Reported: 2018-03-26 19:10 UTC by James Baldassari
Modified: 2020-09-06 10:11 UTC (History)
14 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Baldassari 2018-03-26 19:10:40 UTC
Since upgrading to ncurses-6.1-r2 from ncurses-6.0-r1 I can no longer run Gradle with TERM=xterm-256color

$ ./gradlew 

FAILURE: Build failed with an exception.

* What went wrong:
Could not open terminal for stdout: could not get termcap entry


There is a related Gradle issue here: https://github.com/gradle/gradle/issues/4426

Arch users have solved the problem by upgrading ncurses to 6.1-r3, and there also seems to be some issue related to a ncurses5-compat-libs package that Gentoo doesn't have.  Maybe updating to upstream 6.1-r3 will solve the problem?

I did _not_ emerge ncurses with minimal, and I _do_ seem to have the xterm-256color files here:

$ ls -l /usr/lib/terminfo/x | grep xterm-256color
lrwxrwxrwx 1 root root   41 Mar 26 14:54 xterm-256color -> ../../../../etc/terminfo/x/xterm-256color

$ ls -l /etc/terminfo/x/xterm-256color 
-rw-r--r-- 1 root root 3713 Mar 26 14:54 /etc/terminfo/x/xterm-256color

Some other info:

$ echo $TERM
xterm-256color

$ tset -q
xterm-256color

Setting TERM=xterm-color before running Gradle works fine, so the problem seems to be specific to xterm-256color.  If there is any other info I can provide to help debug the issue please let me know.
Comment 1 Robert G. Siebeck 2018-03-26 19:54:17 UTC
Same problem here. Your proposed workaround (setting TERM=xterm-color) also works for me.
Comment 2 Andrej Kacian 2018-04-08 17:00:33 UTC
This is probably the same root cause - when trying to reattach screen, it complains about missing termcap info:

ticho@vala ~ $ echo $TERM
xterm-256color
ticho@vala ~ $ screen -r
Cannot find terminfo entry for 'xterm-256color'.
ticho@vala ~ $ 

This started after upgrading ncurses from 6.0-r1 to 6.1-r2, just like James mentions.

It doesn't seem to be caused by the fact that with 6.1-r2, the entry is a symlink, because "xterm-color" is also a symlink, and it works. I think the contents of the "xterm-256color" are wrong, but as I do not have any experience with how exactly terminfo works, this is just a layman's observation.
Comment 3 Rémi Cardona (RETIRED) gentoo-dev 2018-04-16 05:48:27 UTC
(In reply to Andrej Kacian from comment #2)
> This is probably the same root cause - when trying to reattach screen, it
> complains about missing termcap info:
> 
> ticho@vala ~ $ echo $TERM
> xterm-256color
> ticho@vala ~ $ screen -r
> Cannot find terminfo entry for 'xterm-256color'.
> ticho@vala ~ $ 
> 
> This started after upgrading ncurses from 6.0-r1 to 6.1-r2, just like James
> mentions.

Rebuilding screen helped, in my case. If it works for you too, that would suggest a subtle ABI change.
Comment 4 RAPHEAD 2018-04-20 12:37:17 UTC
Had the same issue and I can confirm that export TERM=xterm-color solved it for me.
Comment 5 tux_mind 2018-06-14 09:58:22 UTC
FYI an Arch user fixed it: https://github.com/gradle/gradle/issues/4426#issuecomment-367289638

The relevant changed in the PKGBUILD are:

```
   ln -s /usr/lib/libncurses.so.5 "$pkgdir/usr/lib/libtinfo.so.5"
-  ln -s /usr/lib/libncurses.so.5 "$pkgdir/usr/lib/libtic.so.5"
```

It does not create the `libtic` symlink to the ncurses one.

On my system I cannot find neither `libtic` nor `libtinfo`.

Even on http://www.portagefilelist.de I was unable to find who own those 2 libraries.

I hope to been of some help.
Comment 6 Ladislav Zitka 2018-06-17 12:07:18 UTC
I also confirm that I can now build with gradle again after exporting TERM=....
Comment 7 Simon 2018-06-18 17:26:28 UTC
Just ran into the same issue. Has anyone figured out a root cause?

I'm not sure the libtinfo and libtic references are relevant, just did a strace ./gradlew and that only shows "/lib64/libreadline.so.7" and "/lib64/libncurses.so.6" (among other ones of course, but I doubt they're related to this issue).

Could it be an ABI change in ncurses? That seems to at least be the reason people were experiencing issues with screen.
Comment 8 SpanKY gentoo-dev 2018-06-25 21:57:09 UTC

*** This bug has been marked as a duplicate of bug 648720 ***
Comment 9 Joakim Tjernlund 2019-10-16 16:24:42 UTC
see https://bugs.gentoo.org/648720