Skip to contentSkip to conversation

*.bbappend: don't expand FILESEXTRAPATHS immediately

PATCH In review Kevin Tian 2 participants 4 messages Nov 24, 2010 – Nov 25, 2010

lore
Share & tools
lore

Kevin Tian

author
#0 lore raw

PATCH 1/1 *.bbappend: don't expand FILESEXTRAPATHS immediately

There's no point to expand FILESEXTRAPATHS immediately, since the place where it's referenced still use normal getVar(FILESEXTRAPATHS, d, True). This way it doesn't help anything except adding one more breaking variable on sstate.

---
 documentation/bsp-guide/bsp.xml                    |    2 +-
 .../recipes/formfactor/formfactor_0.0.bbappend     |    2 +-
 .../recipes/linux/linux-yocto_git.bbappend         |    2 +-
 meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
documentation/bsp-guide/bsp.xml +1 -1
index 9e25068..0d716a3 100644
@@ -307,7 +307,7 @@ meta-bsp/packages/image-creator/image-creator-native_0.1.bb
                 The example below shows extra files contained in a folder called ${PN} (the package name).
             </para>
             <programlisting>
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
             </programlisting>
             <para>
             This technique allows the BSP to add machine-specific configuration files to the layer directory, 
meta-emenlow/recipes/formfactor/formfactor_0.0.bbappend +1 -1
index 4a41d48..a64f367 100644
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
  
 PRINC = "1"
meta-emenlow/recipes/linux/linux-yocto_git.bbappend +1 -1
index 9fa2937..77c5223 100644
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
 COMPATIBLE_MACHINE_emenlow = "emenlow"
 KMACHINE_emenlow  = "emenlow"
meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend +1 -1
index fac0921..c6f81d4 100644
@@ -1,3 +1,3 @@
-FILESPATH := "${FILESPATH}:${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESEXTRAPATH = "${THISDIR}/${PN}"
 SRC_URI += "file://defconfig"
 COMPATIBLE_MACHINE_emenlow = "emenlow"
Signature · 1 line
1.6.0.4
#1 lore raw

Please hold on taking this patch.

Josh mentioned to me that below change is risky given below comment in base.bbclass:

# THISDIR only works properly with imediate expansion as it has to run

# in the context of the location its used (:=)
THISDIR = "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"

The comment seems controversial to the actual assignment. When trying to understand the trick behind, I decide using a simple alternative by including FILESEXTRAPATHS in BB_BASEHASH_WHITELIST directly

An updated pull request will be sent out soon.

Thanks
Kevin

Quoted 62 lines

From: Tian, Kevin
Sent: Wednesday, November 24, 2010 12:27 PM

There's no point to expand FILESEXTRAPATHS immediately, since the place where it's referenced still use normal getVar(FILESEXTRAPATHS, d, True). This way it doesn't help anything except adding one more breaking variable on sstate.

---

documentation/bsp-guide/bsp.xml                    |    2 +-
.../recipes/formfactor/formfactor_0.0.bbappend     |    2 +-
.../recipes/linux/linux-yocto_git.bbappend         |    2 +-
meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend |    2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
documentation/bsp-guide/bsp.xml +0 -0
index 9e25068..0d716a3 100644
@@ -307,7 +307,7 @@ meta-bsp/packages/image-creator/image-creator-native_0.1.bb
                The example below shows extra files contained in a folder called ${PN} (the

package name).

            </para>
            <programlisting>
documentation/bsp-guide/bsp.xml +1 -1
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
            </programlisting>
            <para>
            This technique allows the BSP to add machine-specific configuration files to the

layer directory,

meta-emenlow/recipes/formfactor/formfactor_0.0.bbappend +1 -1
index 4a41d48..a64f367 100644
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
 

PRINC = "1"

meta-emenlow/recipes/linux/linux-yocto_git.bbappend +1 -1
index 9fa2937..77c5223 100644
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"

COMPATIBLE_MACHINE_emenlow = "emenlow"
KMACHINE_emenlow = "emenlow"

meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend +1 -1
index fac0921..c6f81d4 100644
@@ -1,3 +1,3 @@
-FILESPATH := "${FILESPATH}:${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESEXTRAPATH = "${THISDIR}/${PN}"

SRC_URI += "file://defconfig"
COMPATIBLE_MACHINE_emenlow = "emenlow"
--
1.6.0.4

#2 lore raw
In reply to Kevin Tian
Quoted 3 lines · Kevin Tian

There's no point to expand FILESEXTRAPATHS immediately, since the place where it's referenced still use normal getVar(FILESEXTRAPATHS, d, True). This way it doesn't help anything except adding one more breaking variable on sstate.

There is a very significant reason for doing immediate expansion with these variables.

The := ensures that the expansion happens in the context of the current file. Look at the value of

bitbake formfactor -e | grep ^FILESEXTRAPATH

before and after this patch and you'll see what I mean. It ensures the directory containing the bbappend is searched for source files as well as the directory containing the .bb file.

