Use middle ouput (json file) from another recipe (another git repo) for a yocto build, is it possible?

Viewed 26

Git repo A, requires the generated file (middle output of a json file m.json, doesn't require the full build of B) from another repo B.

A.bb:

DEPENDS="\
     B \            #should B be added as a dependency here?
"

RDEPENDS_${PN} = " \
            B \       # If I add B here, bitbake B will be run before bitbake A, is it right?
"


SRC_URI="git://git@A.git;name=A \
         git://git@B.git;name=B \
"

SRCREV_A="${AUTOREV}
SRCREV_B="${AUTOREV}"

do_configure()
{
    pushd ${S}/B
    generated-middle-output-json-file.sh
    popd
    
    pushd ${S}/A
    use-json.sh 
    popd
}

Is this the correct way to write this recipe? Looking for any suggestions, I'm new to yocto build. Thanks.

1 Answers

The correct thing to do would be to add a DEPENDS on B. In the B recipe you'd install the file into the sysroot as part of the do_install step and then you'd access if from the sysroot in A. The sysroot is used as a place to share output between recipes.

Related