diff mbox series

[2/3] oeqa/selftest/archiver: Do not run bitbake -c clean unnecessarily

Message ID 20260608175259.3238900-2-pkj@axis.com
State New
Headers show
Series [1/3] archiver.bbclass: Properly remove artifacts when configuration changes | expand

Commit Message

Peter Kjellerstedt June 8, 2026, 5:52 p.m. UTC
Now that the archiver bbclass properly adapts its output based on its
configuration, it should no longer be needed to run `bitbake -c clean`
before invoking the archiver. There is one exception, which is due to
modifying DL_DIR as it does not automatically trigger a re-fetch.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/lib/oeqa/selftest/cases/archiver.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index 872504808a..122d16b655 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -31,7 +31,6 @@  class Archiver(OESelftestTestCase):
         features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe
         self.write_config(features)
 
-        bitbake('-c clean %s %s' % (include_recipe, exclude_recipe))
         bitbake("-c deploy_archives %s %s" % (include_recipe, exclude_recipe))
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
@@ -62,7 +61,6 @@  class Archiver(OESelftestTestCase):
         features += 'COPYLEFT_RECIPE_TYPES = "target"\n'
         self.write_config(features)
 
-        bitbake('-c clean %s %s' % (target_recipe, native_recipe))
         bitbake("%s -c deploy_archives %s" % (target_recipe, native_recipe))
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS'])
@@ -99,7 +97,6 @@  class Archiver(OESelftestTestCase):
         features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % target_recipes[1]
         self.write_config(features)
 
-        bitbake('-c clean %s %s' % (' '.join(target_recipes), ' '.join(native_recipes)))
         bitbake('-c deploy_archives %s %s' % (' '.join(target_recipes), ' '.join(native_recipes)))
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS'])
@@ -174,7 +171,6 @@  class Archiver(OESelftestTestCase):
             features += extra_config
         self.write_config(features)
 
-        bitbake('-c clean %s' % (target))
         bitbake('-c deploy_archives %s' % (target))
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'BUILD_SYS'])
@@ -255,7 +251,6 @@  class Archiver(OESelftestTestCase):
         features += 'ARCHIVER_MIRROR_EXCLUDE = "${GNU_MIRROR}"\n'
         self.write_config(features)
 
-        bitbake('-c clean %s' % (target))
         bitbake('-c deploy_archives %s' % (target))
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
@@ -281,7 +276,6 @@  class Archiver(OESelftestTestCase):
         self.write_config(features)
 
         for target in ['selftest-ed', 'selftest-hardlink']:
-            bitbake('-c clean %s' % (target))
             bitbake('-c deploy_archives %s' % (target))
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC'])
@@ -302,7 +296,6 @@  class Archiver(OESelftestTestCase):
         features += 'COPYLEFT_LICENSE_INCLUDE = "*"\n'
         self.write_config(features)
 
-        bitbake('-c clean git-submodule-test')
         bitbake('-c deploy_archives -f git-submodule-test')
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_SRC'])
@@ -330,6 +323,8 @@  class Archiver(OESelftestTestCase):
         features += 'DL_DIR = "${TOPDIR}/downloads-shallow"\n'
         self.write_config(features)
 
+        # Clean the build directory so that fetch is rerun.
+        # This is needed due to modifying DL_DIR.
         bitbake('-c clean git-submodule-test')
         bitbake('-c deploy_archives -f git-submodule-test')