public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 0/4] BitBake update in Isar - part 1
@ 2026-11-04  9:22 '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
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-11-04  9:22 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

These are first commits for preparing the update of BitBake in Isar.
Currently, BitBake v2.8.0 is used, which is very outdated. The goal is
to update to v2.20.0, which is the latest release.

Clara Kowalsky (4):
  base: replace BitBake's outdated persist_data
  isar-events: preserve cleanup for default multiconfig
  isar-events: close /proc/mounts after cleanup
  meta: migrate fetcher references to bb.fetch

 meta/classes-global/base.bbclass           |  39 +++++---
 meta/classes-global/isar-events.bbclass    |  48 +++++----
 meta/classes-global/sstate.bbclass         |  14 +--
 meta/classes-recipe/bootstrap.bbclass      |   4 +-
 meta/classes-recipe/dpkg-base.bbclass      |   6 +-
 meta/classes-recipe/dpkg.bbclass           |   2 +-
 meta/conf/bitbake.conf                     |   6 +-
 meta/lib/aptsrc_fetcher.py                 |   8 +-
 meta/lib/container_fetcher.py              |  12 +--
 meta/lib/oe/patch.py                       |  10 +-
 meta/recipes-devtools/base-apt/base-apt.bb |   2 +-
 testsuite/unittests/test_build_uuid.py     | 107 +++++++++++++++++++++
 12 files changed, 188 insertions(+), 70 deletions(-)
 create mode 100644 testsuite/unittests/test_build_uuid.py

-- 
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-1-clara.kowalsky%40siemens.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] base: replace BitBake's outdated persist_data
  2026-11-04  9:22 [PATCH 0/4] BitBake update in Isar - part 1 'Clara Kowalsky' via isar-users
@ 2026-11-04  9:22 ` 'Clara Kowalsky' via isar-users
  2026-11-04  9:22 ` [PATCH 2/4] isar-events: preserve cleanup for default multiconfig 'Clara Kowalsky' via isar-users
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-11-04  9:22 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

