Skip to contentSkip to conversation

uutils-coreutils: make selinux PACKAGECONFIG dependend on clang-layer

PATCH In review Hiago De Franco 4 participants 10 messages Apr 16 – Apr 17 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uutils-coreutils: make selinux PACKAGECONFIG dependend on clang-layer

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -1
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 
Signature · 1 line
2.51.0
#1 lore raw
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

Quoted 43 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -2
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#126407): https://lists.openembedded.org/g/openembedded-devel/message/126407
Mute This Topic: https://lists.openembedded.org/mt/118863961/6084445
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 11 lines · Gyorgy Sarvari
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Quoted 4 lines

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I fist spotted this on scarthgap, changed to master to test it too but I probably did something wrong and kept the clang-layer or something during my test. Sorry, my mistake.

Thanks for letting me know clang-native is actually on oe-core now, I fount the commit [0]. So maybe I should propose a backport of this to fix the scarthgap issue?

I will do a test now on Scarthgap, cherry-picking this commit to see how it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

Thanks,
Hiago.

Quoted 47 lines
Quoted 46 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -2
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#126407): https://lists.openembedded.org/g/openembedded-devel/message/126407
Mute This Topic: https://lists.openembedded.org/mt/118863961/6084445
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 22 lines · Hiago De Franco via lists.openembedded.org
Quoted 11 lines · Gyorgy Sarvari
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Quoted 4 lines

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I fist spotted this on scarthgap, changed to master to test it too but I probably did something wrong and kept the clang-layer or something during my test. Sorry, my mistake.

Quoted 8 lines

Thanks for letting me know clang-native is actually on oe-core now, I fount the commit [0]. So maybe I should propose a backport of this to fix the scarthgap issue?

I will do a test now on Scarthgap, cherry-picking this commit to see how it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

So it is actually harder than only cherry-picking this commit, there are more commits needed and they do not actually fit into Scarthgap.

A BBMASK on uutils-coreutils will fix the issue for now, until I move to the next LTS.

Sorry for the noise, please ignore this patch since it is not suitable for master branch.

Regards,
Hiago.

Quoted 54 lines

Thanks,
Hiago.

Quoted 32 lines
Quoted 32 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -1
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
Quoted 9 lines

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb require ${BPN}-crates.inc · line 34

Quoted 8 lines
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +0 -0
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
Quoted 27 lines · Hiago De Franco
Quoted 26 lines · Hiago De Franco via lists.openembedded.org
Quoted 11 lines · Gyorgy Sarvari
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Quoted 4 lines

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I fist spotted this on scarthgap, changed to master to test it too but I probably did something wrong and kept the clang-layer or something during my test. Sorry, my mistake.

Thanks for letting me know clang-native is actually on oe-core now, I fount the commit [0]. So maybe I should propose a backport of this to fix the scarthgap issue?

Quoted 7 lines
Quoted 4 lines

I will do a test now on Scarthgap, cherry-picking this commit to see how it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

So it is actually harder than only cherry-picking this commit, there are more commits needed and they do not actually fit into Scarthgap.

That commit was a very major change in oe-core that took months to sort out, it wouldn't be considered for acceptance in Scarthgap.

Quoted 3 lines

A BBMASK on uutils-coreutils will fix the issue for now, until I move to the next LTS.

I think your patch could be acceptable and useful for Scarthgap, if you are interested in that.

Quoted 61 lines

Sorry for the noise, please ignore this patch since it is not suitable for master branch.

Regards,
Hiago.

Quoted 54 lines

Thanks,
Hiago.

Quoted 32 lines
Quoted 32 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -1
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
Quoted 9 lines

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb require ${BPN}-crates.inc · line 34

Quoted 8 lines
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +0 -0
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw
In reply to Gyorgy Sarvari
Quoted 42 lines · Gyorgy Sarvari
Quoted 27 lines · Hiago De Franco
Quoted 26 lines · Hiago De Franco via lists.openembedded.org
Quoted 11 lines · Gyorgy Sarvari
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Quoted 4 lines

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I fist spotted this on scarthgap, changed to master to test it too but I probably did something wrong and kept the clang-layer or something during my test. Sorry, my mistake.

Thanks for letting me know clang-native is actually on oe-core now, I fount the commit [0]. So maybe I should propose a backport of this to fix the scarthgap issue?

Quoted 7 lines
Quoted 4 lines

I will do a test now on Scarthgap, cherry-picking this commit to see how it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

So it is actually harder than only cherry-picking this commit, there are more commits needed and they do not actually fit into Scarthgap.

That commit was a very major change in oe-core that took months to sort out, it wouldn't be considered for acceptance in Scarthgap.

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

A BBMASK on uutils-coreutils will fix the issue for now, until I move to the next LTS.

I think your patch could be acceptable and useful for Scarthgap, if you are interested in that.

I am interested. Just for clarification, you mean the original patch I sent, not the BBMASK patch, right?

If this is about the original patch, I can add it to Scarthgap and re-send.

Regards,
Hiago.

Quoted 64 lines
Quoted 63 lines

Sorry for the noise, please ignore this patch since it is not suitable for master branch.

Regards,
Hiago.

Quoted 54 lines

Thanks,
Hiago.

Quoted 32 lines
Quoted 32 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -1
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
Quoted 9 lines

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb require ${BPN}-crates.inc · line 34

Quoted 8 lines
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +0 -0
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#8 lore raw
Quoted 47 lines · Hiago De Franco
Quoted 46 lines · Gyorgy Sarvari
Quoted 27 lines · Hiago De Franco
Quoted 26 lines · Hiago De Franco via lists.openembedded.org
Quoted 11 lines · Gyorgy Sarvari
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Quoted 4 lines

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I fist spotted this on scarthgap, changed to master to test it too but I probably did something wrong and kept the clang-layer or something during my test. Sorry, my mistake.

Thanks for letting me know clang-native is actually on oe-core now, I fount the commit [0]. So maybe I should propose a backport of this to fix the scarthgap issue?

Quoted 7 lines
Quoted 4 lines

I will do a test now on Scarthgap, cherry-picking this commit to see how it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

So it is actually harder than only cherry-picking this commit, there are more commits needed and they do not actually fit into Scarthgap.

That commit was a very major change in oe-core that took months to sort out, it wouldn't be considered for acceptance in Scarthgap.

Quoted 3 lines

A BBMASK on uutils-coreutils will fix the issue for now, until I move to the next LTS.

Quoted 9 lines
Quoted 2 lines

I think your patch could be acceptable and useful for Scarthgap, if you are interested in that.

I am interested. Just for clarification, you mean the original patch I sent, not the BBMASK patch, right?

If this is about the original patch, I can add it to Scarthgap and re-send.

Yes, I meant it for the original patch - I didn't realize that Clayton took a stab at the very same issue also. This is an issue that I think deserves a patch, it does have a hidden dependency on meta-clang which is not nice, and apparently caused some headaches for multiple people.

I do see Anuj's issue with Clayton's patch, as it changes the default behavior - I think this patch could have a better chance as it tries to keep the original behavior.

But overall I don't have a strong opinion on the way it is solved, if there is a patch that makes everyone happy.

Quoted 67 lines

Regards,
Hiago.

Quoted 64 lines
Quoted 63 lines

Sorry for the noise, please ignore this patch since it is not suitable for master branch.

Regards,
Hiago.

Quoted 54 lines

Thanks,
Hiago.

Quoted 32 lines
Quoted 32 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -1
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
Quoted 9 lines

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb require ${BPN}-crates.inc · line 34