Cheers,

Richard

Quoted 48 lines
---
 documentation/bsp-guide/bsp.xml                    |    2 +-
 .../recipes/formfactor/formfactor_0.0.bbappend     |    2 +-
 .../recipes/linux/linux-yocto_git.bbappend         |    2 +-
 meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
documentation/bsp-guide/bsp.xml +1 -1
index 9e25068..0d716a3 100644
@@ -307,7 +307,7 @@ meta-bsp/packages/image-creator/image-creator-native_0.1.bb
                 The example below shows extra files contained in a folder called ${PN} (the package name).
             </para>
             <programlisting>
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
             </programlisting>
             <para>
             This technique allows the BSP to add machine-specific configuration files to the layer directory, 
meta-emenlow/recipes/formfactor/formfactor_0.0.bbappend +1 -1
index 4a41d48..a64f367 100644
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
 
 PRINC = "1"
meta-emenlow/recipes/linux/linux-yocto_git.bbappend +1 -1
index 9fa2937..77c5223 100644
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
 COMPATIBLE_MACHINE_emenlow = "emenlow"
 KMACHINE_emenlow  = "emenlow"
meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend +1 -1
index fac0921..c6f81d4 100644
@@ -1,3 +1,3 @@
-FILESPATH := "${FILESPATH}:${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESEXTRAPATH = "${THISDIR}/${PN}"
 SRC_URI += "file://defconfig"
 COMPATIBLE_MACHINE_emenlow = "emenlow"
#3 lore raw
Quoted 11 lines

From: Richard Purdie [mailto:[email protected]]
Sent: Thursday, November 25, 2010 5:48 AM

Quoted 3 lines · Kevin Tian

There's no point to expand FILESEXTRAPATHS immediately, since the place where it's referenced still use normal getVar(FILESEXTRAPATHS, d, True). This way it doesn't help anything except adding one more breaking variable on sstate.

There is a very significant reason for doing immediate expansion with these variables.

Quoted 8 lines

The := ensures that the expansion happens in the context of the current file. Look at the value of

bitbake formfactor -e | grep ^FILESEXTRAPATH

before and after this patch and you'll see what I mean. It ensures the directory containing the bbappend is searched for source files as well as the directory containing the .bb file.

Good to know that. Interesting thing is why with this change there's no error exposed. :/

Anyway, Josh also reminded me about this and I've sent out an updated one not touching above sensitive places. :-)

Thanks
Kevin

Quoted 62 lines

Cheers,

Richard

documentation/bsp-guide/bsp.xml

Quoted 13 lines
---
 documentation/bsp-guide/bsp.xml                    |    2 +-
 .../recipes/formfactor/formfactor_0.0.bbappend     |    2 +-
 .../recipes/linux/linux-yocto_git.bbappend         |    2 +-
 meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
documentation/bsp-guide/bsp.xml +0 -0
index 9e25068..0d716a3 100644
@@ -307,7 +307,7 @@

meta-bsp/packages/image-creator/image-creator-native_0.1.bb

documentation/bsp-guide/bsp.xml line 307

Quoted 1 line
documentation/bsp-guide/bsp.xml +0 -0
                 The example below shows extra files contained in a folder called ${PN}

(the package name).

documentation/bsp-guide/bsp.xml meta-bsp/packages/image-creator/image-creator-native_0.1.bb

Quoted 7 lines
documentation/bsp-guide/bsp.xml +1 -1
             </para>
             <programlisting>
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
             </programlisting>
             <para>
             This technique allows the BSP to add machine-specific configuration files to

the layer directory,

Review

Quoted 1 line
(quoted diff) +0 -0

b/meta-emenlow/recipes/formfactor/formfactor_0.0.bbappend

Review

Quoted 9 lines

index 4a41d48..a64f367 100644

meta-emenlow/recipes/formfactor/formfactor_0.0.bbappend +1 -1
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
 
 PRINC = "1"
(quoted diff) +0 -0

b/meta-emenlow/recipes/linux/linux-yocto_git.bbappend

Review

Quoted 9 lines

index 9fa2937..77c5223 100644

meta-emenlow/recipes/linux/linux-yocto_git.bbappend +1 -1
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS := "${THISDIR}/${PN}"
+FILESEXTRAPATHS = "${THISDIR}/${PN}"
 COMPATIBLE_MACHINE_emenlow = "emenlow"
 KMACHINE_emenlow  = "emenlow"
(quoted diff) +0 -0

b/meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend

Quoted 8 lines

index fac0921..c6f81d4 100644

meta-emenlow/recipes/linux/linux_2.6.33.2.bbappend +1 -1
@@ -1,3 +1,3 @@
-FILESPATH := "${FILESPATH}:${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESEXTRAPATH = "${THISDIR}/${PN}"
 SRC_URI += "file://defconfig"
 COMPATIBLE_MACHINE_emenlow = "emenlow"