<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13146</bug_id>
          
          <creation_ts>2019-01-19 14:14:48 +0000</creation_ts>
          <short_desc>bitbake virtual/kernel -c menuconfig dependencies</short_desc>
          <delta_ts>2020-07-23 07:48:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>kernel</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Robert Berger">pokylinux</assigned_to>
          <cc>f.bre</cc>
    
    <cc>marc.ferland</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>srifenbark</cc>
    
    <cc>tom.zanussi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82830</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-01-19 14:14:48 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82842</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-01-24 15:39:36 +0000</bug_when>
    <thetext>There are probably two things needed here:

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

b) See if we can use the native dependencies (ensuring BUILD_CFLAGS and BUILD_LDFLAGS are set)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82843</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-01-24 15:40:25 +0000</bug_when>
    <thetext>Indeed, my first thought was shouldn&apos;t the menuconfig task depend on ncurses-native.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82853</commentid>
    <comment_count>3</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2019-01-24 18:38:13 +0000</bug_when>
    <thetext>I&apos;ll try and drag up all the history on this, but we&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82854</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-01-24 19:14:38 +0000</bug_when>
    <thetext>Hi Bruce,

Yes it&apos;s menuconfig which fails to build due to missing libraries and &quot;rookies&quot; 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&apos;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.

====</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82863</commentid>
    <comment_count>5</comment_count>
    <who name="">f.bre</who>
    <bug_when>2019-01-25 11:20:11 +0000</bug_when>
    <thetext>On Ubuntu-16.04, &quot;bitbake -c menuconfig &lt;linux-kernel-name&gt;&quot; reports
mconf.c:(.text+0x8a4): undefined reference to `stdscr&apos;.

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82873</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-01-25 18:32:25 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82876</commentid>
    <comment_count>7</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-01-25 19:15:29 +0000</bug_when>
    <thetext>They&apos;re only required for menuconfig to work, so I wouldn&apos;t want them in the required dependencies section.  Can we just list them in the kernel&apos;s menuconfig section?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82877</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-01-25 20:18:53 +0000</bug_when>
    <thetext>Thanks Ross - I will update this section - https://yoctoproject.org/docs/2.7/mega-manual/mega-manual.html#using-menuconfig

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82878</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-01-26 09:10:43 +0000</bug_when>
    <thetext>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 = &quot;-lncurses -ltinfo&quot;
CROSS_CURSES_INC = &apos;-DCURSES_LOC=&quot;&lt;curses.h&gt;&quot;&apos;
TERMINFO = &quot;${STAGING_DATADIR_NATIVE}/terminfo&quot;

KCONFIG_CONFIG_COMMAND ??= &quot;menuconfig&quot;
python do_menuconfig() {
...
}

do_menuconfig[depends] += &quot;ncurses-native:do_populate_sysroot&quot;
do_menuconfig[nostamp] = &quot;1&quot;


This class is inherited by the kernel and busybox.

meta/classes/kernel.bbclass:inherit cml1
meta/recipes-core/busybox/busybox.inc:inherit cml1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82961</commentid>
    <comment_count>10</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-02-04 23:00:07 +0000</bug_when>
    <thetext>*** Bug 13164 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83081</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-02-21 20:33:55 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83122</commentid>
    <comment_count>12</comment_count>
    <who name="">f.bre</who>
    <bug_when>2019-02-26 11:03:51 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Please let me know if this takes care of the documentation component of this
&gt; issue.
yeah, looks great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83186</commentid>
    <comment_count>13</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-03-04 21:51:25 +0000</bug_when>
    <thetext>Thanks for checking the doc changes....   I don&apos;t own this bug so I am leaving the status alone.  But, I am marking the docs flag to &quot;done.&quot;

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83349</commentid>
    <comment_count>14</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2019-03-28 02:33:21 +0000</bug_when>
    <thetext>As the history shows, we did get the documentation part done. But the code changes (including sanity checks) didn&apos;t fit into the schedule so far.

I&apos;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 ..).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84695</commentid>
    <comment_count>15</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-08-15 17:30:13 +0000</bug_when>
    <thetext>Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84696</commentid>
    <comment_count>16</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-08-15 17:34:19 +0000</bug_when>
    <thetext>Waiting on Sanity checks...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84697</commentid>
    <comment_count>17</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-08-15 17:40:37 +0000</bug_when>
    <thetext>Still no additional information on this bug.  Fixed from the documentation point of view.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84698</commentid>
    <comment_count>18</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-08-15 17:43:36 +0000</bug_when>
    <thetext>Still no additional information on this bug.  Fixed from the documentation point of view.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84752</commentid>
    <comment_count>19</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2019-08-27 15:16:58 +0000</bug_when>
    <thetext>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&apos;m unable to reproduce the host dependency issue, so I&apos;d only be guessing at fixes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85363</commentid>
    <comment_count>20</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-10-17 14:48:03 +0000</bug_when>
    <thetext>There have been some commits to address this. It works for most people.
If there&apos;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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>