Re: [meta-arago][scarthgap][PATCH 09/10] libyang: Do the version bump in a yocto-check-layer compliant manner

Denys Dmytriyenko <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arago
Message-ID <[email protected]>
On Thu, Nov 13, 2025 at 04:50:16PM -0600, Ryan Eatmon via lists.yoctoproject.org wrote:
> Yocto Project Compatibility requires that including a layer in a build
> not change recipes in other layers.  In this case, we were providing a
> newer version of a recipe that another layer provides.
> 
> The proper way of doing this is to create a bbappend and only change the
> minimal things needed to perform your changes.  Additionally, to pass
> the yocto-check-layer the bbappend needs to be wrapped in a manner that
> only applies your changes in the event that you are making use of your
> layer.  For Arago, that means only if we are building Arago.
> 
> Signed-off-by: Ryan Eatmon <[email protected]>
> ---
>  .../sysrepo/libyang-arago.inc                 |  9 ++++
>  .../sysrepo/libyang_%.bbappend                |  5 +++
>  .../recipes-extended/sysrepo/libyang_3.7.8.bb | 45 -------------------
>  3 files changed, 14 insertions(+), 45 deletions(-)
>  create mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
>  delete mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> 
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> new file mode 100644
> index 00000000..b76701a8
> --- /dev/null
> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> @@ -0,0 +1,9 @@
> +PV = "3.7.8"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> +
> +SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> +
> +do_install:append () {
> +    oe_multilib_header  libyang/ly_config.h
> +}

So, there's a weird problem with this change on scarthgap.

Since meta-oe/scarthgap provides an older 2.1.148 version of libyang, the 
original approach for meta-arago was to completely override the entire recipe 
with newer 3.7.8 version.

Now, for YP Compat compliance, it was converted into a .bbappend that adjusts 
the older version from meta-oe.

That older recipe in meta-oe has a multilib fix on top of standard CMake 
do_install() in the form of an :append

do_install:append () {
    oe_multilib_header  libyang/config.h
}

But the newer libyang renamed that config.h file into ly_config.h and now you 
have this code in our .bbappend

do_install:append () {
    oe_multilib_header  libyang/ly_config.h
}

But both :appends get applied and this results in the following error message:

| ERROR: libyang-3.7.8-r0 do_install: oe_multilib_header: Unable to find header libyang/config.h.

There's no easy way to disable or overwrite an existing :append, besides 
completely overriding the entire do_install() or the recipe itself...

But it appears this error is not fatal and does not seem to fail the build.


> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> index 608377e3..60d1258e 100644
> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> @@ -1 +1,6 @@
> +LIBYANG_ARAGO = ""
> +LIBYANG_ARAGO:arago = "libyang-arago.inc"
> +
> +require ${LIBYANG_ARAGO}
> +
>  BBCLASSEXTEND = "native nativesdk"
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb b/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> deleted file mode 100644
> index 3bea9bc2..00000000
> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -SUMMARY = "YANG data modeling language library"
> -DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
> -HOMEPAGE = "https://github.com/CESNET/libyang"
> -SECTION = "libs"
> -LICENSE = "BSD-3-Clause"
> -
> -LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> -
> -SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> -
> -SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
> -           file://0001-test_context-skip-test-case-test_searchdirs.patch \
> -           file://run-ptest \
> -           "
> -
> -S = "${WORKDIR}/git"
> -
> -# Main dependencies
> -inherit cmake pkgconfig lib_package ptest multilib_header
> -DEPENDS = "libpcre2"
> -DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
> -
> -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
> -EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
> -
> -do_compile:prepend () {
> -    if [ ${PTEST_ENABLED} = "1" ]; then
> -        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> -        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> -    fi
> -}
> -
> -do_install:append () {
> -        oe_multilib_header  libyang/ly_config.h
> -}
> -
> -do_install_ptest () {
> -    install -d ${D}${PTEST_PATH}/tests
> -    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
> -    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
> -    install -d ${D}${PTEST_PATH}/tests/plugins
> -    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
> -}
> -
> -FILES:${PN} += "${datadir}/yang/*"
> -- 
> 2.17.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.