Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 816144 - dev-lang/swi-prolog-8.2.3-r2: Fails to compile tty support
Summary: dev-lang/swi-prolog-8.2.3-r2: Fails to compile tty support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Gentoo Prolog project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: tinfo
  Show dependency tree
 
Reported: 2021-10-03 22:58 UTC by Vladimir Mihajlovic
Modified: 2021-11-14 14:44 UTC (History)
2 users (show)

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


Attachments
CMakeError.log, note line 661 (CMakeError.log,65.56 KB, text/x-log)
2021-10-03 22:58 UTC, Vladimir Mihajlovic
Details
ebuild that works on my box (swi-prolog-8.2.3-r2.ebuild,2.88 KB, text/plain)
2021-10-05 01:31 UTC, Vladimir Mihajlovic
Details
build.log (build.log,130.31 KB, text/plain)
2021-10-23 16:53 UTC, Anna Vyalkova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Mihajlovic 2021-10-03 22:58:35 UTC
Created attachment 742854 [details]
CMakeError.log, note line 661

Issue can be reproduced with swipl -g 'tty_size(X, Y).'.

Seems like build process fails to detect both ncurses and tgetent during configure phase, which prevents TTY support from being compiled into swipl binary.

CMakeError.log is in attachment.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-04 00:46:01 UTC
We talked about this a bit on IRC in #gentoo-dev-help:


[23:27:03]  <tockitj> there is the line where it creates a small c file and tries to link it to use tgetent
[23:28:11]  <tockitj> /usr/bin/x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -fno-strict-aliasing -DCHECK_FUNCTION_EXISTS=tgetent -Wl,-O1 -Wl,--as-needed CMakeFiles/cmTC_0c92b.dir/CheckFunctionExists.c.o -o cmTC_0c92b  -ldl  -lm  -lrt  -lcurses  /usr/lib64/libform.so  /usr/lib64/libgmp.so  -lpthread 
[23:33:02]  <@sam_> cmake/Config.cmake:199:check_function_exists(tgetent HAVE_TGETENT)
[23:33:05]  <@sam_> check_function_exists is old
[23:34:05]  <@sam_> it doesn't realise it needs to use -ltinfo to get tgetent
[23:34:16]  <@sam_> but it appears it's a pain to make check_function_exists work properly
Comment 2 Vladimir Mihajlovic 2021-10-05 01:31:23 UTC
Created attachment 743013 [details]
ebuild that works on my box

I have resolved this on my machine. Solution adds flags to CMake so it can detect split tinfo libs. I doubt my ebuild is production ready, but it might help dev that gets the ticket.
Comment 3 Vladimir Mihajlovic 2021-10-05 01:36:08 UTC
The way to test if tty_size works would be:

`swipl -g 'tty_size(X, Y), write("TTY window size "), write(x: X), write(", "), write(y: Y), nl, halt.'`
Comment 4 Keri Harris gentoo-dev 2021-10-10 18:57:50 UTC
Thanks for reporting this bug and taking the time to produce a fix. swi-prolog-8.2.4-r3 and swi-prolog-8.3.29-r1 have been included in git with the relevant fix.
Comment 5 Larry the Git Cow gentoo-dev 2021-10-10 18:58:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5996630a9a0e15e32f629cbff295187b020ff510

commit 5996630a9a0e15e32f629cbff295187b020ff510
Author:     Keri Harris <keri@gentoo.org>
AuthorDate: 2021-10-10 18:56:07 +0000
Commit:     Keri Harris <keri@gentoo.org>
CommitDate: 2021-10-10 18:58:04 +0000

    dev-lang/swi-prolog: use pkg-config to determine ncurses link flags
    
    Closes: https://bugs.gentoo.org/816144
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Keri Harris <keri@gentoo.org>

 dev-lang/swi-prolog/swi-prolog-8.2.4-r3.ebuild  | 127 +++++++++++++++++++++++
 dev-lang/swi-prolog/swi-prolog-8.3.29-r1.ebuild | 128 ++++++++++++++++++++++++
 2 files changed, 255 insertions(+)
Comment 6 Anna Vyalkova 2021-10-23 16:53:01 UTC
Created attachment 746349 [details]
build.log

Linking libswipl.so fails now ("undefined reference to `tgetnum'")
Comment 7 Keri Harris gentoo-dev 2021-11-14 14:44:25 UTC
(In reply to jan Anja from comment #6)
> Created attachment 746349 [details]
> build.log
> 
> Linking libswipl.so fails now ("undefined reference to `tgetnum'")

I've made a modification to the ebuild to support building when as-needed has been defined in CFLAGS.