Skip to contentSkip to conversation

toolchain-script: use immediate expansion for TOOLCHAIN_CONFIGSITE_NOCACHE

PATCH In review Chen Qi 2 participants 4 messages Sep 23, 2016 – Sep 26, 2016

lore
Share & tools
lore
author
#1 lore raw

PATCH 1/1 toolchain-script: use immediate expansion for TOOLCHAIN_CONFIGSITE_NOCACHE

In reply to Chen Qi

Use immediate expansion for the assignment to avoid other classes modifying variables like HOST_ARCH which changes the result. This happens in the meta-environment recipe. It inherits cross-canadian which changes HOST_ARCH from TARGET_ARCH to SDK_ARCH, resulting in wrong site config files in the generated SDK.

[YOCTO #10255]

---
 meta/classes/toolchain-scripts.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/toolchain-scripts.bbclass +1 -1
index 997ff88..8df0967 100644
@@ -105,7 +105,7 @@ EOF
 }
 
 #we get the cached site config in the runtime
-TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d)}"
+TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d)}"
 TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d"
 TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses"
 
Signature · 1 line
1.9.1

Chen Qi

author
#0 lore raw

cover toolchain-script: use immediate expansion for TOOLCHAIN_CONFIGSITE_NOCACHE

The following changes since commit 7e0f95bf359bc3b5bb1578024a993e184de155cd:

base.bbclass: Drop unnecessary dirs setting (2016-09-22 11:08:23 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/siteconfig
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/siteconfig

Chen Qi (1):
toolchain-script: use immediate expansion for
TOOLCHAIN_CONFIGSITE_NOCACHE

 meta/classes/toolchain-scripts.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.9.1
#2 lore raw
In reply to Chen Qi
Quoted 10 lines · Chen Qi

Use immediate expansion for the assignment to avoid other classes modifying
variables like HOST_ARCH which changes the result. This happens in the
meta-environment recipe. It inherits cross-canadian which changes HOST_ARCH
from TARGET_ARCH to SDK_ARCH, resulting in wrong site config files in the
generated SDK.

Quoted 6 lines

[YOCTO #10255]

---
 meta/classes/toolchain-scripts.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)

I've not merged this as yet since I worry that this is something we'd easily break again. It all depends which order classes are included and moving the cross-canadian inherit in meta-environment would break this even with immediate expansion.

I think the best way to fix this might be to change the meta- environment to add:

# Need to expand here before cross-candian changes HOST_ARCH -> SDK_ARCH TOOLCHAIN_CONFIGSITE_NOCACHE := "${TOOLCHAIN_CONFIGSITE_NOCACHE}"

before it inherits cross-candian, then the problem is explicitly recorded and worked around.

Cheers,

Richard

author
#3 lore raw
Quoted 28 lines · Richard Purdie
Quoted 10 lines · Chen Qi

Use immediate expansion for the assignment to avoid other classes modifying
variables like HOST_ARCH which changes the result. This happens in the
meta-environment recipe. It inherits cross-canadian which changes HOST_ARCH
from TARGET_ARCH to SDK_ARCH, resulting in wrong site config files in the
generated SDK.

Quoted 6 lines

[YOCTO #10255]

---
  meta/classes/toolchain-scripts.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

I've not merged this as yet since I worry that this is something we'd easily break again. It all depends which order classes are included and moving the cross-canadian inherit in meta-environment would break this even with immediate expansion.

I think the best way to fix this might be to change the meta- environment to add:

# Need to expand here before cross-candian changes HOST_ARCH -> SDK_ARCH TOOLCHAIN_CONFIGSITE_NOCACHE := "${TOOLCHAIN_CONFIGSITE_NOCACHE}"

Quoted 7 lines

before it inherits cross-candian, then the problem is explicitly recorded and worked around.

Cheers,

Richard

Thanks a lot.
I've verified this solution.
A new patch has been sent out.

Best Regards,
Chen Qi