Skip to contentSkip to conversation

amend.bbclass: handle PACKAGE_ARCH change in an amend.inc

PATCH In review Eric Bénard 5 participants 10 messages Nov 17, 2010 – Nov 21, 2010

lore
Share & tools
lore
#0 lore raw

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
index a03de64..da60611 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
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 because MULTIMACH_ARCH is not updated after amend.inc is parsed.

* this patch updates MULTIMACH_ARCH if PACKAGE_ARCH is changed in amend.inc

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
index a03de64..da60611 100644
@@ -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
#2 lore raw
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 because MULTIMACH_ARCH is not updated after amend.inc is parsed.

Quoted 8 lines
Quoted 4 lines

* this patch updates MULTIMACH_ARCH if PACKAGE_ARCH is changed in amend.inc

Thanks! We have faced this issue before.

I'm working on an update version after discussion with Kergoth on IRC. I hope to send it for review by tomorrow.

Eric

#3 lore raw

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_ARCH is not updated after amend.inc is parsed.

* this patch updates MULTIMACH_ARCH if PACKAGE_ARCH is changed in amend.inc

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thanks! We have faced this issue before.

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

#4 lore raw

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
index a03de64..048a8f3 100644
@@ -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
Acked-by on v1 1/1
#5 lore raw

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 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

Quoted 96 lines

---
 classes/amend.bbclass |    2 +
 classes/base.bbclass  |   53 ++++++++++++++++++++++++++----------------------

 2 files changed, 31 insertions(+), 24 deletions(-)
classes/amend.bbclass +2 -0
index a03de64..048a8f3 100644
@@ -42,4 +42,6 @@ python () {
             depends = set()
         depends |= set(newdata)
     d.setVar("__depends", depends)
+
+    set_multimach_arch(d)
  }
classes/base.bbclass +0 -0
index 308498f..90a481b 100644
@@ -288,6 +288,34 @@ addtask build

 do_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 exceptions

classes/base.bbclass +0 -0
@@ -363,30 +391,7 @@ python () {
         # Already machine specific - nothing further to do

        return

-    #
-    # 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

classes/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_setscene do_fetch do_unpack do_configure do_compile do_install do_package --
1.6.3.3

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#6 lore raw

Re: [PATCH] handle PACKAGE_ARCH change in an amend.inc

In reply to Eric Bénard

2010/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
#7 lore raw

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 setting MULTIMACH_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

#8 lore raw

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
index a03de64..048a8f3 100644
@@ -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
Acked-by on v1 1/1
#9 lore raw

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 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

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics