Search code examples
yoctobitbakeyocto-recipe

bitbake-recipe fails to run do_install after clean or cleanall


I have been working on a bitbake -native recipe to that runs a script similar to python-env to generate some files in ${D}/var/.

SUMMARY = "Toolkit installer"
LICENSE = "CLOSED"

PN = "my-tools-native"

inherit native bin_package

COMPATIBLE_HOST = "x86_64-linux"

SRC_URI = "file://${TOOLKIT_INSTALLER}"

PV = "${TOOLKIT_RELEASE_VERSION}"

do_install() {
    # Extract native tools
    ${TOOLKIT_INSTALLER} -d ${D}/var/mytools
}

do_clean() {
    rm -rf ${D}/var/mytools
}

The first run works as expected. and the files are generated in ${D}/var/mytools. I run -c cleansstate/clean/cleanall, and the files in ${D}/var/mytools are removed as expected. After this any subsequent runs fail to populate ${D}/var/mytools

As far as I can tell, something about my setup makes it so that my stamp files are the same between cleans. I just dont know what I can do to work around my issue

I have tried "do_fetch[nostamp] = '1'" and that seems to force a re-run everytime, but the tool installation is costly and I do not want everything depending on this recipe to re-run as well.


Solution

  • I have found my issue, it looks like I should not be overwriting the do_clean method. Doing so prevents the STAMP_DIR from being erased and triggering a rebuild. If there are any extra steps needed in the clean process I did the following:

    do_special_clean() {
        # special clean example
        rm -fr ${TMPDIR}/work-shared/mytools
    }
    addtask do_special_clean before do_clean