Skip to contentSkip to conversation

nativesdk.bbclass: set consistent staging dirs regardless of multilib

PATCH New Chen Qi 1 participant 2 messages Sep 27, 2018

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

v2 cover nativesdk.bbclass: set consistent staging dirs regardless of multilib

Changes in V2:
* use 'recipe-sysroot' instead of 'nativesdk-recipe-sysroot'

The following changes since commit 5cd00e3e53819f3c10d1733480077ce9f3cc2ca8:

bitbake: fetch2/gitsm.py: Rework the git submodule fetcher (2018-09-26 15:14:33 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/nativesdk-recipe-sysroot
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/nativesdk-recipe-sysroot

Chen Qi (1):
nativesdk.bbclass: set consistent staging dirs regardless of multilib

 meta/classes/nativesdk.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/1 nativesdk.bbclass: set consistent staging dirs regardless of multilib

For now, the RECIPE_SYSROOT of nativesdk recipes is ${WORKDIR}/recipe-sysroot if multilib is disabled and ${WORKDIR}/nativesdk-recipe-sysroot if multilib is enabled. And it's causing chaos. Problems I've met include:
1) 'File Exists' error when doing extend_recipe_sysroot
2) Rebuilding failure about cmake based nativesdk recipes if toggling multilib

In nativesdk.bbclass, We've set MULTILIBS to be "", and we've changed MLPREFIX to be 'nativesdk-', I think we should also set consistent RECIPE_SYSROOT to be ${WORKDIR}/recipe-sysroot.

Below is an example showing why previous settings will cause do_prepare_recipe_sysroot failure.

e.g.
A -> C
B -> C
A's RECIPE_SYSROOT is .../recipe-sysroot and B's RECIPE_SYSROOT is .../nativesdk-recipe-sysroot.
As extend_recipe_sysroot function uses shared manifest, i.e., the same manifest of C for both A and B, then there must be one of them having the wrong manifest. And the wrong manifest results in RECIPE_SYSROOT not cleaned up before installing new components, thus the following error.

Exception: FileExistsError: [Errno 17] File exists: xxx -> xxx

This happens when toggling multilib and also between nativesdk recipes and crosssdk, cross-canadian recipes. The latter situation also explains
why choosing ${WORKDIR}/recipe-sysroot instead of ${WORKDIR}/nativesdk-recipe-sysroot. If we use 'nativesdk-recipe-sysroot', we still need to modify the extend_recipe_sysroot function to treat crosssdk and cross-canadian as special cases. Using 'recipe-sysroot' does not have this problem.

---
 meta/classes/nativesdk.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/nativesdk.bbclass +5 -0
index ab566e9..f25b0c3 100644
@@ -12,6 +12,11 @@ MACHINEOVERRIDES = ""
 
 MULTILIBS = ""
 
+# we need consistent staging dir whether or not multilib is enabled
+STAGING_DIR_HOST = "${WORKDIR}/recipe-sysroot"
+STAGING_DIR_TARGET = "${WORKDIR}/recipe-sysroot"
+RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
+
 #
 # Update PACKAGE_ARCH and PACKAGE_ARCHS
 #
Signature · 1 line
1.9.1