Skip to contentSkip to conversation

vim: fix xxd-native RPROVIDES

PATCH In review Denys Dmytriyenko 2 participants 3 messages Dec 4, 2024 – Jan 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vim: fix xxd-native RPROVIDES

From: Denys Dmytriyenko <[email protected]>

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.

---
 meta/recipes-support/vim/vim_9.1.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-support/vim/vim_9.1.bb +3 -1
index fee9f055e9..8968b8cb07 100644
@@ -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"
Signature · 1 line
2.35.3
#1 lore raw
Quoted 42 lines · Denys Dmytriyenko via lists.openembedded.org

From: Denys Dmytriyenko <[email protected]>

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.

---
 meta/recipes-support/vim/vim_9.1.bb | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-support/vim/vim_9.1.bb +0 -0
index fee9f055e9..8968b8cb07 100644
@@ -11,7 +11,9 @@ BBCLASSEXTEND = "native nativesdk"


 PACKAGES =+ "${PN}-xxd"
 FILES:${PN}-xxd = "${bindir}/xxd"

meta/recipes-support/vim/vim_9.1.bb +3 -1
-RPROVIDES:${PN}-xxd = "xxd"
+RPROVIDES:${BPN}-xxd = "xxd"
+RPROVIDES:${BPN}-xxd-native = "xxd-native"
+RPROVIDES:nativesdk-${BPN}-xxd = "nativesdk-xxd"
Quoted 3 lines


 ALTERNATIVE:${PN}-xxd = "xxd"
 ALTERNATIVE_TARGET[xxd] = "${bindir}/xxd"

This implies we'd have to go and change every reference of RPROVIDES:${PN}-XXX to the new pattern which I'm really not keen to mandate. I think we'll have to dig into the native class extension code and try and find a better solution :/

Cheers,

Richard

#2 lore raw
In reply to Denys Dmytriyenko
Quoted 42 lines · Denys Dmytriyenko via lists.openembedded.org

From: Denys Dmytriyenko <[email protected]>

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.

---
 meta/recipes-support/vim/vim_9.1.bb | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-support/vim/vim_9.1.bb +0 -0
index fee9f055e9..8968b8cb07 100644
@@ -11,7 +11,9 @@ BBCLASSEXTEND = "native nativesdk"


 PACKAGES =+ "${PN}-xxd"
 FILES:${PN}-xxd = "${bindir}/xxd"

meta/recipes-support/vim/vim_9.1.bb +3 -1
-RPROVIDES:${PN}-xxd = "xxd"
+RPROVIDES:${BPN}-xxd = "xxd"
+RPROVIDES:${BPN}-xxd-native = "xxd-native"
+RPROVIDES:nativesdk-${BPN}-xxd = "nativesdk-xxd"
Quoted 3 lines


 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

meta/classes-recipe/native.bbclass +6 -1
index d9651a7f22..0fad42a5a4 100644
@@ -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():
meta/conf/bitbake.conf +1 -0
index 620521e7da..340aa13b5d 100644
@@ -205,6 +205,7 @@ DATETIME = "${DATE}${TIME}"
 # its own in staging
 ASSUME_PROVIDED = "\
     bash-native \
+    bash-completion-native \
     bzip2-native \
     chrpath-native \
     diffstat-native \
meta/recipes-core/coreutils/coreutils_9.5.bb +3 -1
index af0fcdcc4c..ae07cba164 100644
@@ -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
meta/recipes-core/util-linux/util-linux_2.40.2.bb +2 -1
index 2c7dd154e1..5be35eabf8 100644
@@ -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}"