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

Bug 924193

Summary: sys-apps/toybox-0.8.10 menuconfig fails to find -lcurses
Product: Gentoo Linux Reporter: hairu <boulvalex>
Component: Current packagesAssignee: Patrick Lauer <patrick>
Status: UNCONFIRMED ---    
Severity: normal CC: boulvalex, joe
Priority: Normal Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: https://github.com/landley/toybox/issues/13
See Also: https://github.com/landley/toybox/pull/332
https://github.com/gentoo/gentoo/pull/35256
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 837812    
Attachments: patch to permit make menuconfig

Description hairu 2024-02-10 05:24:21 UTC
When preparing a savedconfig for sys-apps/toybox by running make menuconfig an error was encountered relating to the curses library not being found.

Reproducible: Always

Steps to Reproduce:
1. emerge --fetchonly =sys-apps/toybox-0.8.10
2. tar xzf /var/cache/distfiles/toybox-0.8.10.tar.gz
3. cd toybox-0.8.10
4. make menuconfig
Actual Results:  
make menuconfig
cc -o kconfig/mconf kconfig/mconf.c kconfig/zconf.tab.c \
        kconfig/lxdialog/*.c -lcurses -DCURSES_LOC="<ncurses.h>" \
        -DKBUILD_NO_NLS=1 -DPROJECT_NAME=\"ToyBox\"
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: cannot find -lcurses: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [kconfig/Makefile:72: kconfig/mconf] Error 1

Expected Results:  
Command enters menuconfig interface.

A trivial patch changing -lcurses to -lcurses -ltinfo solves the issue.
Comment 1 hairu 2024-02-10 05:25:27 UTC
Created attachment 884647 [details, diff]
patch to permit make menuconfig
Comment 2 hairu 2024-02-10 05:28:43 UTC
Correction to description:

A trivial patch changing -lcurses to -lncurses -ltinfo solves the issue.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-10 07:43:30 UTC
Commented at https://github.com/landley/toybox/pull/332#issuecomment-1936917705 to explain the situation.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-10 07:43:41 UTC
(In reply to hairu from comment #2)
> Correction to description:
> 
> A trivial patch changing -lcurses to -lncurses -ltinfo solves the issue.

It should be using pkg-config.
Comment 5 Joe Kappus 2024-02-10 08:08:00 UTC
> It should be using pkg-config.

Yes, to follow what Linux kernel's build system does. Upstream won't accept attached patch because it will probably break other OS/embedded targets and they won't want an extra dep that the PR brings. 

However, should Gentoo patch it in even though portage won't hit this issue installing sys-apps/toybox? This is only triggered if building from source and accessing menuconfig.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-10 08:08:48 UTC
(In reply to Joe Kappus from comment #5)
> > It should be using pkg-config.
> 
> Yes, to follow what Linux kernel's build system does. Upstream won't accept
> attached patch because it will probably break other OS/embedded targets and
> they won't want an extra dep that the PR brings. 
> 

I did comment on the PR and I suspect that's somewhat bogus.

> However, should Gentoo patch it in even though portage won't hit this issue
> installing sys-apps/toybox? This is only triggered if building from source
> and accessing menuconfig.

We should patch it in, where the patch uses pkg-config, yes.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-10 08:13:41 UTC
(In reply to Sam James from comment #6)
> We should patch it in, where the patch uses pkg-config, yes.

(although ofc it wouldn't have actually helped with the original reproduction instructions, it would with "ebuild ... clean prepare" then menuconfig.)
Comment 8 hairu 2024-02-10 08:18:53 UTC
Good points. Essentially, a potential embedded gentoo built with crossdev would only require a compile machine to have pkg-config installed. This said, an ebuild wouldn't usually hit this bug because menuconfig is not used. I agree with "ebuild ... clean prepare" being the way to go, along with a notice from the ebuild with instructions to do so for menuconfig.