<?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>8593</bug_id>
          
          <creation_ts>2015-10-28 03:47:50 +0000</creation_ts>
          <short_desc>The head files of ncurses installing into sysroot seems different in multiple times compilation</short_desc>
          <delta_ts>2017-06-06 12:35:14 +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>core</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.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yunming Shi">emincemnt</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55870</commentid>
    <comment_count>0</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2015-10-28 03:47:50 +0000</bug_when>
    <thetext>The head files of ncurses installing into sysroot seems different in multiple times compilation:
1st build:
project/tmp/sysroots/armA9le/usr/include/ncurses:
cursesapp.h  cursesm.h  cursslk.h  form.h      ncurses_dll.h  termcap.h     tic.h
cursesf.h    cursesp.h  eti.h      menu.h      ncurses.h      term_entry.h  unctrl.h
curses.h     cursesw.h  etip.h     nc_tparm.h  panel.h        term.h

projecttmp/sysroots/armA9le/usr/include/ncursesw:
cursesapp.h  cursesm.h  cursslk.h  form.h      ncurses_dll.h  termcap.h     tic.h
cursesf.h    cursesp.h  eti.h      menu.h      ncurses.h      term_entry.h  unctrl.h
curses.h     cursesw.h  etip.h     nc_tparm.h  panel.h        term.h

2nd build:
project/tmp/sysroots/armA9le/usr/include/ncurses: ----&gt;empty dir

projecttmp/sysroots/armA9le/usr/include/ncursesw:
cursesapp.h  cursesm.h  cursslk.h  form.h      ncurses_dll.h  termcap.h     tic.h
cursesf.h    cursesp.h  eti.h      menu.h      ncurses.h      term_entry.h  unctrl.h
curses.h     cursesw.h  etip.h     nc_tparm.h  panel.h        term.h

This could be a issue ?
Does anyone know how to fix it or how to explain this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55874</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-28 08:32:23 +0000</bug_when>
    <thetext>When you say &quot;second build&quot; is that being restored from the sstate cache, or rebuilding from source?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55875</commentid>
    <comment_count>2</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2015-10-28 08:54:18 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; When you say &quot;second build&quot; is that being restored from the sstate cache, or
&gt; rebuilding from source?

I mean rebuilding from source. And I found a difference between &quot;log.do_populate_sysroot&quot; of each building.The log in the 1st build have one more line:
&quot;DEBUG: Staging files from /ci/build/workspace_armA9le/tmp/work/armv7a-linux-gnueabi/ncurses-5.7-r10.1/sysroot-destdir/ to /ci/build/workspace_armA9le/tmp/sysroots/armA9le/&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55878</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-28 09:15:46 +0000</bug_when>
    <thetext>OK, that being the case, what are you doing between the first and second builds?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55931</commentid>
    <comment_count>4</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2015-10-28 14:59:41 +0000</bug_when>
    <thetext>I did not modify any code, just directly create a new dir and recompiled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55933</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-28 15:04:21 +0000</bug_when>
    <thetext>I&apos;m still not following I&apos;m afraid - &quot;new dir&quot; - which directory do you mean? the build directory? If so how is that connected to the old directory? By &quot;recompiled&quot; do you mean running bitbake on the same target?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55936</commentid>
    <comment_count>6</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2015-10-28 15:28:23 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; I&apos;m still not following I&apos;m afraid - &quot;new dir&quot; - which directory do you
&gt; mean? the build directory? If so how is that connected to the old directory?
&gt; By &quot;recompiled&quot; do you mean running bitbake on the same target?

Sorry to make you confused. Here is what I did, I created a project directory and built once, then I created a new one and built again. But the *.h installed into sysroots acting different in the two projects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55937</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-28 15:35:49 +0000</bug_when>
    <thetext>Ok, so these two build directories are completely independent and both built completely from source?

Could you compare some of the other logs such as log.do_configure? Also is there a difference in whats in image/ under the workdir for the recipe for each build?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55956</commentid>
    <comment_count>8</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2015-10-29 02:49:59 +0000</bug_when>
    <thetext>1.Yes, so these two build directories are completely independent and both built completely from source.
2.I compared the logs (log.do_configure log.do_compile and log.do_install), they are totally the same except the time-stamp.
3.There&apos;s few adjustments for ncurses_5.7.bb:
====================================================================
do_chmod(){
        install -d ${D}/usr/include/ncursesw
        install -d ${D}/usr/include/ncurses
        install -m 0644 ${D}/usr/include/*.h ${D}/usr/include/ncursesw
        install -m 0644 ${D}/usr/include/*.h ${D}/usr/include/ncurses
        cp -r ${D}/usr/include/ncursesw/ ${STAGING_DIR_HOST}${includedir}
}
addtask do_chmod after do_install before do_package
====================================================================
The task do_chmod makes sure all the *.h will be installed into ${D}.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55966</commentid>
    <comment_count>9</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-29 09:44:39 +0000</bug_when>
    <thetext>A couple of problems with the fix you propose:

1) We need to actually fix do_install rather than band-aiding another task function onto it; it is already supposed to be handling these headers

2) You must not copy files directly into the sysroot (the ${STAGING_DIR_HOST} part of it in this case). Files should be installed into ${D} and then the normal staging logic will manage how those get into the sysroot (most importantly, so we know how to remove them later when the recipe is upgraded/cleaned).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56025</commentid>
    <comment_count>10</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2015-10-30 03:54:24 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; A couple of problems with the fix you propose:
&gt; 
&gt; 1) We need to actually fix do_install rather than band-aiding another task
&gt; function onto it; it is already supposed to be handling these headers
&gt; 
&gt; 2) You must not copy files directly into the sysroot (the
&gt; ${STAGING_DIR_HOST} part of it in this case). Files should be installed into
&gt; ${D} and then the normal staging logic will manage how those get into the
&gt; sysroot (most importantly, so we know how to remove them later when the
&gt; recipe is upgraded/cleaned).

Thanks for your advice, I add a additional task because the headers I need in ncurses/ and ncursesw/ won&apos;t be installed into sysroot as default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56033</commentid>
    <comment_count>11</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-30 07:57:04 +0000</bug_when>
    <thetext>That&apos;s not the way to solve it. If you look at sysroot_stage_dirs() in meta/classes/staging.bbclass (which is part of what happens during do_populate_sysroot) you can see that the entire of ${includedir} (/usr/include) is being staged. If there&apos;s a problem here either what&apos;s already in do_install to install these headers isn&apos;t working (possible) or the staging logic isn&apos;t working (less likely, because then you&apos;d be seeing much more serious problems).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56518</commentid>
    <comment_count>12</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-11-17 11:36:55 +0000</bug_when>
    <thetext>Yunming Shi: what release of oe-core/yocto/poky were you using for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73739</commentid>
    <comment_count>13</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2017-06-06 11:30:51 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Yunming Shi: what release of oe-core/yocto/poky were you using for this?

I&apos;m using Yocto 1.2.1, very sorry for took so long to reply.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73743</commentid>
    <comment_count>14</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-06-06 11:52:20 +0000</bug_when>
    <thetext>Are you aware that 1.2 is over five years old?  Please considering moving to a newer (supported, not prone to security problems) release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73745</commentid>
    <comment_count>15</comment_count>
    <who name="Yunming Shi">emincemnt</who>
    <bug_when>2017-06-06 12:35:14 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; Are you aware that 1.2 is over five years old?  Please considering moving to
&gt; a newer (supported, not prone to security problems) release.

All right, I will. Thank you for your support.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>