Quoted 8 lines
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +0 -0
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#9 lore raw
Quoted 63 lines · Gyorgy Sarvari
Quoted 47 lines · Hiago De Franco
Quoted 46 lines · Gyorgy Sarvari
Quoted 27 lines · Hiago De Franco
Quoted 26 lines · Hiago De Franco via lists.openembedded.org
Quoted 11 lines · Gyorgy Sarvari
Quoted 8 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Quoted 4 lines

But meta-clang doesn't provide clang-native anymore, it's a shadow of what it used to be - clang-native comes from oe-core. Or am I misunderstanding the problem here? I don't really get the role of meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I fist spotted this on scarthgap, changed to master to test it too but I probably did something wrong and kept the clang-layer or something during my test. Sorry, my mistake.

Thanks for letting me know clang-native is actually on oe-core now, I fount the commit [0]. So maybe I should propose a backport of this to fix the scarthgap issue?

Quoted 7 lines
Quoted 4 lines

I will do a test now on Scarthgap, cherry-picking this commit to see how it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

So it is actually harder than only cherry-picking this commit, there are more commits needed and they do not actually fit into Scarthgap.

That commit was a very major change in oe-core that took months to sort out, it wouldn't be considered for acceptance in Scarthgap.

Quoted 3 lines

A BBMASK on uutils-coreutils will fix the issue for now, until I move to the next LTS.

Quoted 9 lines
Quoted 2 lines

I think your patch could be acceptable and useful for Scarthgap, if you are interested in that.

I am interested. Just for clarification, you mean the original patch I sent, not the BBMASK patch, right?

If this is about the original patch, I can add it to Scarthgap and re-send.

Yes, I meant it for the original patch - I didn't realize that Clayton took a stab at the very same issue also. This is an issue that I think deserves a patch, it does have a hidden dependency on meta-clang which is not nice, and apparently caused some headaches for multiple people.

Quoted 6 lines

I do see Anuj's issue with Clayton's patch, as it changes the default behavior - I think this patch could have a better chance as it tries to keep the original behavior.

But overall I don't have a strong opinion on the way it is solved, if there is a patch that makes everyone happy.

Got it, thanks. I will submit the patch to scarthgap, let's seeh how it goes.

Quoted 70 lines
Quoted 69 lines

Regards,
Hiago.

Quoted 64 lines
Quoted 63 lines

Sorry for the noise, please ignore this patch since it is not suitable for master branch.

Regards,
Hiago.

Quoted 54 lines

Thanks,
Hiago.

Quoted 32 lines
Quoted 32 lines

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +11 -1
index 8b9b4dc199..99beb70104 100644
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
Quoted 9 lines

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb require ${BPN}-crates.inc · line 34

Quoted 8 lines
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +0 -0
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#10 lore raw
In reply to Hiago De Franco
Quoted 43 lines · Hiago De Franco via lists.openembedded.org

SELinux layer build fails if 'meta-clang' is not present, which shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls 'clang-native' even if uutils-coreutils is not being used (this is enough to make the recipe fails on parsing time if meta-clang is not present).

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a warning if the user wants selinux support o uutils-coreutils but haven't add clang-layer.

---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/ uutils-coreutils_0.8.0.bb
index 8b9b4dc199..99beb70104 100644

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +0 -1
@@ -18,7 +18,17 @@ require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux

systemd', d)}"

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +2 -0
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that

require clang-layer

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +3 -0
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True,

False, d):

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +3 -0
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in

BBFILE_COLLECTIONS, "
+ "selinux support will be disabled. Add meta-clang to your
bblayers.conf "

meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb require ${BPN}-crates.inc · line 31

Quoted 2 lines
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb +2 -0
+                "if selinux support on uutils-coreutils is required.")
+}

what does it need from meta-clang these days, we have merged clang compiler infrastructure in
core layer on master.

Quoted 19 lines

PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native
libselinux-native libselinux"
PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"

--
2.51.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#126407):
https://lists.openembedded.org/g/openembedded-devel/message/126407
Mute This Topic: https://lists.openembedded.org/mt/118863961/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-