amend.bbclass: handle PACKAGE_ARCH change in an amend.inc
PATCH 1/1 amend.bbclass: handle PACKAGE_ARCH change in an amend.inc
* setting PACKAGE_ARCH = "${MACHINE_ARCH}" in and amend.inc actually leads to a packaga with the correct machine arch but the work/stage/stamp dirs are not correct because MULTIMACH_ARCH is not updated after amend.inc is parsed.
* this patch updates MULTIMACH_ARCH if PACKAGE_ARCH is changed in amend.inc
--- classes/amend.bbclass | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
classes/amend.bbclass +7 -0
@@ -42,5 +42,11 @@ python () { depends = set() depends |= set(newdata) d.setVar("__depends", depends) + + mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) + pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) + multi_arch = bb.data.getVar('MULTIMACH_ARCH', d, 1) + if pkg_arch and pkg_arch == mach_arch and pkg_arch != multi_arch: + multi_arch = pkg_arch + bb.data.setVar('MULTIMACH_ARCH', multi_arch, d) }
Signature · 1 line
1.7.2.3
Quoted 9 lines · Eric B??nard
* setting
PACKAGE_ARCH= "${MACHINE_ARCH}" in and amend.inc actually leads to a packaga with the correct machine arch but the work/stage/stamp dirs are not correct becauseMULTIMACH_ARCHis not updated after amend.inc is parsed.* this patch updates
MULTIMACH_ARCHifPACKAGE_ARCHis changed in amend.incSigned-off-by Eric B??nard <[email protected]>
Thanks! We have faced this issue before.
Quoted 28 lines
--- classes/amend.bbclass | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)classes/amend.bbclass +7
-0@@ -42,5 +42,11 @@ python () { depends = set() depends |= set(newdata) d.setVar("__depends", depends) + + mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) + pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) + multi_arch = bb.data.getVar('MULTIMACH_ARCH', d, 1) + if pkg_arch and pkg_arch == mach_arch and pkg_arch != multi_arch: + multi_arch = pkg_arch + bb.data.setVar('MULTIMACH_ARCH', multi_arch, d) }Signature · 7 lines
1.7.2.3 _______________________________________________ Openembedded-devel mailing list [email protected] http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Quoted 6 lines · Denys Dmytriyenko
Quoted 5 lines · Eric B??nard
* setting
PACKAGE_ARCH= "${MACHINE_ARCH}" in and amend.inc actually leads to a packaga with the correct machine arch but the work/stage/stamp dirs are not correct becauseMULTIMACH_ARCHis not updated after amend.inc is parsed.
Quoted 8 lines
Quoted 4 lines
* this patch updates
MULTIMACH_ARCHifPACKAGE_ARCHis changed in amend.incSigned-off-by Eric B??nard<[email protected]>Thanks! We have faced this issue before.
Acked-by Denys Dmytriyenko<[email protected]>
I'm working on an update version after discussion with Kergoth on IRC. I hope to send it for review by tomorrow.
Eric
Am Donnerstag, den 18.11.2010, 19:11 +0100 schrieb Eric Bénard:
Quoted 4 lines · Denys Dmytriyenko
Quoted 3 lines · Eric B??nard
Quoted 2 lines
* setting
PACKAGE_ARCH= "${MACHINE_ARCH}" in and amend.inc actually leads to a packaga with the correct machine arch but the
s/packaga/package/
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
work/stage/stamp dirs are not correct because
MULTIMACH_ARCHis not updated after amend.inc is parsed.* this patch updates
MULTIMACH_ARCHifPACKAGE_ARCHis changed in amend.inc
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Eric B??nard<[email protected]>Thanks! We have faced this issue before.
Acked-by Denys Dmytriyenko<[email protected]>I'm working on an update version after discussion with Kergoth on IRC. I hope to send it for review by tomorrow.
Just pointing out the typo above since you are going to update the patch.
Thanks,
Paul
PATCH 1/1 handle PACKAGE_ARCH change in an amend.inc
In reply to Eric Bénard* setting PACKAGE_ARCH = "${MACHINE_ARCH}" in an amend.inc actually leads to a package with the correct machine arch but the work/stage/stamp dirs are not correct because MULTIMACH_ARCH is not updated after amend.inc is parsed.
* this patch :
- factorizes the code which compute MULTIMACH_ARCH in base.bbclass
- updates MULTIMACH_ARCH if required by an amend.inc
--- classes/amend.bbclass | 2 + classes/base.bbclass | 53 ++++++++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 24 deletions(-)
classes/amend.bbclass +2 -0
@@ -42,4 +42,6 @@ python () { depends = set() depends |= set(newdata) d.setVar("__depends", depends) + + set_multimach_arch(d) }
classes/base.bbclass +29 -24
65 lines not on this page · raw message
Signature · 1 line
1.6.3.3
Re: [PATCH] handle PACKAGE_ARCH change in an amend.inc
2010/11/21 Eric Bénard <[email protected]>:
Quoted 10 lines
* setting
PACKAGE_ARCH= "${MACHINE_ARCH}" in an amend.inc actually leads to a package with the correct machine arch but the work/stage/stamp dirs are not correct becauseMULTIMACH_ARCHis not updated after amend.inc is parsed.* this patch :
- factorizes the code which computeMULTIMACH_ARCHin base.bbclass
- updatesMULTIMACH_ARCHif required by an amend.incSigned-off-by Eric Bénard <[email protected]>
Quoted 96 lines
---
classes/amend.bbclass | 2 +
classes/base.bbclass | 53 ++++++++++++++++++++++++++----------------------2 files changed, 31 insertions(+), 24 deletions(-)classes/amend.bbclass +2
-0@@ -42,4 +42,6 @@ python () { depends = set() depends |= set(newdata) d.setVar("__depends", depends) + + set_multimach_arch(d) }classes/base.bbclass +0
-0@@ -288,6 +288,34 @@ addtask builddo_build = ""
do_build[func] = "1"classes/base.bbclass +28
-0+def set_multimach_arch(d): + # 'multimachine' handling + mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) + pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) + + # + # We always try to scan SRC_URI for urls with machine overrides + # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0 + # + override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) + if override != '0' and is_machine_specific(d): + bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d) + bb.data.setVar('MULTIMACH_ARCH', mach_arch, d) + return + + multiarch = pkg_arch + + packages = bb.data.getVar('PACKAGES', d, 1).split() + for pkg in packages: + pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1) + + # We could look for != PACKAGE_ARCH here but how to choose + # if multiple differences are present? + # Look through PACKAGE_ARCHS for the priority order? + if pkgarch and pkgarch == mach_arch: + multiarch = mach_arch + break +python () {
import exceptionsclasses/base.bbclass +0
-0@@ -363,30 +391,7 @@ python () { # Already machine specific - nothing further to doreturn
- #
- # We always try to scanSRC_URIfor urls with machine overrides
- # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
- #
- override =bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
- if override != '0' andis_machine_specific(d):
- bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
- bb.data.setVar('MULTIMACH_ARCH',mach_arch, d)
- returnclasses/base.bbclass +1
-15- - multiarch = pkg_arch - - packages = bb.data.getVar('PACKAGES', d, 1).split() - for pkg in packages: - pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1) - - # We could look for != PACKAGE_ARCH here but how to choose - # if multiple differences are present? - # Look through PACKAGE_ARCHS for the priority order? - if pkgarch and pkgarch == mach_arch: - multiarch = mach_arch - break - - bb.data.setVar('MULTIMACH_ARCH', multiarch, d) + set_multimach_arch(d)}
EXPORT_FUNCTIONS
do_setscenedo_fetchdo_unpackdo_configuredo_compiledo_installdo_package--
1.6.3.3_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Re: [PATCH] handle PACKAGE_ARCH change in an amend.inc
In reply to Eric Bénard2010/11/21 Eric Bénard <[email protected]>
Quoted 14 lines
classes/base.bbclass +13
-0+ # + # We always try to scan SRC_URI for urls with machine overrides + # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0 + # + override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) + if override != '0' and is_machine_specific(d): + bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d) + bb.data.setVar('MULTIMACH_ARCH', mach_arch, d) + return + + multiarch = pkg_arch + + packages = bb.data.getVar('PACKAGES', d, 1).split()
classes/base.bbclass addtask build · line 318
Quoted 10 lines
classes/base.bbclass +10
-0+ for pkg in packages: + pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1) + + # We could look for != PACKAGE_ARCH here but how to choose + # if multiple differences are present? + # Look through PACKAGE_ARCHS for the priority order? + if pkgarch and pkgarch == mach_arch: + multiarch = mach_arch + break +
This is wrong. You do the loop here, set multiarch = mach_arch, and then never do anything with multiarch. If this function is really supposed to be setting MULTIMACH_ARCH, then you need to do so here as well.
bb.data.setVar("MULTIMACH_ARCH", multiarch, d)
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCH] handle PACKAGE_ARCH change in an amend.inc
Quoted 23 lines · Chris Larson
2010/11/21 Eric Bénard<[email protected]>
Quoted 21 lines
classes/base.bbclass +21
-0+ # + # We always try to scan SRC_URI for urls with machine overrides + # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0 + # + override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) + if override != '0' and is_machine_specific(d): + bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d) + bb.data.setVar('MULTIMACH_ARCH', mach_arch, d) + return + + multiarch = pkg_arch + + packages = bb.data.getVar('PACKAGES', d, 1).split() + for pkg in packages: + pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1) + + # We could look for != PACKAGE_ARCH here but how to choose + # if multiple differences are present? + # Look through PACKAGE_ARCHS for the priority order? + if pkgarch and pkgarch == mach_arch: + multiarch = mach_arch
Quoted 8 lines
classes/base.bbclass addtask build · line 318
Quoted 3 lines
classes/base.bbclass +2
-0+ break +This is wrong. You do the loop here, set multiarch =
mach_arch, and then never do anything with multiarch. If this function is really supposed to be settingMULTIMACH_ARCH, then you need to do so here as well.
bb.data.setVar("MULTIMACH_ARCH", multiarch, d)
you're right, I forget the last line when moving the block to set_multimach_arch .
Eric
PATCH 1/1 handle PACKAGE_ARCH change in an amend.inc
In reply to Chris Larson* setting PACKAGE_ARCH = "${MACHINE_ARCH}" in an amend.inc actually leads to a package with the correct machine arch but the work/stage/stamp dirs are not correct because MULTIMACH_ARCH is not updated after amend.inc is parsed.
* this patch :
- factorizes the code which compute MULTIMACH_ARCH in base.bbclass
- updates MULTIMACH_ARCH if required by an amend.inc
--- classes/amend.bbclass | 2 + classes/base.bbclass | 55 +++++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 24 deletions(-)
classes/amend.bbclass +2 -0
@@ -42,4 +42,6 @@ python () { depends = set() depends |= set(newdata) d.setVar("__depends", depends) + + set_multimach_arch(d) }
classes/base.bbclass +31 -24
67 lines not on this page · raw message
Signature · 1 line
1.6.3.3
Re: [PATCH] handle PACKAGE_ARCH change in an amend.inc
Quoted 10 lines · Eric Bénard
* setting
PACKAGE_ARCH= "${MACHINE_ARCH}" in an amend.inc actually leads to a package with the correct machine arch but the work/stage/stamp dirs are not correct becauseMULTIMACH_ARCHis not updated after amend.inc is parsed.* this patch :
- factorizes the code which computeMULTIMACH_ARCHin base.bbclass
- updatesMULTIMACH_ARCHif required by an amend.incSigned-off-by Eric Bénard <[email protected]>
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics