On Wed, 2024-12-04 at 18:09 -0500, Denys Dmytriyenko via lists.openembedded.org 
wrote:
> From: Denys Dmytriyenko <de...@konsulko.com>
> 
> BBCLASSEXTEND doesn't handle overrides with suffixed ${PN} for
> native class, e.g.:
> 
> RPROVIDES:${PN}-xxd = "xxd"
> 
> becomes:
> 
> RPROVIDES:vim-native-xxd = "xxd-native"
> 
> instead of:
> 
> RPROVIDES:vim-xxd-native = "xxd-native"
> 
> This results in "Nothing RPROVIDES xxd-native" error when
> something RDEPENDS on xxd-native because there's no such
> package as vim-native-xxd.
> 
> Use ${BPN} and explicitly handle RPROVIDES.
> 
> Since native class does not produce packages, other variables
> using :${PN}-xxd override don't matter. And nativesdk class
> is not affected, as it uses a prefix, not suffix.
> 
> Signed-off-by: Denys Dmytriyenko <de...@konsulko.com>
> ---
>  meta/recipes-support/vim/vim_9.1.bb | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-support/vim/vim_9.1.bb 
> b/meta/recipes-support/vim/vim_9.1.bb
> index fee9f055e9..8968b8cb07 100644
> --- a/meta/recipes-support/vim/vim_9.1.bb
> +++ b/meta/recipes-support/vim/vim_9.1.bb
> @@ -11,7 +11,9 @@ BBCLASSEXTEND = "native nativesdk"
>  
>  PACKAGES =+ "${PN}-xxd"
>  FILES:${PN}-xxd = "${bindir}/xxd"
> -RPROVIDES:${PN}-xxd = "xxd"
> +RPROVIDES:${BPN}-xxd = "xxd"
> +RPROVIDES:${BPN}-xxd-native = "xxd-native"
> +RPROVIDES:nativesdk-${BPN}-xxd = "nativesdk-xxd"
>  
>  ALTERNATIVE:${PN}-xxd = "xxd"
>  ALTERNATIVE_TARGET[xxd] = "${bindir}/xxd"

I've included a different patch for this below. The downside is that as
usual, by improving the native class extend, we expose issues in other
recipes. There are various fixes to allow "bitbake world -g" with core
to at least not fail parsing or throw warnings. There may be other more
subtle changes.

Cheers,

Richard

diff --git a/meta/classes-recipe/native.bbclass 
b/meta/classes-recipe/native.bbclass
index d9651a7f22..0fad42a5a4 100644
--- a/meta/classes-recipe/native.bbclass
+++ b/meta/classes-recipe/native.bbclass
@@ -158,7 +158,12 @@ python native_virtclass_handler () {
                 newdeps.append(dep.replace(pn, bpn) + "-native")
             else:
                 newdeps.append(dep)
-        d.setVar(varname, " ".join(newdeps))
+        output_varname = varname
+        # Handle ${PN}-xxx -> ${BPN}-xxx-native
+        if suffix != "${PN}" and "${PN}" in suffix:
+            output_varname = varname.replace("${PN}", "${BPN}") + "-native"
+            d.renameVar(varname, output_varname)
+        d.setVar(output_varname, " ".join(newdeps))
 
     map_dependencies("DEPENDS", e.data, selfref=False)
     for pkg in e.data.getVar("PACKAGES", False).split():
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 620521e7da..340aa13b5d 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -205,6 +205,7 @@ DATETIME = "${DATE}${TIME}"
 # its own in staging
 ASSUME_PROVIDED = "\
     bash-native \
+    bash-completion-native \
     bzip2-native \
     chrpath-native \
     diffstat-native \
diff --git a/meta/recipes-core/coreutils/coreutils_9.5.bb 
b/meta/recipes-core/coreutils/coreutils_9.5.bb
index af0fcdcc4c..ae07cba164 100644
--- a/meta/recipes-core/coreutils/coreutils_9.5.bb
+++ b/meta/recipes-core/coreutils/coreutils_9.5.bb
@@ -182,7 +182,9 @@ RDEPENDS:${PN}-ptest += "bash findutils gawk make perl 
perl-modules python3-core
 # may need tweaking if DEPENDS changes
 # Can't use ${PN}-dev here since flags with overrides and key expansion not 
supported
 RRECOMMENDS:coreutils-dev[nodeprrecs] = "1"
-RRECOMMENDS:${PN}-dev += "acl-dev attr-dev gmp-dev libcap-dev bash-dev 
findutils-dev gawk-dev shadow-dev"
+DEVDEPS = "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev 
shadow-dev"
+DEVDEPS:class-native = ""
+RRECOMMENDS:${PN}-dev += "${DEVDEPS}"
 
 do_install_ptest () {
     install -d ${D}${PTEST_PATH}/tests
diff --git a/meta/recipes-core/util-linux/util-linux_2.40.2.bb 
b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
index 2c7dd154e1..5be35eabf8 100644
--- a/meta/recipes-core/util-linux/util-linux_2.40.2.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
@@ -59,7 +59,8 @@ python util_linux_libpackages() {
 
 PACKAGESPLITFUNCS =+ "util_linux_libpackages"
 
-PACKAGES_DYNAMIC = "^${PN}-.*"
+PACKAGES_DYNAMIC = "^${MLPREFIX}${BPN}-.*"
+PACKAGES_DYNAMIC:class-native = "^${PN}-.*-native"
 
 UTIL_LINUX_LIBDIR = "${libdir}"
 UTIL_LINUX_LIBDIR:class-target = "${base_libdir}"



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#209426): 
https://lists.openembedded.org/g/openembedded-core/message/209426
Mute This Topic: https://lists.openembedded.org/mt/109930389/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to