0

Yocto newbie here and seeking advice as to how to append variables of another recipe from my recipe. To provide more context lets say there is a some recipe file packagegroup-common.bb defined in a package that i cannot modify and i need to run tests of my package.

inherit packagegroup
    
# Only include for debug image
    RDEPENDS:${PN}:append:variant-debug = " \
        framework-ptest \
        inputd-ptest \
        foo-test \
        ... \
        "

is there a way to append to that variable from my recipe bar.bb basically my recipe looks like

    SUMMARY = "Bar"
    DESCRIPTION = "Bar Recipe"
    LICENSE = "CLOSED"
    
    DEPENDS = "bar-interface googletest"
    
    SRC_URI = "git://zzz/Bar;protocol=ssh;branch=mainline; \
               file://run-ptest \
              "
    SRCREV = "zzzzzzzz"
    
    S = "${WORKDIR}/git"
    
    inherit cmake ptest
    
    do_install_ptest() {
        mkdir -p ${D}${PTEST_PATH}/tests
        cp -rf ${B}/src/test/Bar ${D}${PTEST_PATH}/tests
    }
    
# workarounds that i have been trying are

    IMAGE_INSTALL:append = " bar-ptest"
    CORE_IMAGE_EXTRA_INSTALL:append = " bar-ptest"
    
    
    RDEPENDS:packagegroup-common:append:variant-debug = " bar-ptest "
    RDEPENDS:${PN}:append:variant-debug = " \
        bar-ptest \
        "

But nothing is working so far, seems like you have to add bar-ptest in packagegroup-common.bb RDEPENDS to run ptest-runner bar because otherwise i am seeing the error message

bar ptest isn't available.

If i run ptest-runner -l , i am able to see all other ptest specified in RDEPENDS of packagegroup-common.bb. Any advice or insights or workarounds for this issue is greatly appreciated.

bourne
  • 1,083
  • 4
  • 14
  • 27
  • You can create a bbappend file for the original recipe, called `packagegroup-common.bbappend` - and put in your own layer. Whatever you put into this, it will be merged with the original `.bb` file during building. You can put `RDEPENDS:${PN} += "whatever-extra-package"` inside it to extend the desired variable. – skandigraun Aug 28 '23 at 07:06
  • @skandigraun thanks so much for the suggestion, so as suggested i added a bbappend file with the following content only `RDEPENDS:${PN}:append:variant-debug = " \ bar-ptest \"` – bourne Aug 28 '23 at 08:08
  • but now i am seeing the following error `[buildfarm-ssh] ERROR: Nothing RPROVIDES '\optee-client' (but /opt/workspace/FooSdk/foo/meta-foo/recipes-core/packagegroups/packagegroup-common.bb RDEPENDS on or otherwise requires it) NOTE: Runtime target '\optee-client' is unbuildable, removing... Missing or unbuildable dependency chain was: ['\\optee-client'] [buildfarm-ssh] NOTE: Runtime target 'packagegroup-common' is unbuildable, removing... ` – bourne Aug 28 '23 at 08:08
  • `[buildfarm-ssh] ERROR: Required build target 'image-ivi' has no buildable providers. Missing or unbuildable dependency chain was: ['image-ivi', 'packagegroup-common', '\\optee-client'] ` i checked packagegroup-common.bb, there i sno hits for this optee-client – bourne Aug 28 '23 at 08:16
  • Please note the two changes i did was create a file package-common.bbappend adjacent to my bar.bb file and than removed all my workarounds in my bar.bb file except `IMAGE_INSTALL:append = " bar-ptest" ` – bourne Aug 28 '23 at 08:21
  • You could do `grep -r optee /opt/workspace/FooSdk/foo/meta-foo` to see which recipe requires it. It's interesting that it builds without the bbappend. Maybe `bar-interface` depends on optee-client? – skandigraun Aug 28 '23 at 10:50
  • 1
    You know, that "\" at the start of `\optee-client` looks like a typo, which shouldn't be there. Maybe a linebreak slash that slipped the wrong way? – skandigraun Aug 28 '23 at 11:04

0 Answers0