ref-manual: tasks: do_cleanall: recommend using '-f' instead

do_cleanall can produce failures when used in legitimate cases, such as
with recipe variants (foo and foo-native) or a shared DL_DIR. This is why
it is forbidden when writing tests that will run on the autobuilders
(https://docs.yoctoproject.org/test-manual/intro.html?highlight=cleanall#considerations-when-writing-tests).

Reword the documentation to clearly discourage, provide a safe alternative
(bitbake -f -c fetch), and the rationale with an example.

Reported-by: Sam Liddicott
Link: https://bootlin.com/blog/yocto-sharing-the-sstate-cache-and-download-directories/#comment-2650335
(From yocto-docs rev: c8ba32df7576ceb4b8371595e14ad51bdb3e33b1)

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Luca Ceresoli
2024-02-28 12:25:14 +01:00
committed by Steve Sakoman
parent c9834bf620
commit 05fc000272

View File

@@ -470,9 +470,29 @@ You can run this task using BitBake as follows::
$ bitbake -c cleanall recipe
Typically, you would not normally use the :ref:`ref-tasks-cleanall` task. Do so only
if you want to start fresh with the :ref:`ref-tasks-fetch`
task.
You should never use the :ref:`ref-tasks-cleanall` task in a normal
scenario. If you want to start fresh with the :ref:`ref-tasks-fetch` task,
use instead::
$ bitbake -f -c fetch recipe
.. note::
The reason to prefer ``bitbake -f -c fetch`` is that the
:ref:`ref-tasks-cleanall` task would break in some cases, such as::
$ bitbake -c fetch recipe
$ bitbake -c cleanall recipe-native
$ bitbake -c unpack recipe
because after step 1 there is a stamp file for the
:ref:`ref-tasks-fetch` task of ``recipe``, and it won't be removed at
step 2 because step 2 uses a different work directory. So the unpack task
at step 3 will try to extract the downloaded archive and fail as it has
been deleted in step 2.
Note that this also applies to BitBake from concurrent processes when a
shared download directory (:term:`DL_DIR`) is setup.
.. _ref-tasks-cleansstate: