Skip to contentSkip to conversation

staging.bbclass: Inlcude native dirs for nativesdk build

PATCH In review Vyacheslav Yurkov 2 participants 2 messages Nov 10, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging.bbclass: Inlcude native dirs for nativesdk build

Some build systems (like cmake) check whether target binaries are present even if they are not used during compilation. Excluded ${bindir} causes such recipes to fail to build nativesdk variant. The good example of that is protobuf/grpc nativesdk build from meta-oe layer.

For more details refer this long discussion:
https://lists.openembedded.org/g/openembedded-devel/topic/101679410#105284

---
 meta/classes-global/staging.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes-global/staging.bbclass +1 -0
index d229f40107..72c811d609 100644
@@ -26,6 +26,7 @@ SYSROOT_DIRS_NATIVE = " \
     ${localstatedir} \
 "
 SYSROOT_DIRS:append:class-native = " ${SYSROOT_DIRS_NATIVE}"
+SYSROOT_DIRS:append:class-nativesdk = " ${SYSROOT_DIRS_NATIVE}"
 SYSROOT_DIRS:append:class-cross = " ${SYSROOT_DIRS_NATIVE}"
 SYSROOT_DIRS:append:class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"
 
Signature · 1 line
2.35.1
#1 lore raw
Quoted 18 lines · Vyacheslav Yurkov

Some build systems (like cmake) check whether target binaries are present even if they are not used during compilation. Excluded ${bindir} causes such recipes to fail to build nativesdk variant. The good example of that is protobuf/grpc nativesdk build from meta-oe layer.

For more details refer this long discussion:
https://lists.openembedded.org/g/openembedded-devel/topic/101679410#105284

---
 meta/classes-global/staging.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes-global/staging.bbclass +0 -0
index d229f40107..72c811d609 100644

meta/classes-global/staging.bbclass SYSROOT_DIRS_NATIVE = " \ · line 32

Quoted 7 lines
meta/classes-global/staging.bbclass +1 -0
@@ -26,6 +26,7 @@ SYSROOT_DIRS_NATIVE = " \
     ${localstatedir} \
 "
 SYSROOT_DIRS:append:class-native = " ${SYSROOT_DIRS_NATIVE}"
+SYSROOT_DIRS:append:class-nativesdk = " ${SYSROOT_DIRS_NATIVE}"
 SYSROOT_DIRS:append:class-cross = " ${SYSROOT_DIRS_NATIVE}"
 SYSROOT_DIRS:append:class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"
 

This has disk space performance implications. We don't want to to this just because there is one "bad" recipe out there. I think we should be working around the issue in that recipe, or changing cmake not to have the issue. Adding a load of pointless binaries to the sysroot for all recipes is not a good solution for us.

Cheers,

Richard