On Thu, 2024-10-24 at 11:39 +0100, Sreejith Ravi via lists.openembedded.org 
wrote:
> Currently, RDEPENDS for -staticdev and -dev is set using EXTENDPKGV
> in meta/conf/bitbake.conf:
> ----------------------------------
> EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
> DEV_PKG_DEPENDENCY = "${PN} (= ${EXTENDPKGV})"
> RDEPENDS:${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
> ----------------------------------
> 
> During the do_package task, AUTOINC is replaced in PKGV
> (via package_setup_pkgv), which is used for creating the package name.
> However, Yocto sets RDEPENDS with PKGV during the recipe parsing stage,
> resulting in the RDEPENDS field in the IPK control data containing AUTOINC.
> 
> As the IPK name is generated with the updated PKGV, but the version in
> RDEPENDS still uses AUTOINC, this mismatch leads to installation failures.
> 
> Example: libnsl
> install libnsl-staticdev throws the error,  nothing provides
> libnsl-dev = 1.2.0+gitAUTOINC+4a062cf418-r0
> ----------------------------------
> IPKs available:
> libnsl2_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk
> libnsl-src_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk
> libnsl-dbg_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk
> libnsl-staticdev_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk
> libnsl-dev_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk
> 
> control data: libnsl-staticdev
> Package: libnsl-staticdev
> Version: 1.2.0+git0+4a062cf418-r0
> ----
> ----
> Depends: libnsl-dev (= 1.2.0+gitAUTOINC+4a062cf418-r0)
> Provides: libnsl2-staticdev
> Source: libnsl2_git.bb
> 
> control data: libnsl-dev
> Package: libnsl-dev
> Version: 1.2.0+git0+4a062cf418-r0
> ----
> ----
> Depends: libnsl2 (= 1.2.0+gitAUTOINC+4a062cf418-r0), libtirpc-dev
> Recommends: gcc-runtime-dev, glibc-dev, libtirpc-dev
> Provides: libnsl2-dev
> Source: libnsl2_git.bb
> ----------------------------------
> 
> This patch fixes the RDEPENDS versions set using EXTENDPKGV in the -dev and
> -staticdev packages. It replaces AUTOINC before generating the package 
> control data.
> 
> Updated control data:
> ----------------------------------
> Package: libnsl-dev
> Version: 1.2.0+git0+4a062cf418-r0
> ----
> ----
> Depends: libnsl2 (= 1.2.0+git0+4a062cf418-r0), libtirpc-dev
> Recommends: gcc-runtime-dev, glibc-dev, libtirpc-dev
> Provides: libnsl2-dev
> Source: libnsl2_git.bb
> 
> Package: libnsl-staticdev
> Version: 1.2.0+git0+4a062cf418-r0
> ----
> ----
> Depends: libnsl-dev (= 1.2.0+git0+4a062cf418-r0)
> Provides: libnsl2-staticdev
> Source: libnsl2_git.bb
> ----------------------------------
> 
> Signed-off-by: Sreejith Ravi <[email protected]>
> ---
>  meta/lib/oe/packagedata.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
> index 2d1d6ddeb7..332681d3ec 100644
> --- a/meta/lib/oe/packagedata.py
> +++ b/meta/lib/oe/packagedata.py
> @@ -171,8 +171,11 @@ def runtime_mapping_rename(varname, pkg, d):
>      #bb.note("%s before: %s" % (varname, d.getVar(varname)))
>  
>      new_depends = {}
> +    bb.build.exec_func("package_get_auto_pr", d)
>      deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "")
>      for depend, depversions in deps.items():
> +        if varname == "RDEPENDS":
> +            deps[depend] = [ver.replace("AUTOINC", 
> "%s"%d.getVar("PRSERV_PV_AUTOINC")) for ver in deps[depend]]
>          new_depend = get_package_mapping(depend, pkg, d, depversions)
>          if depend != new_depend:
>              bb.note("package name mapping done: %s -> %s" % (depend, 
> new_depend))
> 


This is a good start at debugging the issue which is clearly there but
it doesn't feel like the right fix to me. The question is why the code
in package.bbclass isn't replacing the values and writing them into the
data which forms packagedatav. We really need to fix this at the source
of the issue rather than working around it with special case handling
of RDEPENDS.

Do you have any idea why the code in do_package doesn't catch these?

Cheers,

Richard

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

Reply via email to