Bug 8593 - The head files of ncurses installing into sysroot seems different in multiple times compilation
Summary: The head files of ncurses installing into sysroot seems different in multiple...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-10-28 03:47 UTC by Yunming Shi
Modified: 2017-06-06 12:35 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yunming Shi 2015-10-28 03:47:50 UTC
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: ---->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?
Comment 1 Paul Eggleton 2015-10-28 08:32:23 UTC
When you say "second build" is that being restored from the sstate cache, or rebuilding from source?
Comment 2 Yunming Shi 2015-10-28 08:54:18 UTC
(In reply to comment #1)
> When you say "second build" is that being restored from the sstate cache, or
> rebuilding from source?

I mean rebuilding from source. And I found a difference between "log.do_populate_sysroot" of each building.The log in the 1st build have one more line:
"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/"
Comment 3 Paul Eggleton 2015-10-28 09:15:46 UTC
OK, that being the case, what are you doing between the first and second builds?
Comment 4 Yunming Shi 2015-10-28 14:59:41 UTC
I did not modify any code, just directly create a new dir and recompiled.
Comment 5 Paul Eggleton 2015-10-28 15:04:21 UTC
I'm still not following I'm afraid - "new dir" - which directory do you mean? the build directory? If so how is that connected to the old directory? By "recompiled" do you mean running bitbake on the same target?
Comment 6 Yunming Shi 2015-10-28 15:28:23 UTC
(In reply to comment #5)
> I'm still not following I'm afraid - "new dir" - which directory do you
> mean? the build directory? If so how is that connected to the old directory?
> By "recompiled" 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.
Comment 7 Paul Eggleton 2015-10-28 15:35:49 UTC
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?
Comment 8 Yunming Shi 2015-10-29 02:49:59 UTC
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'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}.
Comment 9 Paul Eggleton 2015-10-29 09:44:39 UTC
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).
Comment 10 Yunming Shi 2015-10-30 03:54:24 UTC
(In reply to comment #9)
> 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).

Thanks for your advice, I add a additional task because the headers I need in ncurses/ and ncursesw/ won't be installed into sysroot as default.
Comment 11 Paul Eggleton 2015-10-30 07:57:04 UTC
That'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's a problem here either what's already in do_install to install these headers isn't working (possible) or the staging logic isn't working (less likely, because then you'd be seeing much more serious problems).
Comment 12 Ross Burton 2015-11-17 11:36:55 UTC
Yunming Shi: what release of oe-core/yocto/poky were you using for this?
Comment 13 Yunming Shi 2017-06-06 11:30:51 UTC
(In reply to comment #12)
> Yunming Shi: what release of oe-core/yocto/poky were you using for this?

I'm using Yocto 1.2.1, very sorry for took so long to reply.
Comment 14 Ross Burton 2017-06-06 11:52:20 UTC
Are you aware that 1.2 is over five years old?  Please considering moving to a newer (supported, not prone to security problems) release.
Comment 15 Yunming Shi 2017-06-06 12:35:14 UTC
(In reply to comment #14)
> Are you aware that 1.2 is over five years old?  Please considering moving to
> a newer (supported, not prone to security problems) release.

All right, I will. Thank you for your support.