Addition minor fixes
cover Addition minor fixes
patch 1/4 has previous been submitted..
patch 2-4 are new works items.
(Patch 2/4) While working on debugging Zypper it was noted that all of the zypper components ended up in the same directory in /usr/src/debug on the target. The directory structure was adjusted slightly to ensure we don't get any conflicts.
(patch 4/4) In addition when debugging C++ components, it's difficult unless the python helpers are available. Fix the gcc-runtime recipe to include the helpers.
(patch 3/4) We also fix a race condition where rpm package writing could occur at the same time that the RPM solvedb is being generated. This race could cause a failure.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: mhatle/bernard/fixes
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/bernard/fixes
Thanks,
Mark Hatle <[email protected]>
---
Mark Hatle (4):
gcc-runtime: Ensure that gcc-runtime builds a debug package package.bbclass: Change the debug directory to avoid conflicts
package_rpm: Fix rootfs generation
gcc-runtime: Fix dbg files
meta/classes/package.bbclass | 10 ++++++++-- meta/classes/package_rpm.bbclass | 8 +++++++- meta/recipes-devtools/gcc/gcc-package-runtime.inc | 8 ++++++++ meta/recipes-devtools/gcc/gcc-runtime_4.5.1.bb | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.3.4
PATCH 1/4 gcc-runtime: Ensure that gcc-runtime builds a debug package
The gcc-runtime package will now create the proper dbg package. The RRECOMMENDS change is required to deal with the default. This is documented in bug 824.
--- meta/recipes-devtools/gcc/gcc-package-runtime.inc | 3 +++ meta/recipes-devtools/gcc/gcc-runtime_4.5.1.bb | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-package-runtime.inc +3 -0
@@ -1,4 +1,5 @@ PACKAGES = "\ + ${PN}-dbg \ libstdc++ \ libstdc++-precompile-dev \ libstdc++-dev \
@@ -11,6 +12,8 @@ PACKAGES = "\ libmudflap \ libmudflap-dev \ " +# The base package doesn't exist, so we clear the recommends. +RRECOMMENDS_${PN}-dbg = "" FILES_libg2c = "${target_libdir}/libg2c.so.*" FILES_libg2c-dev = "\
meta/recipes-devtools/gcc/gcc-runtime_4.5.1.bb +1 -1
@@ -1,4 +1,4 @@ -PR = "r2" +PR = "r3" require gcc-${PV}.inc require gcc-configure-runtime.inc
Signature · 1 line
1.7.3.4
PATCH 2/4 package.bbclass: Change the debug directory to avoid conflicts
In reply to Mark HatleThe debug directory before was below ${WORKDIR}. Unfortunately if something was based on a git tree, it meant that "git" was the directory name being preserved for usr/src/debug usage. The patch moves to using "${WORKDIR}/.." as the base, to ensure that the WORKDIR naming is used in usr/src/debug.
--- meta/classes/package.bbclass | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
meta/classes/package.bbclass +8 -2
@@ -180,6 +180,7 @@ def splitfile(file, debugfile, debugsrcdir, d): objcopy = bb.data.getVar("OBJCOPY", d, True) debugedit = bb.data.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit", d) workdir = bb.data.expand("${WORKDIR}", d) + workparentdir = os.path.dirname(workdir) sourcefile = bb.data.expand("${WORKDIR}/debugsources.list", d) # We ignore kernel modules, we don't generate debug info files.
@@ -194,7 +195,7 @@ def splitfile(file, debugfile, debugsrcdir, d): # We need to extract the debug src information here... if debugsrcdir: - os.system("%s'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (pathprefix, debugedit, workdir, debugsrcdir, sourcefile, file)) + os.system("%s'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (pathprefix, debugedit, workparentdir, debugsrcdir, sourcefile, file)) bb.mkdirhier(os.path.dirname(debugfile))
@@ -222,15 +223,20 @@ def splitfile2(debugsrcdir, d): objcopy = bb.data.getVar("OBJCOPY", d, True) debugedit = bb.data.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit", d) workdir = bb.data.expand("${WORKDIR}", d) + workparentdir = os.path.dirname(workdir) + workbasedir = os.path.basename(workdir) sourcefile = bb.data.expand("${WORKDIR}/debugsources.list", d) if debugsrcdir: bb.mkdirhier("%s%s" % (dvar, debugsrcdir)) processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | " + # We need to ignore files that are not actually ours + # we do this by only paying attention to items from this package + processdebugsrc += "egrep -z '%s' | " processdebugsrc += "(cd '%s' ; cpio -pd0mL '%s%s' 2>/dev/null)" - os.system(processdebugsrc % (sourcefile, workdir, dvar, debugsrcdir)) + os.system(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) # The copy by cpio may have resulted in some empty directories! Remove these for root, dirs, files in os.walk("%s%s" % (dvar, debugsrcdir)):
Signature · 1 line
1.7.3.4
PATCH 3/4 package_rpm: Fix rootfs generation
In reply to Mark Hatle[YOCTO #797]
During rootfs generation, if other RPM packages are being wrtten this could cause a failure during the solvedb generation. We add a shared lock around the RPM package building. This will allow multiple RPM packages to continue to be written at the same time, but prevent rootfs generation and RPM package generation at the same time.
--- meta/classes/package_rpm.bbclass | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
meta/classes/package_rpm.bbclass +7 -1
@@ -777,10 +777,16 @@ python do_package_rpm () { cmd = cmd + " --define 'debug_package %{nil}'" cmd = cmd + " -bb " + outspecfile - # Build the spec file! + # Take a shared lock, we can write multiple packages at the same time... + # but we need to stop the rootfs/solver from running while we do... + lf = bb.utils.lockfile(bb.data.expand("${DEPLOY_DIR_RPM}/rpm.lock", d), True) + + # Build the rpm package! bb.data.setVar('BUILDSPEC', cmd + "\n", d) bb.data.setVarFlag('BUILDSPEC', 'func', '1', d) bb.build.exec_func('BUILDSPEC', d) + + bb.utils.unlockfile(lf) } python () {
Signature · 1 line
1.7.3.4
PATCH 4/4 gcc-runtime: Fix dbg files
In reply to Mark HatleIn order to debug certain C++ items, you need the helper python components. These components should live in the -dbg package, ensure they are added to the recipe.
--- meta/recipes-devtools/gcc/gcc-package-runtime.inc | 5 +++++ meta/recipes-devtools/gcc/gcc-runtime_4.5.1.bb | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-package-runtime.inc +5 -0
@@ -15,6 +15,11 @@ PACKAGES = "\ # The base package doesn't exist, so we clear the recommends. RRECOMMENDS_${PN}-dbg = "" +# include python debugging scripts +FILES_${PN}-dbg += "\ + ${libdir}/libstdc++.so.*-gdb.py \ + ${datadir}/gcc-${PV}/python/libstdcxx" + FILES_libg2c = "${target_libdir}/libg2c.so.*" FILES_libg2c-dev = "\ ${libdir}/libg2c.so \
meta/recipes-devtools/gcc/gcc-runtime_4.5.1.bb +1 -1
@@ -1,4 +1,4 @@ -PR = "r3" +PR = "r4" require gcc-${PV}.inc require gcc-configure-runtime.inc
Signature · 1 line
1.7.3.4