From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)
Date: Wed, 28 Jul 2010 16:06:13 +0200 [thread overview]
Message-ID: <20100728140613.GB19135@mx.loc> (raw)
In-Reply-To: <4C503315.8090009@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]
On Wed, Jul 28, 2010 at 03:39:33PM +0200, Marco Cavallini wrote:
>Stanislav Brabec ha scritto, Il 28/07/2010 11:30:
>> I just built an angstrom image and thinks failed.
>>
>> lzma image depends on lzma-native, grep and other programs that use .xz
>> suffix for tarballs depend on xz-native.
>> This fact itself is bad - it creates file conflicts in the sysroot.
>>
>> But things were even worse:
>> - xz-native staged xz binary and lzma as a symlink to xz.
>> - lzma-native tried to stage lzma 4 minutes later
>>
>> But staging of lzma apparently went wrong. Instead of removal of lzma
>> symlink and installation of lzma binary, bitbake followed the symlink
>> and staged lzma as xz with a result of broken build environment.
>>
>> I have bitbake-1.8.18.
>>
>
>
>In the meantime we are waiting for a patch I used
> bitbake xz-native
>prior to launch
> bitbake x11-image
To rectify this extra manual step, one would need to something like the
attached (untested). This does not take care of diverting lzma/xz
binaries which is a separate issue.
[-- Attachment #2: fwd-xz-native1 --]
[-- Type: text/plain, Size: 6316 bytes --]
diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index b2de2b1..e4ad3bf 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -1,8 +1,14 @@
# use autotools_stage_all for native packages
AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
-def autotools_deps(d):
- if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
+def autotools_deps(d, virtclass=None):
+ if virtclass:
+ virtclass_str = "_virtclass-%s" % (virtclass)
+ else:
+ virtclass_str = ""
+ if ((virtclass and bb.data.inherits_class(virtclass, d)) \
+ or (virtclass is None)) \
+ and bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS' + virtclass_str, d, 1):
return ''
pn = bb.data.getVar('PN', d, 1)
@@ -17,7 +23,7 @@ def autotools_deps(d):
if not bb.data.inherits_class('native', d) \
and not bb.data.inherits_class('cross', d) \
and not bb.data.inherits_class('sdk', d) \
- and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
+ and not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d, 1):
deps += 'libtool-cross '
return deps + 'gnu-config-native '
@@ -25,8 +31,8 @@ def autotools_deps(d):
EXTRA_OEMAKE = ""
DEPENDS_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
-DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_deps(d, 'native')}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d, 'nativesdk')}"
inherit siteinfo
@@ -86,6 +92,7 @@ oe_runconf () {
}
autotools_do_configure() {
+ [ "x${INHIBIT_AUTOTOOLS_DEPS_virtclass-native}" = "x" ] &&
case ${PN} in
autoconf*)
;;
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 1847491..c4856d1 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -57,7 +57,11 @@ oe_runmake() {
${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
}
-def base_deps(d):
+def base_deps(d, virtclass=None):
+ if virtclass:
+ virtclass_str = "_virtclass-%s" % (virtclass)
+ else:
+ virtclass_str = ""
#
# Ideally this will check a flag so we will operate properly in
# the case where host == build == target, for now we don't work in
@@ -71,7 +75,7 @@ def base_deps(d):
# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
# we need that built is the responsibility of the patch function / class, not
# the application.
- if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
+ if not bb.data.getVar('INHIBIT_DEFAULT_DEPS' + virtclass_str, d):
if (bb.data.getVar('HOST_SYS', d, 1) !=
bb.data.getVar('BUILD_SYS', d, 1)):
deps += " virtual/${TARGET_PREFIX}gcc virtual/libc "
@@ -84,8 +88,8 @@ def base_deps(d):
return deps
DEPENDS_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-native_prepend="${@base_deps(d)} "
-DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d)} "
+DEPENDS_virtclass-native_prepend="${@base_deps(d, 'native')} "
+DEPENDS_virtclass-nativesdk_prepend="${@base_deps(d, 'nativesdk')} "
SCENEFUNCS += "base_scenefunction"
@@ -420,12 +424,16 @@ python () {
# unzip-native should already be staged before unpacking ZIP recipes
need_unzip = bb.data.getVar('NEED_UNZIP_FOR_UNPACK', d, 1)
- src_uri = bb.data.getVar('SRC_URI', d, 1)
- if ".zip" in src_uri or need_unzip == "1":
+ if ".zip" in srcuri or need_unzip == "1":
depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
depends = depends + " unzip-native:do_populate_sysroot"
bb.data.setVarFlag('do_unpack', 'depends', depends, d)
+ for ext in ['xz']: #['gzip', 'bzip2', 'xz']:
+ if '.' + ext in srcuri:
+ depends = bb.data.getVarFlag('do_unpack', 'depends', d) or ""
+ depends += ' ' + ext + '-native:do_populate_sysroot'
+ bb.data.setVarFlag('do_unpack', 'depends', depends, d)
# 'multimachine' handling
mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
diff --git a/classes/native.bbclass b/classes/native.bbclass
index 3437836..57de77e 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -89,7 +89,7 @@ PKG_CONFIG_SYSROOT_DIR = ""
ORIG_DEPENDS := "${DEPENDS}"
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+DEPENDS_virtclass-native ?= "${@['${ORIG_DEPENDS}',''][bb.data.getVar('INHIBIT_DEFAULT_DEPS_virtclass-native', d, True) or False]}"
python __anonymous () {
# If we've a legacy native do_stage, we need to neuter do_install
@@ -111,7 +111,6 @@ python __anonymous () {
if dep.endswith("-cross"):
newdeps.append(dep.replace("-cross", "-native"))
elif not dep.endswith("-native"):
-
newdeps.append(dep + "-native")
else:
newdeps.append(dep)
@@ -121,7 +120,6 @@ python __anonymous () {
if prov.find(pn) != -1:
continue
if not prov.endswith("-native"):
-
provides = provides.replace(prov, prov + "-native")
bb.data.setVar("PROVIDES", provides, d)
bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
diff --git a/recipes/grep/grep_2.6.3.bb b/recipes/grep/grep_2.6.3.bb
index 981c062..5c76bab 100644
--- a/recipes/grep/grep_2.6.3.bb
+++ b/recipes/grep/grep_2.6.3.bb
@@ -3,8 +3,6 @@ SECTION = "console/utils"
DESCRIPTION = "grep GNU utility"
PR = "r2"
-do_unpack[depends] += "xz-native:do_populate_sysroot"
-
SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
file://uclibc-fix.patch"
diff --git a/recipes/xz/xz_4.999.9beta.bb b/recipes/xz/xz_4.999.9beta.bb
index 8733023..24278e0 100644
--- a/recipes/xz/xz_4.999.9beta.bb
+++ b/recipes/xz/xz_4.999.9beta.bb
@@ -1,5 +1,7 @@
+INHIBIT_AUTOTOOLS_DEPS_virtclass-native = "1"
+INHIBIT_DEFAULT_DEPS_virtclass-native = "1"
require xz.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"
next prev parent reply other threads:[~2010-07-28 14:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 9:30 bitbake: staging of binary over symlink breaks sysroot (lzma x xz) Stanislav Brabec
2010-07-28 9:52 ` Andrea Adami
2010-07-28 10:09 ` Marco Cavallini
2010-07-28 13:39 ` Marco Cavallini
2010-07-28 14:06 ` Bernhard Reutner-Fischer [this message]
2010-07-28 14:32 ` Bernhard Reutner-Fischer
2010-08-02 17:13 ` [PATCH, RFC]: automatically depend xz compressed URIs on xz-native [was: Re: bitbake: staging of binary over symlink breaks sysroot (lzma x xz)] Bernhard Reutner-Fischer
2010-08-02 17:49 ` Khem Raj
2010-08-02 18:07 ` Bernhard Reutner-Fischer
2010-08-02 18:13 ` Khem Raj
2010-08-02 18:20 ` Bernhard Reutner-Fischer
2010-08-02 20:23 ` Tom Rini
2010-08-04 10:37 ` [PATCH] base.bbclass: depend unpacking on native unpackers Bernhard Reutner-Fischer
2010-08-04 15:08 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100728140613.GB19135@mx.loc \
--to=rep.dot.nop@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.