| Summary: | ncurses failure non-gplv3 build (race issue) | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Meta-yocto | Reporter: | Richard Purdie <richard.purdie> |
| Component: | meta-yocto | Assignee: | Xiaofeng Yan <Xiaofeng.yan> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | liang.li2, liezhi.yang, poky.bs.watcher, poky.watcher, scott.a.garman, sgw, song.liu, zhenfeng.zhao |
| Version: | 1.2 | ||
| Target Milestone: | 1.2.1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | (QA testing completed) Done | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Richard Purdie
2012-04-14 11:50:24 UTC
Hi Richard, I ran command "bitbake ncurses" and found that package "ncurses" can be built successfully. The steps I built are as follows: Host OS: ubuntu Host ARCH: x86-64 Target: qemux86, qemux86-64 Add "INCOMPATIBLE_LICENSE = "GPLv3"" to conf/local.conf $ bitbake ncurses Do you think the above steps are right? If I missed some steps, Please correct me. Thanks Its a race issue, it sometimes occurs with high values of PARALLEL_MAKE. This means it will sometimes appear and sometimes not appear. There is some missing dependency within the project's makefiles. Hi Richard, If this bug is caused by race issue, whether I can set PARALLEL_MAKE = "" in ncurses_5.9.bb for fixing this bug. Thanks Yan Update the information:
I've looked in to the code, this is a race issue which is caused by
install.libs and install.data:
1) install.data needs run tic
2) tic needs libtinfo.so
3) install.libs would regenerate libtinfo.so
4) but install.data doesn't depend on install.libs, and they can run
parallelly
So there would be errors in a very critical condition: tic is begining
to run at the same time when install.libs is generating libtinfo.so, and
this libtinfo.so is not integrity, then there would be the error:
tic: error while loading shared libraries: /path/to/lib/libtinfo.so.5: file too short
Here are the related code:
1) The do_install in meta/recipes-core/ncurses/ncurses.inc:
make install.libs ... install.data
2) The install.libs and install.data in ncurses-5.9/narrowc/Makefile, note that
it uses the double-colon which means that the all the targets in different
rules will be run, and if there are no prerequisites for that rule, its
recipe is always executed (even if the target already exists). The
install.libs is in 9 rules (just paste 2 here):
install.libs uninstall.libs \
install.data uninstall.data ::
cd misc && ${MAKE} ${CF_MFLAGS} $@
...
install.libs \
uninstall.libs \
install.ncurses \
uninstall.ncurses ::
cd ncurses && ${MAKE} ${CF_MFLAGS} $@
...
3) The install.libs in ncurses-5.9/narrowc/ncurses/Makefile:
../lib/libtinfo.so.$(REL_VERSION) : \
../lib \
$(SHARED_T_OBJS)
@echo linking $@
$(MK_SHARED_LIB) $(SHARED_T_OBJS) $(TINFO_LIST) $(LDFLAGS)
cd ../lib && ($(LN_S) libtinfo.so.$(REL_VERSION) libtinfo.so.$(ABI_VERSION); $(LN_S) libtinfo.so.$(ABI_VERSION) libtinfo.so; )
The ../lib/libtinfo.so has been generated in the compile stage, but it would be
regenerated since its prerequisites (../lib) has changed.
The easiest way to fix this is first run install.libs, then install.data, here
is the patch:
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
index ae99e2c..6309b69 100644
--- a/meta/recipes-core/ncurses/ncurses.inc
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -122,8 +122,17 @@ shell_do_install() {
# Order of installation is important; widec installs a 'curses.h'
# header with more definitions and must be installed last hence.
# Compatibility of these headers will be checked in 'do_test()'.
+
+ # The install.data should run after install.libs, otherwise
+ # there would be a race issue in a very critical conditon, since
+ # tic will be run by install.data, and tic needs libtinfo.so
+ # which would be regenerated by install.libs.
oe_runmake -C narrowc ${_install_opts} \
- install.data install.progs
+ install.progs
+
+ oe_runmake -C narrowc DESTDIR='${D}' \
+ PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
+ install.data
! ${ENABLE_WIDEC} || \
oe_runmake -C widec ${_install_opts}
Another solution is modify the Makefiles, but that is not as simple as modify
the ncurses.inc.
(In reply to comment #5) > http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/ > ?id=5022c3ecd7eb6e79da20d12cbf5d2c7992ba857c In poky/denzil branch,the commit number is 0d0846e06f387caf1c7f0380072f92f5e33e0882 verified on : git info:73cdebf60df225ee10f2eb215935be3b61e1b831 git branch: poky/denzil tried running "bitbake meta-ide-support" with setting "BB_NUMBER_THREADS" and "PARALLEL_MAKE" some value in conf/local.conf in build dir,no error found. If someone found the same error, just reopen it. |