Isar uses a persistent UUID to distinguish build-specific resources,
including sbuild chroot names. The UUID must remain stable throughout a
BitBake run, so parallel builds using separate PID namespaces do not
clash on external mountpoints. It must also be shared across
multiconfigs and cleared when the build completes.
Isar currently stores the UUID through bb.persist_data.persist, which
is removed in BitBake v2.9.2 commit 681a7516 ("persist_data: Remove
it") from October 2024.

Persist the UUID in a file under PERSISTENT_DIR instead. Use BitBake's
file-locking helper when reading, creating and clearing it to ensure
concurrent processes share the same UUID. Clear it on the default
BuildCompleted event, so the next run receives a fresh UUID.

Add unittests for UUID reuse across calls and multiconfigs, cleanup and
concurrent access.

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes-global/base.bbclass        | 25 +++++--
 meta/classes-global/isar-events.bbclass |  2 +-
 testsuite/unittests/test_build_uuid.py  | 89 +++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 7 deletions(-)
 create mode 100644 testsuite/unittests/test_build_uuid.py

diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index 3d5d1c12..c61e59b4 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -341,12 +341,25 @@ def base_set_filespath(path, d):
 def calculate_build_uuid(d):
     import uuid
 
-    uuid_data = bb.persist_data.persist('BB_ISAR_UUID_DATA', d)
-    if "uuid" not in uuid_data or not uuid_data["uuid"]:
-        # Generate new UUID
-        uuid_data["uuid"] = str(uuid.uuid4())
-
-    return uuid_data["uuid"]
+    uuid_file = os.path.join(d.getVar('PERSISTENT_DIR'), 'isar-build-uuid')
+    with bb.utils.fileslocked([uuid_file + '.lock']):
+        try:
+            with open(uuid_file) as file:
+                build_uuid = file.read().strip()
+        except FileNotFoundError:
+            build_uuid = ''
+
+        if not build_uuid:
+            build_uuid = str(uuid.uuid4())
+            with open(uuid_file, 'w') as file:
+                file.write(build_uuid + '\n')
+
+        return build_uuid
+
+def clear_build_uuid(d):
+    uuid_file = os.path.join(d.getVar('PERSISTENT_DIR'), 'isar-build-uuid')
+    with bb.utils.fileslocked([uuid_file + '.lock']):
+        bb.utils.remove(uuid_file)
 
 # Unique ID for this build, used to avoid name clashes on external mountpoints
 # When running parallel builds in different PID namespaces
diff --git a/meta/classes-global/isar-events.bbclass b/meta/classes-global/isar-events.bbclass
index 15bfdb99..cfe6d7dd 100644
--- a/meta/classes-global/isar-events.bbclass
+++ b/meta/classes-global/isar-events.bbclass
@@ -85,7 +85,7 @@ python build_completed() {
                 bb.error(str(e))
 
     # Cleanup build UUID, the next bitbake run will generate new one
-    bb.persist_data.persist('BB_ISAR_UUID_DATA', d).clear()
+    bb.utils.exec_flat_python_func('clear_build_uuid', d)
 }
 
 build_completed[eventmask] = "bb.event.BuildCompleted"
diff --git a/testsuite/unittests/test_build_uuid.py b/testsuite/unittests/test_build_uuid.py
new file mode 100644
index 00000000..374cce64
--- /dev/null
+++ b/testsuite/unittests/test_build_uuid.py
@@ -0,0 +1,89 @@
+# This software is a part of Isar.
+# Copyright (C) Siemens AG, 2026
+#
+# SPDX-License-Identifier: MIT
+
+import multiprocessing
+import os
+import sys
+import tempfile
+import unittest
+import uuid
+from pathlib import Path
+
+root = Path(__file__).resolve().parents[2]
+sys.path.extend([
+    str(root / 'bitbake/lib'),
+    str(root / 'meta/lib'),
+])
+
+import bb
+import bb.data
+import bb.utils
+from bb.parse import handle
+
+
+data = bb.data.init()
+data.setVar('BBPATH', f'{root}/meta:{root}/bitbake')
+data.setVar('__bbclasstype', 'global')
+parsed = handle(str(root / 'meta/classes-global/base.bbclass'), data)
+namespace = {'bb': bb, 'os': os}
+exec(parsed['calculate_build_uuid'], namespace)
+exec(parsed['clear_build_uuid'], namespace)
+calculate_build_uuid = namespace['calculate_build_uuid']
+clear_build_uuid = namespace['clear_build_uuid']
+
+
+def calculate_in_worker(persistent_dir, start, results):
+    data = bb.data.init()
+    data.setVar('PERSISTENT_DIR', persistent_dir)
+    start.wait()
+    results.put(calculate_build_uuid(data))
+
+
+class TestBuildUUID(unittest.TestCase):
+    def setUp(self):
+        directory = tempfile.TemporaryDirectory()
+        self.addCleanup(directory.cleanup)
+        self.persistent_dir = os.path.join(directory.name, 'cache')
+        self.data = bb.data.init()
+        self.data.setVar('PERSISTENT_DIR', self.persistent_dir)
+
+    def test_uuid_is_reused_across_calls_and_multiconfigs(self):
+        build_uuid = calculate_build_uuid(self.data)
+        self.assertEqual(str(uuid.UUID(build_uuid)), build_uuid)
+        self.assertEqual(calculate_build_uuid(self.data), build_uuid)
+        other_config = self.data.createCopy()
+        other_config.setVar('BB_CURRENT_MC', 'other')
+        self.assertEqual(calculate_build_uuid(other_config), build_uuid)
+        clear_build_uuid(self.data)
+        self.assertNotEqual(calculate_build_uuid(self.data), build_uuid)
+
+    def test_concurrent_workers_share_uuid(self):
+        context = multiprocessing.get_context('fork')
+        start = context.Event()
+        results = context.Queue()
+        workers = [
+            context.Process(
+                target=calculate_in_worker,
+                args=(self.persistent_dir, start, results),
+            )
+            for _ in range(8)
+        ]
+        try:
+            for worker in workers:
+                worker.start()
+            start.set()
+            values = [results.get(timeout=15) for worker in workers]
+            for worker in workers:
+                worker.join(timeout=15)
+                self.assertEqual(worker.exitcode, 0)
+            self.assertEqual(len(set(values)), 1)
+            self.assertEqual(values[0], calculate_build_uuid(self.data))
+        finally:
+            for worker in workers:
+                if worker.is_alive():
+                    worker.terminate()
+                worker.join(timeout=15)
+            results.close()
+            results.join_thread()
-- 
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-2-clara.kowalsky%40siemens.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/4] isar-events: preserve cleanup for default multiconfig
  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
  2026-11-04  9:22 ` [PATCH 3/4] isar-events: close /proc/mounts after cleanup 'Clara Kowalsky' via isar-users
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-11-04  9:22 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/4] isar-events: close /proc/mounts after cleanup
  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 ` [PATCH 2/4] isar-events: preserve cleanup for default multiconfig 'Clara Kowalsky' via isar-users
@ 2026-11-04  9:22 ` '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
  4 siblings, 0 replies; 8+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-11-04  9:22 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

Running the UUID unittest:

python3 -m unittest discover -s testsuite/unittests \
  -p test_build_uuid.py -v

emits the warning:

/isar/meta/classes-global/isar-events.bbclass:65:
  ResourceWarning: unclosed file <_io.TextIOWrapper name='/proc/mounts'
  mode='r' encoding='UTF-8'>

The test_completion_resets_only_default_multiconfig exercises the
BuildCompleted handler, which reads /proc/mounts using open() without
closing the file. Fix this by reading the mount entries within a context
manager for deterministic file closure.

Fixes: e596cdf97198 ("isar-events: Unhide mounts left behind")
Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes-global/isar-events.bbclass | 37 +++++++++++++------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/meta/classes-global/isar-events.bbclass b/meta/classes-global/isar-events.bbclass
index 9b66796e..48f5f441 100644
--- a/meta/classes-global/isar-events.bbclass
+++ b/meta/classes-global/isar-events.bbclass
@@ -62,24 +62,25 @@ python build_completed() {
 
     basepath = tmpdir + '/work/'
 
-    for line in reversed(list(open('/proc/mounts'))):
-        if basepath not in line:
-            continue
-        msg_line = f"{line.split()[1]} left mounted"
-        # If bitbake is started manually, bb.warn and bb.error go to stdout;
-        # with bb.error, bitbake additionally fails the build. Under CI,
-        # bb.warn and bb.error currently go to a file.
-        if fail_on_cleanup:
-            bb.error(msg_line)
-        else:
-            msg_line += ', unmounting...'
-            bb.warn(msg_line)
-            try:
-                subprocess.run(
-                    f"sudo umount {line.split()[1]}", shell=True, check=True
-                )
-            except subprocess.CalledProcessError as e:
-                bb.error(str(e))
+    with open('/proc/mounts') as mounts:
+        for line in reversed(mounts.readlines()):
+            if basepath not in line:
+                continue
+            msg_line = f"{line.split()[1]} left mounted"
+            # If bitbake is started manually, bb.warn and bb.error go to stdout;
+            # with bb.error, bitbake additionally fails the build. Under CI,
+            # bb.warn and bb.error currently go to a file.
+            if fail_on_cleanup:
+                bb.error(msg_line)
+            else:
+                msg_line += ', unmounting...'
+                bb.warn(msg_line)
+                try:
+                    subprocess.run(
+                        f"sudo umount {line.split()[1]}", shell=True, check=True
+                    )
+                except subprocess.CalledProcessError as e:
+                    bb.error(str(e))
 
     # Cleanup build UUID, the next bitbake run will generate new one
     bb.utils.exec_flat_python_func('clear_build_uuid', d)
-- 
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-4-clara.kowalsky%40siemens.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/4] meta: migrate fetcher references to bb.fetch
  2026-11-04  9:22 [PATCH 0/4] BitBake update in Isar - part 1 'Clara Kowalsky' via isar-users
                   ` (2 preceding siblings ...)
  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 ` 'Clara Kowalsky' via isar-users
  2026-11-04  9:32 ` [PATCH 0/4] BitBake update in Isar - part 1 Anton Mikanovich
  4 siblings, 0 replies; 8+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-11-04  9:22 UTC (permalink / raw)
  To: isar-users; +Cc: Clara Kowalsky

BitBake v2.20 includes commit 34ea7cb48090 ("lib: rename fetch2 as
fetch; invert compat shim to make bb.fetch2 = bb.fetch"), which renames
the fetcher API to bb.fetch and keeps bb.fetch2 only for deprecated
compatibility.

In preparation for an update of BitBake in Isar, migrate to bb.fetch to
avoid relying on a deprecated API. The current BitBake v2.8 already
provides bb.fetch as an alias of bb.fetch2, so this change is a pure
rename.

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes-global/base.bbclass           | 14 +++++++-------
 meta/classes-global/sstate.bbclass         | 14 +++++++-------
 meta/classes-recipe/bootstrap.bbclass      |  4 ++--
 meta/classes-recipe/dpkg-base.bbclass      |  6 +++---
 meta/classes-recipe/dpkg.bbclass           |  2 +-
 meta/conf/bitbake.conf                     |  6 +++---
 meta/lib/aptsrc_fetcher.py                 |  8 ++++----
 meta/lib/container_fetcher.py              | 12 ++++++------
 meta/lib/oe/patch.py                       | 10 +++++-----
 meta/recipes-devtools/base-apt/base-apt.bb |  2 +-
 10 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index c61e59b4..54da1421 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -161,7 +161,7 @@ python() {
                 needsrcrev = True
 
     if needsrcrev:
-        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+        d.setVar("SRCPV", "${@bb.fetch.get_srcrev(d)}")
 
     for e in d.keys():
         flags = d.getVarFlags(e)
@@ -244,9 +244,9 @@ python do_fetch() {
         return
 
     try:
-        fetcher = bb.fetch2.Fetch(src_uri, d)
+        fetcher = bb.fetch.Fetch(src_uri, d)
         fetcher.download()
-    except bb.fetch2.BBFetchException as e:
+    except bb.fetch.BBFetchException as e:
         bb.fatal(str(e))
 }
 
@@ -263,9 +263,9 @@ python do_unpack() {
     rootdir = d.getVar('WORKDIR')
 
     try:
-        fetcher = bb.fetch2.Fetch(src_uri, d)
+        fetcher = bb.fetch.Fetch(src_uri, d)
         fetcher.unpack(rootdir)
-    except bb.fetch2.BBFetchException as e:
+    except bb.fetch.BBFetchException as e:
         bb.fatal(str(e))
 }
 
@@ -314,9 +314,9 @@ python do_cleanall() {
         return
 
     try:
-        fetcher = bb.fetch2.Fetch(src_uri, d)
+        fetcher = bb.fetch.Fetch(src_uri, d)
         fetcher.clean()
-    except bb.fetch2.BBFetchException as e:
+    except bb.fetch.BBFetchException as e:
         bb.fatal(str(e))
 }
 
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 76a7b596..4c50f7dd 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -731,7 +731,7 @@ def sstate_package(ss, d):
 sstate_package[vardepsexclude] += "SSTATE_SIG_KEY"
 
 def pstaging_fetch(sstatefetch, d):
-    import bb.fetch2
+    import bb.fetch
 
     # Only try and fetch if the user has configured a mirror
     mirrors = d.getVar('SSTATE_MIRRORS')
@@ -766,11 +766,11 @@ def pstaging_fetch(sstatefetch, d):
         localdata.delVar('SRC_URI')
         localdata.setVar('SRC_URI', srcuri)
         try:
-            fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+            fetcher = bb.fetch.Fetch([srcuri], localdata, cache=False)
             fetcher.checkstatus()
             fetcher.download()
 
-        except bb.fetch2.BBFetchException:
+        except bb.fetch.BBFetchException:
             pass
 
 def sstate_setscene(d):
@@ -1017,7 +1017,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 bb.utils.to_boolean(localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK')):
             localdata.delVar('BB_NO_NETWORK')
 
-        from bb.fetch2 import FetchConnectionCache
+        from bb.fetch import FetchConnectionCache
         def checkstatus_init():
             while not connection_cache_pool.full():
                 connection_cache_pool.put(FetchConnectionCache())
@@ -1039,13 +1039,13 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
             import traceback
 
             try:
-                fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2,
+                fetcher = bb.fetch.Fetch(srcuri.split(), localdata2,
                             connection_cache=connection_cache)
                 fetcher.checkstatus()
                 bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
                 found.add(tid)
                 missed.remove(tid)
-            except bb.fetch2.FetchError as e:
+            except bb.fetch.FetchError as e:
                 bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)\n%s" % (srcuri, repr(e), traceback.format_exc()))
             except Exception as e:
                 bb.error("SState: cannot test %s: %s\n%s" % (srcuri, repr(e), traceback.format_exc()))
@@ -1072,7 +1072,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
 
             # Have to setup the fetcher environment here rather than in each thread as it would race
-            fetcherenv = bb.fetch2.get_fetcher_environment(d)
+            fetcherenv = bb.fetch.get_fetcher_environment(d)
             with bb.utils.environment(**fetcherenv):
                 bb.event.enable_threadlock()
                 import concurrent.futures
diff --git a/meta/classes-recipe/bootstrap.bbclass b/meta/classes-recipe/bootstrap.bbclass
index c1a59fd2..2671602f 100644
--- a/meta/classes-recipe/bootstrap.bbclass
+++ b/meta/classes-recipe/bootstrap.bbclass
@@ -45,12 +45,12 @@ python () {
             distro_bootstrap_keys += own_pub_key.split()
 
     for key in distro_bootstrap_keys:
-        fetcher = bb.fetch2.Fetch([key], d)
+        fetcher = bb.fetch.Fetch([key], d)
         filename = os.path.relpath(fetcher.localpath(key), topdir)
         d.appendVar("DISTRO_BOOTSTRAP_KEYFILES", " ${TOPDIR}/%s" % filename)
 
     for key in third_party_apt_keys:
-        fetcher = bb.fetch2.Fetch([key], d)
+        fetcher = bb.fetch.Fetch([key], d)
         filename = os.path.relpath(fetcher.localpath(key), topdir)
         d.appendVar("THIRD_PARTY_APT_KEYFILES", " ${TOPDIR}/%s" % filename)
 
diff --git a/meta/classes-recipe/dpkg-base.bbclass b/meta/classes-recipe/dpkg-base.bbclass
index 4ec0ddbe..a237af8f 100644
--- a/meta/classes-recipe/dpkg-base.bbclass
+++ b/meta/classes-recipe/dpkg-base.bbclass
@@ -49,7 +49,7 @@ python do_adjust_git() {
 
     for src_uri in (d.getVar("SRC_URI") or "").split():
         try:
-            fetcher = bb.fetch2.Fetch([src_uri], d)
+            fetcher = bb.fetch.Fetch([src_uri], d)
             ud = fetcher.ud[src_uri]
             if ud.type != 'git':
                 continue
@@ -83,7 +83,7 @@ python do_adjust_git() {
                 bb.note(' '.join(cmd))
                 if subprocess.call(cmd) != 0:
                     bb.fatal("git alternates adjustment failed")
-        except bb.fetch2.BBFetchException as e:
+        except bb.fetch.BBFetchException as e:
             bb.fatal(str(e))
 }
 
@@ -94,7 +94,7 @@ inherit patch
 addtask patch after do_adjust_git
 
 python() {
-    from bb.fetch2 import methods
+    from bb.fetch import methods
 
     # apt-src fetcher
     import aptsrc_fetcher
diff --git a/meta/classes-recipe/dpkg.bbclass b/meta/classes-recipe/dpkg.bbclass
index 35408495..737915b8 100644
--- a/meta/classes-recipe/dpkg.bbclass
+++ b/meta/classes-recipe/dpkg.bbclass
@@ -75,7 +75,7 @@ dpkg_runbuild() {
         [ "${var}" = "DEB_BUILD_OPTIONS" ] && continue
 
         # Don't warn environment variables exported to the bitbake fetcher
-        case " ${@" ".join(bb.fetch2.FETCH_EXPORT_VARS)} " in
+        case " ${@" ".join(bb.fetch.FETCH_EXPORT_VARS)} " in
             *" ${var} "*) continue;;
         esac
 
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c31719b8..4ffe6d14 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -37,10 +37,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PROVIDES = ""
 S = "${WORKDIR}/${P}"
 SRCREV ??= "INVALID"
-AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+AUTOREV = "${@bb.fetch.get_autorev(d)}"
 AUTOREV[vardepvalue] = "${SRCPV}"
 # Set Dynamically in base.bbclass
-# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+# SRCPV = "${@bb.fetch.get_srcrev(d)}"
 SRCPV[vardepvalue] = "${SRCPV}"
 SRC_URI = ""
 STAMPS_DIR ?= "${TMPDIR}/stamps"
@@ -50,7 +50,7 @@ SVNDIR = "${DL_DIR}/svn"
 T = "${WORKDIR}/temp"
 TMPDIR = "${TOPDIR}/tmp"
 PERSISTENT_DIR = "${TMPDIR}/cache"
-GITPKGV = "${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"
+GITPKGV = "${@bb.fetch.get_srcrev(d, 'gitpkgv_revision')}"
 
 # Isar specific config
 WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
diff --git a/meta/lib/aptsrc_fetcher.py b/meta/lib/aptsrc_fetcher.py
index fe8f1cd3..8de86fce 100644
--- a/meta/lib/aptsrc_fetcher.py
+++ b/meta/lib/aptsrc_fetcher.py
@@ -3,10 +3,10 @@
 #
 # SPDX-License-Identifier: MIT
 
-from bb.fetch2 import FetchError
-from bb.fetch2 import FetchMethod
-from bb.fetch2 import logger
-from bb.fetch2 import runfetchcmd
+from bb.fetch import FetchError
+from bb.fetch import FetchMethod
+from bb.fetch import logger
+from bb.fetch import runfetchcmd
 import os
 
 class AptSrc(FetchMethod):
diff --git a/meta/lib/container_fetcher.py b/meta/lib/container_fetcher.py
index 52a75ac9..7f9bfdbe 100644
--- a/meta/lib/container_fetcher.py
+++ b/meta/lib/container_fetcher.py
@@ -7,12 +7,12 @@ import oe.path
 import os
 import tempfile
 import json
-from   bb.fetch2 import FetchMethod
-from   bb.fetch2 import logger
-from   bb.fetch2 import MissingChecksumEvent
-from   bb.fetch2 import NoChecksumError
-from   bb.fetch2 import ChecksumError
-from   bb.fetch2 import runfetchcmd
+from   bb.fetch import FetchMethod
+from   bb.fetch import logger
+from   bb.fetch import MissingChecksumEvent
+from   bb.fetch import NoChecksumError
+from   bb.fetch import ChecksumError
+from   bb.fetch import runfetchcmd
 
 class Container(FetchMethod):
     def supports(self, ud, d):
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 52c0aa4d..a4dda29b 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -92,14 +92,14 @@ class PatchSet(object):
             if not patch.get("remote"):
                 raise PatchError("Patch file must be specified in patch import.")
             else:
-                patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
+                patch["file"] = bb.fetch.localpath(patch["remote"], self.d)
 
         for param in PatchSet.defaults:
             if not patch.get(param):
                 patch[param] = PatchSet.defaults[param]
 
         if patch.get("remote"):
-            patch["file"] = self.d.expand(bb.fetch2.localpath(patch["remote"], self.d))
+            patch["file"] = self.d.expand(bb.fetch.localpath(patch["remote"], self.d))
 
         patch["filemd5"] = bb.utils.md5_file(patch["file"])
 
@@ -560,7 +560,7 @@ class GitApplyTree(PatchTree):
             shutil.rmtree(tempdir)
 
     def _need_dirty_check(self):
-        fetch = bb.fetch2.Fetch([], self.d)
+        fetch = bb.fetch.Fetch([], self.d)
         check_dirtyness = False
         for url in fetch.urls:
             url_data = fetch.ud[url]
@@ -778,7 +778,7 @@ class QuiltTree(PatchSet):
             if type == "file":
                 import shutil
                 if not patch.get("file") and patch.get("remote"):
-                    patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
+                    patch["file"] = bb.fetch.localpath(patch["remote"], self.d)
 
                 shutil.copyfile(patch["quiltfile"], patch["file"])
             else:
@@ -908,7 +908,7 @@ def patch_path(url, fetch, workdir, expand=True):
 
 def src_patches(d, all=False, expand=True):
     workdir = d.getVar('WORKDIR')
-    fetch = bb.fetch2.Fetch([], d)
+    fetch = bb.fetch.Fetch([], d)
     patches = []
     sources = []
     for url in fetch.urls:
diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb
index 97e3ae16..d54786ec 100644
--- a/meta/recipes-devtools/base-apt/base-apt.bb
+++ b/meta/recipes-devtools/base-apt/base-apt.bb
@@ -81,7 +81,7 @@ python do_cache() {
 
     for key in d.getVar('BASE_REPO_KEY').split():
         d.appendVar("SRC_URI", " %s" % key)
-        fetcher = bb.fetch2.Fetch([key], d)
+        fetcher = bb.fetch.Fetch([key], d)
         filename = fetcher.localpath(key)
         d.appendVar("KEYFILES", " %s" % filename)
 
-- 
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-5-clara.kowalsky%40siemens.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] BitBake update in Isar - part 1
  2026-11-04  9:22 [PATCH 0/4] BitBake update in Isar - part 1 'Clara Kowalsky' via isar-users
                   ` (3 preceding siblings ...)
  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 ` Anton Mikanovich
  2026-11-04  9:46   ` 'Clara Kowalsky' via isar-users
  4 siblings, 1 reply; 8+ messages in thread
From: Anton Mikanovich @ 2026-11-04  9:32 UTC (permalink / raw)
  To: Clara Kowalsky, isar-users

Hello Clara,

Bitbake was not updated for a long time for the reason.
Newer Bitbake releases are using "valid_signals" call which was 
introduced in
Python 3.8, but Isar still support building Buster with Python 3.7 only.

Did you fix Buster compatibility somehow?

04.11.2026 11:22, 'Clara Kowalsky' via isar-users wrote:
> These are first commits for preparing the update of BitBake in Isar.
> Currently, BitBake v2.8.0 is used, which is very outdated. The goal is
> to update to v2.20.0, which is the latest release.
>
> Clara Kowalsky (4):
>    base: replace BitBake's outdated persist_data
>    isar-events: preserve cleanup for default multiconfig
>    isar-events: close /proc/mounts after cleanup
>    meta: migrate fetcher references to bb.fetch
>
>   meta/classes-global/base.bbclass           |  39 +++++---
>   meta/classes-global/isar-events.bbclass    |  48 +++++----
>   meta/classes-global/sstate.bbclass         |  14 +--
>   meta/classes-recipe/bootstrap.bbclass      |   4 +-
>   meta/classes-recipe/dpkg-base.bbclass      |   6 +-
>   meta/classes-recipe/dpkg.bbclass           |   2 +-
>   meta/conf/bitbake.conf                     |   6 +-
>   meta/lib/aptsrc_fetcher.py                 |   8 +-
>   meta/lib/container_fetcher.py              |  12 +--
>   meta/lib/oe/patch.py                       |  10 +-
>   meta/recipes-devtools/base-apt/base-apt.bb |   2 +-
>   testsuite/unittests/test_build_uuid.py     | 107 +++++++++++++++++++++
>   12 files changed, 188 insertions(+), 70 deletions(-)
>   create mode 100644 testsuite/unittests/test_build_uuid.py
>

-- 
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/419696e8-cda9-4cec-803a-e3ac5386d1ba%40ilbers.de.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] BitBake update in Isar - part 1
  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
  0 siblings, 1 reply; 8+ messages in thread
From: 'Clara Kowalsky' via isar-users @ 2026-11-04  9:46 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users



On 11/4/26 10:32, Anton Mikanovich wrote:
> Hello Clara,
> 
> Bitbake was not updated for a long time for the reason.
> Newer Bitbake releases are using "valid_signals" call which was 
> introduced in
> Python 3.8, but Isar still support building Buster with Python 3.7 only.
> 
> Did you fix Buster compatibility somehow?

Yes, I fixed the Buster issue where WIC ran inside Buster's imaging 
chroot and imported BitBake. I have a commit that moves WIC to the build 
host's Python and leaves only imaging utilities in the chroot. I tested 
it extensively in the testsuite for Buster and newer targets + newest 
BitBake.

Regarding these first patches, I wanted to get some feedback on those 
first before sending the rest of the patches to not have too many 
changes at once.

Clara
> 
> 04.11.2026 11:22, 'Clara Kowalsky' via isar-users wrote:
>> These are first commits for preparing the update of BitBake in Isar.
>> Currently, BitBake v2.8.0 is used, which is very outdated. The goal is
>> to update to v2.20.0, which is the latest release.
>>
>> Clara Kowalsky (4):
>>    base: replace BitBake's outdated persist_data
>>    isar-events: preserve cleanup for default multiconfig
>>    isar-events: close /proc/mounts after cleanup
>>    meta: migrate fetcher references to bb.fetch
>>
>>   meta/classes-global/base.bbclass           |  39 +++++---
>>   meta/classes-global/isar-events.bbclass    |  48 +++++----
>>   meta/classes-global/sstate.bbclass         |  14 +--
>>   meta/classes-recipe/bootstrap.bbclass      |   4 +-
>>   meta/classes-recipe/dpkg-base.bbclass      |   6 +-
>>   meta/classes-recipe/dpkg.bbclass           |   2 +-
>>   meta/conf/bitbake.conf                     |   6 +-
>>   meta/lib/aptsrc_fetcher.py                 |   8 +-
>>   meta/lib/container_fetcher.py              |  12 +--
>>   meta/lib/oe/patch.py                       |  10 +-
>>   meta/recipes-devtools/base-apt/base-apt.bb |   2 +-
>>   testsuite/unittests/test_build_uuid.py     | 107 +++++++++++++++++++++
>>   12 files changed, 188 insertions(+), 70 deletions(-)
>>   create mode 100644 testsuite/unittests/test_build_uuid.py
>>
> 

-- 
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/2ce9f35b-efb4-4487-bd57-4ff4d7eb34fa%40siemens.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] BitBake update in Isar - part 1
  2026-11-04  9:46   ` 'Clara Kowalsky' via isar-users
@ 2026-11-04 13:14     ` 'Moessbauer, Felix' via isar-users
  0 siblings, 0 replies; 8+ messages in thread
From: 'Moessbauer, Felix' via isar-users @ 2026-11-04 13:14 UTC (permalink / raw)
  To: Kowalsky, Clara, amikan, isar-users

On Wed, 2026-11-04 at 10:46 +0100, 'Clara Kowalsky' via isar-users
wrote:
> On 11/4/26 10:32, Anton Mikanovich wrote:
> > Hello Clara,
> > 
> > Bitbake was not updated for a long time for the reason.
> > Newer Bitbake releases are using "valid_signals" call which was 
> > introduced in
> > Python 3.8, but Isar still support building Buster with Python 3.7 only.
> > 
> > Did you fix Buster compatibility somehow?
> 
> Yes, I fixed the Buster issue where WIC ran inside Buster's imaging 
> chroot and imported BitBake. I have a commit that moves WIC to the build 
> host's Python and leaves only imaging utilities in the chroot. I tested 
> it extensively in the testsuite for Buster and newer targets + newest 
> BitBake.

Hi, that's great news. But if I read it correctly, this patch is not
part of the series you sent, right?

Please send the whole thing as one series, also ordered so that each
individual commit is buildable (passes the CI).

> 
> Regarding these first patches, I wanted to get some feedback on those 
> first before sending the rest of the patches to not have too many 
> changes at once.

Just send everything at once, please.

Felix

> 
> Clara
> > 
> > 04.11.2026 11:22, 'Clara Kowalsky' via isar-users wrote:
> > > These are first commits for preparing the update of BitBake in Isar.
> > > Currently, BitBake v2.8.0 is used, which is very outdated. The goal is
> > > to update to v2.20.0, which is the latest release.
> > > 
> > > Clara Kowalsky (4):
> > >    base: replace BitBake's outdated persist_data
> > >    isar-events: preserve cleanup for default multiconfig
> > >    isar-events: close /proc/mounts after cleanup
> > >    meta: migrate fetcher references to bb.fetch
> > > 
> > >   meta/classes-global/base.bbclass           |  39 +++++---
> > >   meta/classes-global/isar-events.bbclass    |  48 +++++----
> > >   meta/classes-global/sstate.bbclass         |  14 +--
> > >   meta/classes-recipe/bootstrap.bbclass      |   4 +-
> > >   meta/classes-recipe/dpkg-base.bbclass      |   6 +-
> > >   meta/classes-recipe/dpkg.bbclass           |   2 +-
> > >   meta/conf/bitbake.conf                     |   6 +-
> > >   meta/lib/aptsrc_fetcher.py                 |   8 +-
> > >   meta/lib/container_fetcher.py              |  12 +--
> > >   meta/lib/oe/patch.py                       |  10 +-
> > >   meta/recipes-devtools/base-apt/base-apt.bb |   2 +-
> > >   testsuite/unittests/test_build_uuid.py     | 107 +++++++++++++++++++++
> > >   12 files changed, 188 insertions(+), 70 deletions(-)
> > >   create mode 100644 testsuite/unittests/test_build_uuid.py
> > > 
> > 
> 
> -- 
> 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/2ce9f35b-efb4-4487-bd57-4ff4d7eb34fa%40siemens.com.

-- 
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/8db49e85fac8dba9c3c159200a40a811f1b2f82c.camel%40siemens.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-04 13:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/4] isar-events: preserve cleanup for default multiconfig 'Clara Kowalsky' via isar-users
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox