Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 457530 (tinfo)

Summary: [TRACKER] Failures with sys-libs/ncurses[tinfo]
Product: Gentoo Linux Reporter: Justin Lecher (RETIRED) <jlec>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: normal CC: ahunt, dcday137, deference, esigra, foontala, konsolebox, lssndrbarbieri, pageexec, quentin, sam, scott, vivo75, wschlich
Priority: Normal Keywords: Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 460386, 692128, 692954, 754924, 884047, 890026, 369105, 453396, 454216, 454322, 454736, 455576, 455912, 456200, 456644, 456814, 457556, 457558, 457562, 457564, 457570, 458128, 458186, 458614, 459260, 459458, 459478, 459484, 459486, 459490, 459512, 459524, 459526, 459528, 459538, 459540, 459548, 459554, 459556, 459560, 459562, 459576, 459584, 459594, 459636, 459638, 459642, 459644, 459646, 459648, 459650, 459652, 459654, 459656, 459660, 459668, 459728, 459730, 459764, 459768, 459770, 459782, 459794, 459796, 460506, 461240, 461482, 462070, 462788, 464328, 464336, 466800, 468430, 468476, 468520, 468566, 468622, 468670, 475800, 481312, 481972, 483478, 483496, 483778, 484352, 486124, 490972, 490976, 494518, 497010, 497362, 497600, 498026, 498810, 498814, 501510, 503494, 504588, 505112, 505114, 506038, 507170, 508404, 509152, 509206, 509452, 514708, 520344, 520890, 521860, 525796, 525800, 526256, 526264, 526332, 526356, 526422, 526498, 526526, 526530, 526582, 526710, 526714, 526738, 526770, 526798, 526902, 526908, 527034, 527040, 527046, 527112, 527118, 527160, 527194, 527262, 527312, 527316, 527326, 527420, 527472, 527570, 527580, 527590, 527592, 527606, 527628, 527654, 527664, 527838, 527876, 528352, 528358, 528360, 528364, 528366, 528382, 528390, 528570, 528578, 528588, 529730, 529736, 529738, 529742, 529746, 529750, 529756, 529764, 529768, 529772, 529776, 529782, 529784, 529788, 529796, 529802, 529804, 529892, 531326, 531764, 536164, 539316, 540614, 547786, 548358, 550132, 551406, 551864, 553850, 558230, 558274, 558292, 558298, 559210, 560474, 562154, 562358, 564210, 568106, 578720, 578722, 588172, 588920, 595068, 595346, 596310, 596312, 596314, 597264, 597614, 598912, 601080, 601902, 602446, 603890, 605852, 606478, 609776, 613900, 615634, 617184, 618124, 621868, 621936, 621976, 628878, 632022, 633744, 634428, 636958, 643150, 646696, 646802, 646804, 646922, 647018, 647154, 647156, 647160, 647164, 647166, 648090, 648542, 649788, 652970, 654146, 665036, 670729, 671714, 672394, 673942, 675670, 677672, 677702, 677780, 677820, 678866, 678886, 679942, 680586, 681068, 682386, 683738, 685712, 687278, 687992, 690000, 690072, 690074, 690076, 690078, 690080, 690082, 690084, 690088, 690092, 690104, 690114, 690164, 690222, 690224, 690232, 690238, 690272, 690328, 690348, 690452, 690782, 690818, 690840, 690938, 691014, 691156, 691306, 692614, 692810, 693378, 694118, 695936, 698522, 700230, 700494, 702198, 708306, 709974, 714198, 724656, 725206, 729362, 729988, 731780, 753155, 764470, 775584, 776799, 777531, 791652, 803155, 808059, 816144, 843416, 844901, 883945, 930139    
Bug Blocks: 682392, 487844    
Attachments: Fix configure.ac to use pkg-config v2
ncurses-5.9-r3.ebuild.patch

Description Justin Lecher (RETIRED) gentoo-dev 2013-02-14 14:12:40 UTC
The newly introduced USE=tinfo in sys-libs/nurses forces some symbols from libncurses.so to be moved to libtinfo.so.

This means, your package needs to be linked in some situations against -lncurses -ltinfo (ncurses[tinfo]) instead of -lnurses (ncurses[-tinfo]).

Luckily there is a simple solution: Use pkg-config.

