]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
native: Use dynamic filtering for PROVIDES
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Feb 2026 14:41:07 +0000 (14:41 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Feb 2026 10:31:28 +0000 (10:31 +0000)
Currently, PROVIDES is one of the few variables left which isn't handled by
filter code dynamically. This lead to bugs if for example you have a
PACKAGECONFIG value which references DISTRO_FEATURES, and DISTRO_FEATURES
is being set in the the native case late by backfill. The early expansion
of the value means it can use an incorrect DISTRO_FEATURES value leading to
confusing errors.

Convert the code to use a filter in common with the other code in the class.

This does lead to some behaviour differences outside OE-Core in meta-oe for
example where the PROVIDES of gd-native changed:

"gd-native gd-native-tools"
to
"gd-native gd-tools-native"

where the change is a clear improvement in correctness.

This fixes issues when DISTRO_FEATURES has backfill options in place in
the native case.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/native.bbclass

index d109907841c984082fc934663381fe2a01da989f..98466b1902d60700f00111ef2d0a4c9ffe5cc590 100644 (file)
@@ -166,18 +166,7 @@ python native_virtclass_handler () {
     d.setVarFilter("PACKAGES", "native_filter(val, '" + pn + "', '" + bpn + "')")
     d.setVarFilter("PACKAGES_DYNAMIC", "native_filter(val, '" + pn + "', '" + bpn + "', regex=True)")
 
-    provides = e.data.getVar("PROVIDES")
-    nprovides = []
-    for prov in provides.split():
-        if prov.find(pn) != -1:
-            nprovides.append(prov)
-        elif not prov.endswith("-native"):
-            nprovides.append(prov + "-native")
-        else:
-            nprovides.append(prov)
-    e.data.setVar("PROVIDES", ' '.join(nprovides))
-
-
+    d.setVarFilter("PROVIDES", "native_filter(val, '" + pn + "', '" + bpn + "')")
 }
 
 addhandler native_virtclass_handler