11

bitbake cleanall Removes all output files, shared state cache, and downloaded source files for a target

It is not clear or documented if it cleans all build time dependencies as well

Mohit
  • 183
  • 1
  • 3
  • 9

5 Answers5

16

If you want to clean everything do,

bitbake world -c cleanall --continue

The --continue will ignore any dependency errors while cleaning. Continue as much as possible after an error.

JSixface
  • 577
  • 7
  • 11
10

No, cleanall does not clean dependencies. eg

  bitbake -c cleanall core-image-minimal

only removes the output of that named recipe.

What i usually do to clean "everything" is running cleanall on the receipe "world":

bitbake -c cleanall world 

If that fails because of unresolvable packages like that:

ERROR: Nothing PROVIDES 'sg3-utils' (but /home/blubb/meta-freescale/recipes-devtools/utp-com/utp-com_git.bb DEPENDS on or otherwise requires it).

I just add the packages temporary to the ASSUME_PROVIDED variable like this :

bitbake -c cleanall world --ignore-deps=python-nativedtc-native --ignore-deps=sg3-utils

If nothing provides this packages it is unlikely that they where ever build.

Matthias
  • 724
  • 7
  • 14
  • 2
    When 'cleanall world' runs properly the normal progress bar is displayed with plenty of "*do_clean*" tasks – Tenacious Dec 09 '19 at 21:52
6

Please read the mega-manual section do_cleanall .

do_cleanall removes:

  • all output files
  • shared state (sstate) cache
  • and downloaded source files for a target (i.e. the contents of DL_DIR).

You can run this task using BitBake as follows:

 $ bitbake -c cleanall <recipe-name>

If recipe name is not passed to cleanall task it does not work.

sob
  • 982
  • 11
  • 31
2

Removes all output files, shared state (sstate) cache, and downloaded source files for a target (i.e. the contents of DL_DIR). Essentially, the do_cleanall task is identical to the do_cleansstate task with the added removal of downloaded source files.

You can run this task using BitBake as follows:

 $ bitbake -c cleanall recipe

Typically, you would not normally use the cleanall task. Do so only if you want to start fresh with the do_fetch task.

Rajeshkumar
  • 739
  • 5
  • 16
  • 2
    +1 for the -c cleansstate explanation. Exactly what I needed: cleanup so everything gets rebuild but no need to redownload all packages. – Michel Nov 28 '19 at 08:59
0

Other folks have already answered that bitbake does not automatically clean dependencies, but you can create an Inter-task dependency (https://www.yoctoproject.org/docs/3.1/bitbake-user-manual/bitbake-user-manual.html#inter-task-dependencies) to clean your dependencies if needed by adding a command to the recipe:

do_task[depends] = "recipe:task"

We've extended bitbake to build native recipes and automatically run unit tests during a build. In that case we need to clean the native recipe when cleaning the target so you could add:

do_clean[depends] = "${PN}-native:do_clean"
do_cleanall[depends] = "${PN}-native:do_cleanall"
do_cleansstate[depends] = "${PN}-native:do_cleansstate"

That solution falls a bit short because the native recipes will attempt to clean ${PN}-native-native, so you'll need a conditional to not apply if it's already native:

do_clean[depends] += "${@'' if bb.data.inherits_class('native', d) else '${PN}-native:do_clean'}"
do_cleanall[depends] += "${@'' if bb.data.inherits_class('native', d) else '${PN}-native:do_cleanall'}"
do_cleansstate[depends] += "${@'' if bb.data.inherits_class('native', d) else '${PN}-native:do_cleansstate'}"
jsl4980
  • 496
  • 2
  • 12