diff mbox series

[09/10] recipetool: create: Clean the recipe after its tasks

Message ID 20261120135342.2628228-10-stondo@gmail.com
State New
Headers show
Series npm: list the dependencies in SRC_URI | expand

Commit Message

Stefano Tondo Nov. 20, 2026, 1:53 p.m. UTC
From: Stefano Tondo <stefano.tondo.ext@siemens.com>

recipetool can run tasks of the new recipe, as it does for Go. These
tasks leave stamps, for example for do_unpack and do_patch. devtool
then builds the recipe with externalsrc, which uses other stamps, and
its do_clean removes the work directory. The first stamps stay.

A later build of the recipe with the same signatures trusts these
stamps and does not unpack again, so the source is missing. The next
commit runs do_update_npm_deps for npm recipes. Then
test_devtool_add_npm followed by test_recipetool_create_npm fails:
do_update_npm_deps cannot find npm-shrinkwrap.json.

Run do_clean after the tasks.

Signed-off-by: Stefano Tondo <stefano.tondo.ext@siemens.com>
---
 scripts/lib/recipetool/create.py | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 2df17dd6e4..b2cc92c90b 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -955,6 +955,11 @@  def create_recipe(args):
     for task in run_tasks:
         logger.info("Running task %s" % task)
         tinfoil.build_file_sync(outfile, task)
+    if run_tasks:
+        # Remove the work directory and the stamps of these tasks. Else a
+        # later build of the recipe can trust the stamps, also when devtool
+        # has removed the work directory in the meantime.
+        tinfoil.build_file_sync(outfile, "clean")
 
     if tempsrc:
         if args.keep_temp: