Bug 13146 - bitbake virtual/kernel -c menuconfig dependencies
Summary: bitbake virtual/kernel -c menuconfig dependencies
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: kernel (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.8 M4
Assignee: Robert Berger
QA Contact:
URL:
Whiteboard:
: 13164 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-01-19 14:14 UTC by Robert Berger
Modified: 2020-07-23 07:48 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Berger 2019-01-19 14:14:48 UTC
This and similar issues were already posted before[1][2]

[1] https://lists.yoctoproject.org/pipermail/yocto/2016-September/032177.html
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=7609

IMHO it boils down to host dependencies.

Like e.g.

libncurses5-dev
libncursesw5-dev 
flex 
bison
libtinfo-dev
...

and maybe others missing for menuconfig to work.

The question is how to deal with it.

The first line of defence would be to 

1) add missing packages to the Manual[3]

[3] https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#required-packages-for-the-build-host

2) Is it feasible to build those libs host distro independent?

Someone might have a better idea what can be done.
Comment 1 Richard Purdie 2019-01-24 15:39:36 UTC
There are probably two things needed here:

a) To run a sanity test and error if the needed prerequisites aren't present when running menuconfig

b) See if we can use the native dependencies (ensuring BUILD_CFLAGS and BUILD_LDFLAGS are set)
Comment 2 Ross Burton 2019-01-24 15:40:25 UTC
Indeed, my first thought was shouldn't the menuconfig task depend on ncurses-native.
Comment 3 Bruce Ashfield 2019-01-24 18:38:13 UTC
I'll try and drag up all the history on this, but we've been all around this several times.

There are various incompatibilities with ncurses and how it is built (leading to garbled output) as well as getting the kernel to actually properly use our libraries when they are made available.

There have been -native attempts, various variables, host dependencies, etc, that have all not fully solved issues.

What exactly is the problem that is being seen ? That menuconfig simply fails to build and run due to missing libraries ? What distro, etc, are we talking about. Experience shows that we need to capture all the details before coming up with any potential fixes.
Comment 4 Robert Berger 2019-01-24 19:14:38 UTC
Hi Bruce,

Yes it's menuconfig which fails to build due to missing libraries and "rookies" stumbling over it. I would just go and install the missing libs on the host and all is good. (although this is rather un-nice since actually everything needed should either be built by OE/the YP or it should be detected that stuff is missing and some kind of warning should be spit out). 

I see it on Ubuntu 16, but I guess the same problem exists on all distros.

As I said initially:

The first line of defence would be to 

1) add missing packages to the Manual[3]

[3] https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#required-packages-for-the-build-host

This would be fine for me ;)

====

Having said that, if it's possible to come up with a generic solution which works everywhere, that would be great, but I from what you say this is most likely not so straight forward.

====
Comment 5 f.bre 2019-01-25 11:20:11 UTC
On Ubuntu-16.04, "bitbake -c menuconfig <linux-kernel-name>" reports
mconf.c:(.text+0x8a4): undefined reference to `stdscr'.

I needed to spend a lot of frustrating time to find out I have to solve this very cryptic error by installing the following 2 packages via Synaptic:
- libncurses5-dev
- libtinfo-dev
Comment 6 Scott Rifenbark 2019-01-25 18:32:25 UTC
Hi, 

I can add the packages to the list of required host packages now for the 2.7 version of the manuals.  Should I go ahead and do that?

Scott
Comment 7 Ross Burton 2019-01-25 19:15:29 UTC
They're only required for menuconfig to work, so I wouldn't want them in the required dependencies section.  Can we just list them in the kernel's menuconfig section?
Comment 8 Scott Rifenbark 2019-01-25 20:18:53 UTC
Thanks Ross - I will update this section - https://yoctoproject.org/docs/2.7/mega-manual/mega-manual.html#using-menuconfig

Scott
Comment 9 Robert Berger 2019-01-26 09:10:43 UTC
Just as a side note:

except for 

bitbake virtual/kernel -c menuconfig 

we also have (at least)

bitbake busybox -c menuconfig

where I assume the same/similar native dependencies are required.

Aso I notices the meta/classes/cml1.bbclass which tries to do something about it:

CROSS_CURSES_LIB = "-lncurses -ltinfo"
CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"

KCONFIG_CONFIG_COMMAND ??= "menuconfig"
python do_menuconfig() {
...
}

do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
do_menuconfig[nostamp] = "1"


This class is inherited by the kernel and busybox.

meta/classes/kernel.bbclass:inherit cml1
meta/recipes-core/busybox/busybox.inc:inherit cml1
Comment 10 Ross Burton 2019-02-04 23:00:07 UTC
*** Bug 13164 has been marked as a duplicate of this bug. ***
Comment 11 Scott Rifenbark 2019-02-21 20:33:55 UTC
Hi, 

See https://yoctoproject.org/docs/2.7/kernel-dev/kernel-dev.html#using-menuconfig for a modification to the section telling how to run menuconfig.  Please let me know if this takes care of the documentation component of this issue.

Thanks, 
Scott
Comment 12 f.bre 2019-02-26 11:03:51 UTC
(In reply to comment #11)
> Please let me know if this takes care of the documentation component of this
> issue.
yeah, looks great.
Comment 13 Scott Rifenbark 2019-03-04 21:51:25 UTC
Thanks for checking the doc changes....   I don't own this bug so I am leaving the status alone.  But, I am marking the docs flag to "done."

Scott
Comment 14 Bruce Ashfield 2019-03-28 02:33:21 UTC
As the history shows, we did get the documentation part done. But the code changes (including sanity checks) didn't fit into the schedule so far.

I'll see if I can get the sanity checks done for the missing host packages as part of m4.

The work to use -native dependencies is better suited to the next release, since there are quite a few distro/libs/linkers/compilers that need to be tested before we are sure it works (as witnessed by the fact that menuconfig already depends on ncurses-native, but yet we still were seeing that the host required ncurses-dev packages installed ..).
Comment 15 Scott Rifenbark 2019-08-15 17:30:13 UTC
Thanks!
Comment 16 Scott Rifenbark 2019-08-15 17:34:19 UTC
Waiting on Sanity checks...
Comment 17 Scott Rifenbark 2019-08-15 17:40:37 UTC
Still no additional information on this bug.  Fixed from the documentation point of view.

Scott
Comment 18 Scott Rifenbark 2019-08-15 17:43:36 UTC
Still no additional information on this bug.  Fixed from the documentation point of view.

Scott
Comment 19 Bruce Ashfield 2019-08-27 15:16:58 UTC
can someone send me the distro details to reproduce the problem ? (and preferably the details on how to create it in a docker container). I'm unable to reproduce the host dependency issue, so I'd only be guessing at fixes.
Comment 20 Randy MacLeod 2019-10-17 14:48:03 UTC
There have been some commits to address this. It works for most people.
If there's still a problem for your build, open a new defect with detailed information about the host and configuration please. Ensure that you have ncurses-dev installed on your host. That requirement is contentious but exists currently. -- Randy