Yocto: : does bitbake cleanall ,cleans dependencies as well
Asked Answered
B

5

17

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

Beneficence answered 15/6, 2017 at 20:9 Comment(2)
it is very unclear what you are actually asking and trying to say in your post.Execrative
no it does not clean the dependenciesOrvil
T
25

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.

Tso answered 13/1, 2021 at 13:15 Comment(0)
A
13

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.

Appellation answered 19/2, 2019 at 23:5 Comment(1)
When 'cleanall world' runs properly the normal progress bar is displayed with plenty of "do_clean" tasksDepartmentalize
I
7

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.

Interpolation answered 16/6, 2017 at 9:2 Comment(1)
use "world" as recipe name if you want to cleanall for all the recipies.Paquin
M
4

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.

Metopic answered 16/6, 2017 at 12:43 Comment(1)
+1 for the -c cleansstate explanation. Exactly what I needed: cleanup so everything gets rebuild but no need to redownload all packages.Emmett
H
1

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'}"
Hatshepsut answered 9/11, 2020 at 20:36 Comment(1)
Just asking ... aren't you missing an s in do_cleanstate? Shouldn't it be do_cleansstate?Mown

© 2022 - 2024 — McMap. All rights reserved.