The ncurses package provides a .pc file, so the fixes should be straight forward with homebrewn as well as autotools, cmake and other buildsystems.
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-02-14 18:14:52 UTC
Adding a few in one go, I hope they are correct; if not, feel free to correct...
Comment 2 Andrew 2013-03-17 17:12:49 UTC
(In reply to comment #0)
> The newly introduced USE=tinfo in sys-libs/nurses forces some symbols from
> libncurses.so to be moved to libtinfo.so.
> 
> This means, your package needs to be linked in some situations against
> -lncurses -ltinfo (ncurses[tinfo]) instead of -lnurses (ncurses[-tinfo]).
> 
> Luckily there is a simple solution: Use pkg-config.

Sorry, I dont get it. What I as a user have to do to emerge broken packages (zsh, to be specific)?
Comment 3 Quentin Minster 2013-03-18 17:37:43 UTC
Don't know if this should be reported here, in a separate bug report or even at all, but this bug also seems to affect media-gfx/jp2a.
Build does *not* fail however, merely prints a warning, but ncurses-related options are missing from the resulting binary. Adding -ltinfo fixes the issue.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2013-03-18 18:08:24 UTC
(In reply to comment #3)
> Don't know if this should be reported here, in a separate bug report or even
> at all, but this bug also seems to affect media-gfx/jp2a.
> Build does *not* fail however, merely prints a warning, but ncurses-related
> options are missing from the resulting binary. Adding -ltinfo fixes the
> issue.

Never in the Tracker itself, always in a new bug
Comment 5 SpanKY gentoo-dev 2013-03-19 05:45:56 UTC
(In reply to comment #2)

as a normal user, you shouldn't be setting USE=tinfo in the first place
Comment 6 Andrew 2013-03-19 10:02:14 UTC
(In reply to comment #5)
> (In reply to comment #2)
> 
> as a normal user, you shouldn't be setting USE=tinfo in the first place

dev-util/nvidia-cuda-toolkit requires that.
Comment 7 Tomáš Cícha 2013-09-12 07:42:22 UTC
In case anyone needs a hotfix, just add /lib/libtinfo.so.5 to GROUP statement in /usr/lib/libncurses.so ld script (and similarly for libncursesw). Not very clean, but works for me so far for all affected packages.
Comment 8 Livid 2014-08-07 03:09:47 UTC
Created attachment 382428 [details, diff]
Fix configure.ac to use pkg-config v2

Sorry, this is corrected version. I forgot to remove function argument.
Comment 9 Livid 2014-08-07 03:10:28 UTC
Oh hell. Wrong bug. Sorry guys.
Comment 10 Reuben Martin 2014-10-18 17:25:01 UTC
Please add #508404 as "Depends On"
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-28 11:52:39 UTC
It's not as simple as switching pkg-config, as some packages simply need tinfo which was previously built into libncurses and now is not. Crudely linking against both isn't necessary for those cases.
Comment 12 Diego Elio Pettenò (RETIRED) gentoo-dev 2014-10-31 10:02:43 UTC
If they only need tinfo, and they are using autotools you can use AC_SEARCH_LIBS([cbreak], [tinfo ncurses])
Comment 13 Alan Grimes 2015-04-11 04:43:12 UTC
Request importance upgrade from "normal" to "blocking". I have lived with this bug for a year now, now it has completely compromised my system preventing emerge updates, must be fixed urgently.
Comment 14 Jacob Martin 2015-04-27 01:59:53 UTC
This bug affects me also on amd64.

I cannot emerge util-linux because of complaints about missing TERM_* variables when ncurses is compiled with tinfo (which I thought I needed because of nvidia-cuda-toolkit).  


Here's an example from compiling util-linux-2.25.2-r2 with ncurses built with tinfo:


/var/tmp/portage/sys-apps/util-linux-2.25.2-r2/work/util-linux-2.25.2/text-utils/more.c:1816:34: error: 'TERM_HARD_COPY' undeclared (first use in this function)
    if ((Lpp <= 0) || my_tgetflag(TERM_HARD_COPY)) {
                                  ^
/var/tmp/portage/sys-apps/util-linux-2.25.2-r2/work/util-linux-2.25.2/text-utils/more.c:1821:20: error: 'TERM_EAT_NEW_LINE' undeclared (first use in this function)
    if (my_tgetflag(TERM_EAT_NEW_LINE))
                    ^
/var/tmp/portage/sys-apps/util-linux-2.25.2-r2/work/util-linux-2.25.2/text-utils/more.c:1827:23: error: 'TERM_AUTO_RIGHT_MARGIN' undeclared (first use in this function)
    Wrap = my_tgetflag(TERM_AUTO_RIGHT_MARGIN);
Comment 15 SpanKY gentoo-dev 2015-04-27 03:40:10 UTC
(In reply to Jacob Martin from comment #14)

this is a tracker bug, not for reporting specific issues.  please create dedicated bugs instead.
Comment 16 Fernando Rodriguez 2015-07-06 00:12:00 UTC
Created attachment 406220 [details, diff]
ncurses-5.9-r3.ebuild.patch

Can't the ncurses package install a full libncurses.so along with libtinfo.so? I've patched the ebuild to do that by compiling twice and installing only the libtinfo libraries and .pc files from the one compiled with tinfo. The advantages are that all packages compile fine, and even if a package uses -lcurses and -ltinfo as long as -lcurses comes first it should only link against libcurses (one less library to load for most packages). The main disadvantage is the longer compile times but it's not too bad (on a slow laptop a multilib build went from 16 to 22 mins).
Comment 17 Brian Evans (RETIRED) gentoo-dev 2015-12-30 18:44:00 UTC
*** Bug 570284 has been marked as a duplicate of this bug. ***
Comment 18 David Seifert gentoo-dev 2016-03-22 09:24:03 UTC
A significant issue caused by the historically bad decision of ncurses upstream is to make pkg-config file installation optional. This means that autoconf consumers of ncurses cannot unconditionally rely on their presence, which means that developers in practice eschew relying solely on PKG_CHECK_MODULES() for finding ncurses, see:
https://moc.daper.net/node/1469
https://github.com/nzbget/nzbget/issues/188#issuecomment-198973436

I've raised this issue with upstream (https://lists.gnu.org/archive/html/bug-ncurses/2016-03/msg00011.html), but even if they decide to make .pc files non-optional, it will take years for this change to trickle down to 99% of users. So in the meantime, I've taken to fixing the AX_WITH_CURSES macro (https://github.com/peti/autoconf-archive/pull/69). It now first tries to use the pkg-config file to detect the proper flags (therefore being forward-compatible with future linkage changes), but will fall back to detecting the flags itself (including -ltinfo{,w} in ncurses 6). This should please upstream developers and Gentoo alike, as we can get pkg-config support and upstream does not have to solely rely on pkg-config. Does this sound like a tenable plan?
Comment 19 SpanKY gentoo-dev 2016-12-06 14:02:36 UTC
*** Bug 601764 has been marked as a duplicate of this bug. ***
Comment 20 konsolebox 2016-12-06 16:32:35 UTC
My bug report has just been marked duplicate of this: https://bugs.gentoo.org/show_bug.cgi?id=601764

I don't want to just let it become buried so I'll make a reply here:

Relying on pkg-config as a dynamic solution is good enough for finding the actual libraries to link against to during link-time, whether sys-libs/ncurses is enabled with tinfo or not.  It's more accurate than just having 'export LDFLAGS="-ltinfo ${LDFLAGS}" LIBS="-ltinfo ${LIBS}"', although more complicated and requires more work[arounds].

But, that doesn't make other packages built against libncurses to automatically compile against libtinfo when sys-libs/ncurses[-tinfo] suddenly changes to sys-libs/ncurses[tinfo], or vice-versa.  This would cause breakage unless revdep-rebuild is called.  But not all people would want to always have that workaround solution.  It would be better if rebuilding of packages would automatically be called during `emerge`, and that would make things _consistent_, and _synchronized_.  That could also avoid possible build-time errors with build tools relying on libtinfo during a world update.

Apply sys-libs/ncurses[tinfo=] to packages, and that would reduce the tinfo-related breakage reports.
Comment 21 SpanKY gentoo-dev 2016-12-07 16:34:28 UTC
(In reply to konsolebox from comment #20)

this bug is a tracker, not for discussion.  keep your thoughts in the other bug.
Comment 22 Joseph Booker 2017-01-13 22:58:06 UTC
I'm not sure if there is a simple way to check the names of the dependant bugs, but looking through the opened ones I don't see any dev-libs/libcec.
Comment 23 Roy Marples 2017-10-29 18:48:18 UTC
For applications which only make curses calls (such as curs_set(3)), is the expectation that they now need to explicity link against tinfo as well?
Comment 24 Henry Kohli 2018-03-30 17:36:47 UTC
i would like to add neomutt to the list 
https://github.com/neomutt/neomutt/issues/1118
Comment 25 ta2002 2018-04-09 20:06:08 UTC
Posted this in the forums, and was told to come here. :)

This is from a failed compile of net-misc/cgminer-4.10.0

-ldl -lcurl -ljansson -lpthread -lusb-1.0  -lrt -lm lib/libgnu.a ccan/libccan.a  -lncurses -lpthread 
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cgminer-cgminer.o: undefined reference to symbol 'halfdelay' 
/lib64/libtinfo.so.6: error adding symbols: DSO missing from command line 
collect2: error: ld returned 1 exit status
Comment 26 Mike Gilbert gentoo-dev 2018-04-11 14:56:24 UTC
(In reply to ta2002 from comment #25)

No talking here. If you wish to make a report, please create a new bug and make it block this one.
Comment 27 Jakub Hrbek 2019-04-10 10:15:25 UTC
Same issue on my setup https://gist.github.com/Kreyren/bc220910b26c07d4025d54a1de3c5eba

Some warning about Bug #457530 should be probably in place.