public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Clara Kowalsky' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Clara Kowalsky <clara.kowalsky@siemens.com>
Subject: [PATCH 2/4] isar-events: preserve cleanup for default multiconfig
Date: Wed,  4 Nov 2026 10:22:13 +0100	[thread overview]
Message-ID: <20261104092215.3567061-3-clara.kowalsky@siemens.com> (raw)
In-Reply-To: <20261104092215.3567061-1-clara.kowalsky@siemens.com>

BitBake v2.9.2 includes commit 0fa0d8d764bb ("cooker/cache: Drop mc
'default' string value") from January 2025, which changes BB_CURRENT_MC
for the default multiconfig from "default" to "".
The build completion handler checks for "default" before running
build-wide cleanup. With the new value, it returns early, leaving mounts
behind and the build UUID uncleared.

Fix this by accepting both the empty string and the legacy "default"
value, which can be dropped once BitBake is updated. Add unittests for
both default values and a named multiconfig.

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes-global/isar-events.bbclass |  9 +++------
 testsuite/unittests/test_build_uuid.py  | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/meta/classes-global/isar-events.bbclass b/meta/classes-global/isar-events.bbclass
index cfe6d7dd..9b66796e 100644
--- a/meta/classes-global/isar-events.bbclass
+++ b/meta/classes-global/isar-events.bbclass
@@ -52,13 +52,10 @@ python build_completed() {
     if not tmpdir:
         return
 
-    # bitbake calls cleanup for every multiconfig listed in BBMULTICONFIG plus
-    # one for the entire build. E.g., if BBMULTICONFIG="mc1 mc2 mc3", we call
-    # "bitbake mc1 mc2", the following cleanups would be called:
-    # "c1 c2 c3 cdefault".
-    # Skip running cleanup for additional multiconfigs
+    # Run cleanup only for the default multiconfig, which is empty on
+    # newer BitBake.
     mc = d.getVar('BB_CURRENT_MC')
-    if mc != 'default':
+    if mc not in ('', 'default'):
         return
 
     fail_on_cleanup = bb.utils.to_boolean(d.getVar('ISAR_FAIL_ON_CLEANUP'))
diff --git a/testsuite/unittests/test_build_uuid.py b/testsuite/unittests/test_build_uuid.py
index 374cce64..5d364ed0 100644
--- a/testsuite/unittests/test_build_uuid.py
+++ b/testsuite/unittests/test_build_uuid.py
@@ -18,6 +18,7 @@ sys.path.extend([
 ])
 
 import bb
+import bb.build
 import bb.data
 import bb.utils
 from bb.parse import handle
@@ -59,6 +60,23 @@ class TestBuildUUID(unittest.TestCase):
         clear_build_uuid(self.data)
         self.assertNotEqual(calculate_build_uuid(self.data), build_uuid)
 
+    def test_completion_resets_only_default_multiconfig(self):
+        data = handle(
+            str(root / 'meta/classes-global/isar-events.bbclass'), self.data
+        )
+        data.setVar('TMPDIR', self.persistent_dir)
+        data.setVar('T', os.path.join(self.persistent_dir, 'temp'))
+        for multiconfig, resets_uuid in [
+            ('', True), ('default', True), ('other', False)
+        ]:
+            with self.subTest(multiconfig=multiconfig):
+                build_uuid = calculate_build_uuid(data)
+                data.setVar('BB_CURRENT_MC', multiconfig)
+                bb.build.exec_func('build_completed', data)
+                self.assertEqual(
+                    calculate_build_uuid(data) != build_uuid, resets_uuid
+                )
+
     def test_concurrent_workers_share_uuid(self):
         context = multiprocessing.get_context('fork')
         start = context.Event()
-- 
2.56.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261104092215.3567061-3-clara.kowalsky%40siemens.com.

  parent reply	other threads:[~2026-11-04  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  9:22 [PATCH 0/4] BitBake update in Isar - part 1 'Clara Kowalsky' via isar-users
2026-11-04  9:22 ` [PATCH 1/4] base: replace BitBake's outdated persist_data 'Clara Kowalsky' via isar-users
2026-11-04  9:22 ` 'Clara Kowalsky' via isar-users [this message]
2026-11-04  9:22 ` [PATCH 3/4] isar-events: close /proc/mounts after cleanup 'Clara Kowalsky' via isar-users
2026-11-04  9:22 ` [PATCH 4/4] meta: migrate fetcher references to bb.fetch 'Clara Kowalsky' via isar-users
2026-11-04  9:32 ` [PATCH 0/4] BitBake update in Isar - part 1 Anton Mikanovich
2026-11-04  9:46   ` 'Clara Kowalsky' via isar-users
2026-11-04 13:14     ` 'Moessbauer, Felix' via isar-users

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261104092215.3567061-3-clara.kowalsky@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=clara.kowalsky@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox