Skip to contentSkip to conversation

Fix overriding PACKAGE_ARCH for MACHINE specific SRC_URI

PATCH In review Joshua Lock 2 participants 4 messages Feb 11, 2012 – Feb 17, 2012

lore
Share & tools
lore
#0 lore raw

cover Fix overriding PACKAGE_ARCH for MACHINE specific SRC_URI

After the discussion following my recent netbase patch I spent some time today looking to fixup the BSP which triggered the change and discovered that the logic to set PACKAGE_ARCH = MACHINE_ARCH for MACHINE specific SRC_URI overrides doesn't search for said overrides in layers.

This patch is probably an ugly fix, but it's a fix nonetheless. I couldn't find a better fix before boarding a plane so submit this as is for review.

Cheers,
Joshua

The following changes since commit 41a83ccfe50ec69425a4828fb5836d38d3f99e67:

guile: fix cross configure failure (2012-02-10 17:01:42 +0000)

are available in the git repository at:
git://git.yoctoproject.org/poky-contrib josh/work
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=josh/work

Joshua Lock (1):
base.bbclass: look in layers for SRC_URI with MACHINE overrides too

 meta/classes/base.bbclass |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/1 base.bbclass: look in layers for SRC_URI with MACHINE overrides too

The logic which looks for MACHINE overrides in SRC_URI and updates PACKAGE_ARCH accordingly doesn't account for SRC_URI overrides in layers.

This patch may not be the cleanest approach to solving the issue but it works.

---
 meta/classes/base.bbclass |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
meta/classes/base.bbclass +10 -0
index a26ac94..8fd5e53 100644
@@ -460,6 +460,16 @@ python () {
             path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d)
             if os.path.isdir(path):
                 paths.append(path)
+
+        # FILE is relative to the original recipe, for any bbappends in
+        # layers we need to look a little further
+        expaths = d.getVar('FILESEXTRAPATHS', True) or ""
+        for path in expaths.split(":"):
+            if len(path):
+                p = bb.data.expand(os.path.join(path, "${MACHINE}"), d)
+                if os.path.isdir(p):
+	            paths.append(p)
+
         if len(paths) != 0:
             for s in srcuri.split():
                 if not s.startswith("file://"):
Signature · 1 line
1.7.7.6
#2 lore raw

Re: [PATCH 1/1] base.bbclass: look in layers for SRC_URI with MACHINE overrides too

Quoted 4 lines · Joshua Lock

The logic which looks for MACHINE overrides in SRC_URI and updates PACKAGE_ARCH
accordingly doesn't account for SRC_URI overrides in layers.

It seems to address the issue but I think we need to support bbappend with overrides. If the layer doesn't use a machine override, then:

* it is not machine depdendant, or
* is a bug in the layer

People agree with this point of view?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#3 lore raw

Re: [PATCH 1/1] base.bbclass: look in layers for SRC_URI with MACHINE overrides too

Quoted 10 lines · Otavio Salvador

On Fri, Feb 10, 2012 at 22:30, Joshua Lock <[email protected] <mailto:[email protected]>> wrote:

The logic which looks for MACHINE overrides in SRC_URI and updates PACKAGE_ARCH
accordingly doesn't account for SRC_URI overrides in layers.

It seems to address the issue but I think we need to support bbappend with overrides.

Agreed, this patch adds hacky support for that. I am working on a more suitable patch to do this in a cleaner way.

If the layer doesn't use a machine override, then:

Quoted 5 lines

* it is not machine depdendant, or
* is a bug in the layer

People agree with this point of view?

I do.

Cheers,
Joshua

Signature · 3 lines
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre