* [PATCH] swig: upgrade 4.4.1 -> 4.5.0
@ 2026-08-10 15:45 Jaipaul Cheernam
2026-08-10 21:02 ` [OE-core] " Richard Purdie
` (3 more replies)
0 siblings, 4 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-10 15:45 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
ChangeLog: https://www.swig.org/Release/CHANGES.current
Release Notes: https://www.swig.org/Release/RELEASENOTES
CompareLog: https://github.com/swig/swig/compare/v4.4.1...v4.5.0
- Refresh determinism.patch
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
.../swig/swig/determinism.patch | 20 +++++++++----------
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
diff --git a/meta/recipes-devtools/swig/swig/determinism.patch b/meta/recipes-devtools/swig/swig/determinism.patch
index d6af38248d..9b021091cd 100644
--- a/meta/recipes-devtools/swig/swig/determinism.patch
+++ b/meta/recipes-devtools/swig/swig/determinism.patch
@@ -1,26 +1,26 @@
-From 7df78bedb666e49131c48f1854c6be1597bd133c Mon Sep 17 00:00:00 2001
+From 218e2a20ff978cb28fefdf7b35af8a27768df4db Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
-Date: Mon, 1 Mar 2021 00:11:10 +0000
+Date: Mon, 10 Aug 2026 11:13:20 +0000
Subject: [PATCH] swig: Fix reproducibility issue
Remove the compiler commandline/platform from the compiled binary as this
breaks reproducibilty.
-Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take]
+Upstream-Status: Inappropriate [OE reproducibility fix upstream unlikely to take]
RP 2021/3/1
---
Source/Modules/main.cxx | 1 -
1 file changed, 1 deletion(-)
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
-index f68b609..0c2aba3 100644
+index 83ab22a..79a513a 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
-@@ -633,7 +633,6 @@ static void getoptions(int argc, char *argv[]) {
- }
+@@ -642,7 +642,6 @@ static void getoptions(int argc, char *argv[]) {
+ }
} else if (strcmp(argv[i], "-version") == 0 || strcmp(argv[1], "--version") == 0) {
- fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
-- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
- fprintf(stdout, "\nConfigured options: %cpcre\n",
+ fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
+- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
+ fprintf(stdout,
+ "\nConfigured options: %cpcre\n",
#ifdef HAVE_PCRE
- '+'
diff --git a/meta/recipes-devtools/swig/swig_4.4.1.bb b/meta/recipes-devtools/swig/swig_4.5.0.bb
similarity index 92%
rename from meta/recipes-devtools/swig/swig_4.4.1.bb
rename to meta/recipes-devtools/swig/swig_4.5.0.bb
index 842a7b0945..161c23f0af 100644
--- a/meta/recipes-devtools/swig/swig_4.4.1.bb
+++ b/meta/recipes-devtools/swig/swig_4.5.0.bb
@@ -13,9 +13,9 @@ SECTION = "devel"
DEPENDS = "libpcre2 bison-native"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
- file://determinism.patch \
+ file://determinism.patch \
"
-SRC_URI[sha256sum] = "40162a706c56f7592d08fd52ef5511cb7ac191f3593cf07306a0a554c6281fcf"
+SRC_URI[sha256sum] = "22ae0e887f8cca8031a325c67d005207653200b40e71edb3f88780e28e47d0ff"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/swig/files/swig/"
UPSTREAM_CHECK_REGEX = "swig-(?P<pver>\d+(\.\d+)+)"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH] swig: upgrade 4.4.1 -> 4.5.0
2026-08-10 15:45 [PATCH] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
@ 2026-08-10 21:02 ` Richard Purdie
2026-08-11 6:12 ` [PATCH v2 0/2] " Jaipaul Cheernam
` (2 subsequent siblings)
3 siblings, 0 replies; 19+ messages in thread
From: Richard Purdie @ 2026-08-10 21:02 UTC (permalink / raw)
To: jaipaul.cheernam, openembedded-core
On Mon, 2026-08-10 at 17:45 +0200, Jaipaul Cheernam via lists.openembedded.org wrote:
> ChangeLog: https://www.swig.org/Release/CHANGES.current
>
> Release Notes: https://www.swig.org/Release/RELEASENOTES
>
> CompareLog: https://github.com/swig/swig/compare/v4.4.1...v4.5.0
>
> - Refresh determinism.patch
>
> Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
> ---
> .../swig/swig/determinism.patch | 20 +++++++++----------
> .../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
> 2 files changed, 12 insertions(+), 12 deletions(-)
> rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
Seems to break babeltrace2, e.g.:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/22/builds/4362
Cheers,
Richard
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 0/2] swig: upgrade 4.4.1 -> 4.5.0
2026-08-10 15:45 [PATCH] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-10 21:02 ` [OE-core] " Richard Purdie
@ 2026-08-11 6:12 ` Jaipaul Cheernam
2026-08-11 6:12 ` [PATCH v2 1/2] " Jaipaul Cheernam
2026-08-11 6:12 ` [PATCH v2 2/2] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
3 siblings, 2 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 6:12 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
Upgrade swig to 4.5.0 and fix babeltrace2 build breakage caused by
removal of Python 2 compatibility macros in the new swig version.
Changes in v2:
- Added babeltrace2 patch to fix SWIG 4.5.0 compatibility
Jaipaul Cheernam (2):
swig: upgrade 4.4.1 -> 4.5.0
babeltrace2: fix build with swig 4.5.0
.../swig/swig/determinism.patch | 20 +++---
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 +-
...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 70 +++++++++++++++++++
.../recipes-kernel/lttng/babeltrace2_2.1.2.bb | 1 +
4 files changed, 83 insertions(+), 12 deletions(-)
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
create mode 100644 meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 1/2] swig: upgrade 4.4.1 -> 4.5.0
2026-08-11 6:12 ` [PATCH v2 0/2] " Jaipaul Cheernam
@ 2026-08-11 6:12 ` Jaipaul Cheernam
2026-08-11 10:25 ` [OE-core] " Richard Purdie
2026-08-11 6:12 ` [PATCH v2 2/2] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
1 sibling, 1 reply; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 6:12 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
ChangeLog: https://www.swig.org/Release/CHANGES.current
Release Notes: https://www.swig.org/Release/RELEASENOTES
CompareLog: https://github.com/swig/swig/compare/v4.4.1...v4.5.0
- Refresh determinism.patch
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
.../swig/swig/determinism.patch | 20 +++++++++----------
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
diff --git a/meta/recipes-devtools/swig/swig/determinism.patch b/meta/recipes-devtools/swig/swig/determinism.patch
index d6af38248d..9b021091cd 100644
--- a/meta/recipes-devtools/swig/swig/determinism.patch
+++ b/meta/recipes-devtools/swig/swig/determinism.patch
@@ -1,26 +1,26 @@
-From 7df78bedb666e49131c48f1854c6be1597bd133c Mon Sep 17 00:00:00 2001
+From 218e2a20ff978cb28fefdf7b35af8a27768df4db Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
-Date: Mon, 1 Mar 2021 00:11:10 +0000
+Date: Mon, 10 Aug 2026 11:13:20 +0000
Subject: [PATCH] swig: Fix reproducibility issue
Remove the compiler commandline/platform from the compiled binary as this
breaks reproducibilty.
-Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take]
+Upstream-Status: Inappropriate [OE reproducibility fix upstream unlikely to take]
RP 2021/3/1
---
Source/Modules/main.cxx | 1 -
1 file changed, 1 deletion(-)
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
-index f68b609..0c2aba3 100644
+index 83ab22a..79a513a 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
-@@ -633,7 +633,6 @@ static void getoptions(int argc, char *argv[]) {
- }
+@@ -642,7 +642,6 @@ static void getoptions(int argc, char *argv[]) {
+ }
} else if (strcmp(argv[i], "-version") == 0 || strcmp(argv[1], "--version") == 0) {
- fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
-- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
- fprintf(stdout, "\nConfigured options: %cpcre\n",
+ fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
+- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
+ fprintf(stdout,
+ "\nConfigured options: %cpcre\n",
#ifdef HAVE_PCRE
- '+'
diff --git a/meta/recipes-devtools/swig/swig_4.4.1.bb b/meta/recipes-devtools/swig/swig_4.5.0.bb
similarity index 92%
rename from meta/recipes-devtools/swig/swig_4.4.1.bb
rename to meta/recipes-devtools/swig/swig_4.5.0.bb
index 842a7b0945..161c23f0af 100644
--- a/meta/recipes-devtools/swig/swig_4.4.1.bb
+++ b/meta/recipes-devtools/swig/swig_4.5.0.bb
@@ -13,9 +13,9 @@ SECTION = "devel"
DEPENDS = "libpcre2 bison-native"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
- file://determinism.patch \
+ file://determinism.patch \
"
-SRC_URI[sha256sum] = "40162a706c56f7592d08fd52ef5511cb7ac191f3593cf07306a0a554c6281fcf"
+SRC_URI[sha256sum] = "22ae0e887f8cca8031a325c67d005207653200b40e71edb3f88780e28e47d0ff"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/swig/files/swig/"
UPSTREAM_CHECK_REGEX = "swig-(?P<pver>\d+(\.\d+)+)"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 2/2] babeltrace2: fix build with swig 4.5.0
2026-08-11 6:12 ` [PATCH v2 0/2] " Jaipaul Cheernam
2026-08-11 6:12 ` [PATCH v2 1/2] " Jaipaul Cheernam
@ 2026-08-11 6:12 ` Jaipaul Cheernam
1 sibling, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 6:12 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2/3 compatibility macros PyString_FromString
and SWIG_Python_str_FromChar. Backport upstream fix that replaces both
with PyUnicode_FromString.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 70 +++++++++++++++++++
.../recipes-kernel/lttng/babeltrace2_2.1.2.bb | 1 +
2 files changed, 71 insertions(+)
create mode 100644 meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
diff --git a/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch b/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
new file mode 100644
index 0000000000..e0b042d62d
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
@@ -0,0 +1,70 @@
+From 1c59884d4d3c74d8ea7257d9cdc0fa4b533ae7b3 Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Mon, 28 Jul 2026 13:29:18 +0000
+Subject: [PATCH] bt2: replace removed Python 2 C API macros for SWIG 4.5.0
+ compatibility
+
+SWIG 4.5.0 has removed some Python 2/3 compatibility macros. The two
+that affect us are `PyString_FromString` and
+`SWIG_Python_str_FromChar`, which are both replaced with
+`PyUnicode_FromString`.
+
+Change-Id: I3c74d8ea7257d9cdc0fa4b533ae7b3a5ef9521d1
+Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
+Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
+Reviewed-on: https://review.lttng.org/c/babeltrace/+/18423
+Tested-by: jenkins <jenkins@lttng.org>
+(cherry picked from commit 1c59884d4d3c74d8ea7257d9cdc0fa4b533ae7b3)
+
+Upstream-Status: Backport [https://github.com/efficios/babeltrace/commit/1c59884d4d]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ src/bindings/python/bt2/bt2/native_bt.i | 4 ++--
+ src/bindings/python/bt2/bt2/native_bt_error.i.hpp | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bindings/python/bt2/bt2/native_bt.i b/src/bindings/python/bt2/bt2/native_bt.i
+index 7f8d9f699..1807d8ff6 100644
+--- a/src/bindings/python/bt2/bt2/native_bt.i
++++ b/src/bindings/python/bt2/bt2/native_bt.i
+@@ -56,7 +56,7 @@ typedef uint64_t bt_listener_id;
+ *
+ * We initialize the output parameter `temp_value` to an invalid but non-zero
+ * pointer value. This is to make sure we don't rely on its initial value in
+- * the epilogue (where we call SWIG_Python_str_FromChar). When they fail,
++ * the epilogue (where we call PyUnicode_FromString). When they fail,
+ * functions on which we apply this typemap don't guarantee that the value of
+ * `temp_value` will be unchanged or valid.
+ */
+@@ -67,7 +67,7 @@ typedef uint64_t bt_listener_id;
+ %typemap(argout) (const char **) {
+ if (*$1) {
+ /* SWIG_AppendOutput() steals the created object */
+- $result = SWIG_AppendOutput($result, SWIG_Python_str_FromChar(*$1));
++ $result = SWIG_AppendOutput($result, PyUnicode_FromString(*$1));
+ } else {
+ /* SWIG_AppendOutput() steals Py_None */
+ Py_INCREF(Py_None);
+diff --git a/src/bindings/python/bt2/bt2/native_bt_error.i.hpp b/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+index ba8cef097..2be1e347c 100644
+--- a/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
++++ b/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+@@ -19,7 +19,7 @@ static PyObject *bt_bt2_format_bt_error_cause(const bt_error_cause *error_cause)
+ BT_COMMON_COLOR_WHEN_NEVER);
+ BT_ASSERT(error_cause_str);
+
+- py_error_cause_str = PyString_FromString(error_cause_str);
++ py_error_cause_str = PyUnicode_FromString(error_cause_str);
+
+ g_free(error_cause_str);
+
+@@ -35,7 +35,7 @@ static PyObject *bt_bt2_format_bt_error(const bt_error *error)
+ BT_COMMON_COLOR_WHEN_NEVER);
+ BT_ASSERT(error_str);
+
+- py_error_str = PyString_FromString(error_str);
++ py_error_str = PyUnicode_FromString(error_str);
+
+ g_free(error_str);
+
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb b/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
index 7c151bf729..9962ef377c 100644
--- a/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
+++ b/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
@@ -15,6 +15,7 @@ SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.1;protocol=http
file://0001-Make-bt_field_blob_get_length-return-size_t-instead-.patch \
file://external-python-tests.patch \
file://0001-src-explicitly-only-build-shared-plugins.patch \
+ file://0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch \
"
SRCREV = "d0e946a71faf5f0c2d7f1fb5b92a369983e9cf10"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH v2 1/2] swig: upgrade 4.4.1 -> 4.5.0
2026-08-11 6:12 ` [PATCH v2 1/2] " Jaipaul Cheernam
@ 2026-08-11 10:25 ` Richard Purdie
2026-08-11 11:15 ` Jaipaul Cheernam
0 siblings, 1 reply; 19+ messages in thread
From: Richard Purdie @ 2026-08-11 10:25 UTC (permalink / raw)
To: jaipaul.cheernam, openembedded-core
On Tue, 2026-08-11 at 08:12 +0200, Jaipaul Cheernam via lists.openembedded.org wrote:
> ChangeLog: https://www.swig.org/Release/CHANGES.current
>
> Release Notes: https://www.swig.org/Release/RELEASENOTES
>
> CompareLog: https://github.com/swig/swig/compare/v4.4.1...v4.5.0
>
> - Refresh determinism.patch
>
> Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
> ---
> .../swig/swig/determinism.patch | 20 +++++++++----------
> .../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
> 2 files changed, 12 insertions(+), 12 deletions(-)
> rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
I suspect this breaks u-boot-tools:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/4370
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/4214
and maybe python3-dtc:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/89/builds/4188
Cheers,
Richard
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0
2026-08-10 15:45 [PATCH] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-10 21:02 ` [OE-core] " Richard Purdie
2026-08-11 6:12 ` [PATCH v2 0/2] " Jaipaul Cheernam
@ 2026-08-11 11:11 ` Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 1/4] " Jaipaul Cheernam
` (3 more replies)
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
3 siblings, 4 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 11:11 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
Upgrade swig to 4.5.0 and fix build breakage in recipes that used
Python 2 C API macros removed in swig 4.5.0.
Note: The following recipes in meta-openembedded may also be affected
if python/swig bindings are enabled:
- gensio (meta-oe): fix available upstream [1]
- unbound (meta-networking): fix available upstream [2]
- ldns (meta-oe): fix pending upstream [3]
[1] https://github.com/cminyard/gensio/commit/e024df7fc3d21896bd9d2e26964a0b59b7c2a91b
[2] https://github.com/NLnetLabs/unbound/commit/93a56205cfa6b9a6d34db7245aa71e5ca67d1fd7
[3] https://github.com/NLnetLabs/ldns/issues/314
Changes in v3:
- Added u-boot-tools and python3-dtc patches to fix pylibfdt build
Changes in v2:
- Added babeltrace2 patch to fix SWIG 4.5.0 compatibility
Jaipaul Cheernam (4):
swig: upgrade 4.4.1 -> 4.5.0
babeltrace2: fix build with swig 4.5.0
u-boot-tools: fix pylibfdt build with swig 4.5.0
python3-dtc: fix build with swig 4.5.0
...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++
.../u-boot/u-boot-tools_2026.07.bb | 4 +-
...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++
.../python/python3-dtc_1.8.1.bb | 1 +
.../swig/swig/determinism.patch | 20 +++---
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 +-
...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 70 +++++++++++++++++++
.../recipes-kernel/lttng/babeltrace2_2.1.2.bb | 1 +
8 files changed, 201 insertions(+), 13 deletions(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
create mode 100644 meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
create mode 100644 meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 1/4] swig: upgrade 4.4.1 -> 4.5.0
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
@ 2026-08-11 11:11 ` Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 2/4] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
` (2 subsequent siblings)
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 11:11 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
ChangeLog: https://www.swig.org/Release/CHANGES.current
Release Notes: https://www.swig.org/Release/RELEASENOTES
CompareLog: https://github.com/swig/swig/compare/v4.4.1...v4.5.0
- Refresh determinism.patch
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
.../swig/swig/determinism.patch | 20 +++++++++----------
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
diff --git a/meta/recipes-devtools/swig/swig/determinism.patch b/meta/recipes-devtools/swig/swig/determinism.patch
index d6af38248d..9b021091cd 100644
--- a/meta/recipes-devtools/swig/swig/determinism.patch
+++ b/meta/recipes-devtools/swig/swig/determinism.patch
@@ -1,26 +1,26 @@
-From 7df78bedb666e49131c48f1854c6be1597bd133c Mon Sep 17 00:00:00 2001
+From 218e2a20ff978cb28fefdf7b35af8a27768df4db Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
-Date: Mon, 1 Mar 2021 00:11:10 +0000
+Date: Mon, 10 Aug 2026 11:13:20 +0000
Subject: [PATCH] swig: Fix reproducibility issue
Remove the compiler commandline/platform from the compiled binary as this
breaks reproducibilty.
-Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take]
+Upstream-Status: Inappropriate [OE reproducibility fix upstream unlikely to take]
RP 2021/3/1
---
Source/Modules/main.cxx | 1 -
1 file changed, 1 deletion(-)
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
-index f68b609..0c2aba3 100644
+index 83ab22a..79a513a 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
-@@ -633,7 +633,6 @@ static void getoptions(int argc, char *argv[]) {
- }
+@@ -642,7 +642,6 @@ static void getoptions(int argc, char *argv[]) {
+ }
} else if (strcmp(argv[i], "-version") == 0 || strcmp(argv[1], "--version") == 0) {
- fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
-- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
- fprintf(stdout, "\nConfigured options: %cpcre\n",
+ fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
+- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
+ fprintf(stdout,
+ "\nConfigured options: %cpcre\n",
#ifdef HAVE_PCRE
- '+'
diff --git a/meta/recipes-devtools/swig/swig_4.4.1.bb b/meta/recipes-devtools/swig/swig_4.5.0.bb
similarity index 92%
rename from meta/recipes-devtools/swig/swig_4.4.1.bb
rename to meta/recipes-devtools/swig/swig_4.5.0.bb
index 842a7b0945..161c23f0af 100644
--- a/meta/recipes-devtools/swig/swig_4.4.1.bb
+++ b/meta/recipes-devtools/swig/swig_4.5.0.bb
@@ -13,9 +13,9 @@ SECTION = "devel"
DEPENDS = "libpcre2 bison-native"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
- file://determinism.patch \
+ file://determinism.patch \
"
-SRC_URI[sha256sum] = "40162a706c56f7592d08fd52ef5511cb7ac191f3593cf07306a0a554c6281fcf"
+SRC_URI[sha256sum] = "22ae0e887f8cca8031a325c67d005207653200b40e71edb3f88780e28e47d0ff"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/swig/files/swig/"
UPSTREAM_CHECK_REGEX = "swig-(?P<pver>\d+(\.\d+)+)"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 2/4] babeltrace2: fix build with swig 4.5.0
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 1/4] " Jaipaul Cheernam
@ 2026-08-11 11:11 ` Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 4/4] python3-dtc: fix " Jaipaul Cheernam
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 11:11 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2/3 compatibility macros PyString_FromString
and SWIG_Python_str_FromChar. Backport upstream fix that replaces both
with PyUnicode_FromString.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 70 +++++++++++++++++++
.../recipes-kernel/lttng/babeltrace2_2.1.2.bb | 1 +
2 files changed, 71 insertions(+)
create mode 100644 meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
diff --git a/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch b/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
new file mode 100644
index 0000000000..e0b042d62d
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
@@ -0,0 +1,70 @@
+From 1c59884d4d3c74d8ea7257d9cdc0fa4b533ae7b3 Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Mon, 28 Jul 2026 13:29:18 +0000
+Subject: [PATCH] bt2: replace removed Python 2 C API macros for SWIG 4.5.0
+ compatibility
+
+SWIG 4.5.0 has removed some Python 2/3 compatibility macros. The two
+that affect us are `PyString_FromString` and
+`SWIG_Python_str_FromChar`, which are both replaced with
+`PyUnicode_FromString`.
+
+Change-Id: I3c74d8ea7257d9cdc0fa4b533ae7b3a5ef9521d1
+Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
+Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
+Reviewed-on: https://review.lttng.org/c/babeltrace/+/18423
+Tested-by: jenkins <jenkins@lttng.org>
+(cherry picked from commit 1c59884d4d3c74d8ea7257d9cdc0fa4b533ae7b3)
+
+Upstream-Status: Backport [https://github.com/efficios/babeltrace/commit/1c59884d4d]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ src/bindings/python/bt2/bt2/native_bt.i | 4 ++--
+ src/bindings/python/bt2/bt2/native_bt_error.i.hpp | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bindings/python/bt2/bt2/native_bt.i b/src/bindings/python/bt2/bt2/native_bt.i
+index 7f8d9f699..1807d8ff6 100644
+--- a/src/bindings/python/bt2/bt2/native_bt.i
++++ b/src/bindings/python/bt2/bt2/native_bt.i
+@@ -56,7 +56,7 @@ typedef uint64_t bt_listener_id;
+ *
+ * We initialize the output parameter `temp_value` to an invalid but non-zero
+ * pointer value. This is to make sure we don't rely on its initial value in
+- * the epilogue (where we call SWIG_Python_str_FromChar). When they fail,
++ * the epilogue (where we call PyUnicode_FromString). When they fail,
+ * functions on which we apply this typemap don't guarantee that the value of
+ * `temp_value` will be unchanged or valid.
+ */
+@@ -67,7 +67,7 @@ typedef uint64_t bt_listener_id;
+ %typemap(argout) (const char **) {
+ if (*$1) {
+ /* SWIG_AppendOutput() steals the created object */
+- $result = SWIG_AppendOutput($result, SWIG_Python_str_FromChar(*$1));
++ $result = SWIG_AppendOutput($result, PyUnicode_FromString(*$1));
+ } else {
+ /* SWIG_AppendOutput() steals Py_None */
+ Py_INCREF(Py_None);
+diff --git a/src/bindings/python/bt2/bt2/native_bt_error.i.hpp b/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+index ba8cef097..2be1e347c 100644
+--- a/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
++++ b/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+@@ -19,7 +19,7 @@ static PyObject *bt_bt2_format_bt_error_cause(const bt_error_cause *error_cause)
+ BT_COMMON_COLOR_WHEN_NEVER);
+ BT_ASSERT(error_cause_str);
+
+- py_error_cause_str = PyString_FromString(error_cause_str);
++ py_error_cause_str = PyUnicode_FromString(error_cause_str);
+
+ g_free(error_cause_str);
+
+@@ -35,7 +35,7 @@ static PyObject *bt_bt2_format_bt_error(const bt_error *error)
+ BT_COMMON_COLOR_WHEN_NEVER);
+ BT_ASSERT(error_str);
+
+- py_error_str = PyString_FromString(error_str);
++ py_error_str = PyUnicode_FromString(error_str);
+
+ g_free(error_str);
+
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb b/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
index 7c151bf729..9962ef377c 100644
--- a/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
+++ b/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
@@ -15,6 +15,7 @@ SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.1;protocol=http
file://0001-Make-bt_field_blob_get_length-return-size_t-instead-.patch \
file://external-python-tests.patch \
file://0001-src-explicitly-only-build-shared-plugins.patch \
+ file://0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch \
"
SRCREV = "d0e946a71faf5f0c2d7f1fb5b92a369983e9cf10"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 3/4] u-boot-tools: fix pylibfdt build with swig 4.5.0
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 1/4] " Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 2/4] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
@ 2026-08-11 11:11 ` Jaipaul Cheernam
2026-08-11 12:58 ` [OE-core] " Mathieu Dubois-Briand
2026-08-11 13:38 ` Quentin Schulz
2026-08-11 11:11 ` [PATCH v3 4/4] python3-dtc: fix " Jaipaul Cheernam
3 siblings, 2 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 11:11 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime. Backport the dtc upstream fix to u-boot's bundled
pylibfdt/libfdt.i to replace them with Python 3 equivalents.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++++++
.../u-boot/u-boot-tools_2026.07.bb | 4 +-
2 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
diff --git a/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch b/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
new file mode 100644
index 0000000000..5fdccf5e9d
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
@@ -0,0 +1,57 @@
+From 32378d7b4383a79d13da9005035600d8f0c8c29d Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Tue, 29 Jul 2026 05:55:56 +0000
+Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
+
+SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
+from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
+them with their Python 3 C API equivalents:
+
+- PyString_FromString -> PyUnicode_FromString
+- PyString_AsString -> PyBytes_AsString
+- PyInt_AsLong -> PyLong_AsLong
+
+The replacements are safe since the macros were already aliased to
+these exact functions in SWIG's Python 3 code path.
+
+Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+(cherry picked from commit 5008d1d6a356b8d0a78060da2e1021507d529cff)
+
+Upstream-Status: Backport [https://github.com/dgibson/dtc/commit/5008d1d6a356b8d0a78060da2e1021507d529cff]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ scripts/dtc/pylibfdt/libfdt.i | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/dtc/pylibfdt/libfdt.i b/scripts/dtc/pylibfdt/libfdt.i
+index 1f9c0471..b1cb9873 100644
+--- a/scripts/dtc/pylibfdt/libfdt.i
++++ b/scripts/dtc/pylibfdt/libfdt.i
+@@ -1136,7 +1136,7 @@ typedef uint32_t fdt32_t;
+ PyObject *buff;
+
+ if ($1) {
+- resultobj = PyString_FromString(
++ resultobj = PyUnicode_FromString(
+ fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
+ buff = PyByteArray_FromStringAndSize(
+ (const char *)($1 + 1), fdt32_to_cpu($1->len));
+@@ -1169,13 +1169,13 @@ typedef uint32_t fdt32_t;
+ }
+ $1 = PyBytes_AsString($input);
+ %#else
+- $1 = PyString_AsString($input); /* char *str */
++ $1 = PyBytes_AsString($input); /* char *str */
+ %#endif
+ }
+
+ /* typemaps used for fdt_next_node() */
+ %typemap(in, numinputs=1) int *depth (int depth) {
+- depth = (int) PyInt_AsLong($input);
++ depth = (int) PyLong_AsLong($input);
+ $1 = &depth;
+ }
+
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb b/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb
index 9e7a178310..ea90b726c5 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb
@@ -1,4 +1,6 @@
require u-boot-common.inc
require u-boot-tools.inc
-SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch"
+SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch \
+ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \
+ "
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 4/4] python3-dtc: fix build with swig 4.5.0
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
` (2 preceding siblings ...)
2026-08-11 11:11 ` [PATCH v3 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
@ 2026-08-11 11:11 ` Jaipaul Cheernam
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 11:11 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime. Backport the upstream fix to replace them with
Python 3 equivalents.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++++++
.../python/python3-dtc_1.8.1.bb | 1 +
2 files changed, 58 insertions(+)
create mode 100644 meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
diff --git a/meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch b/meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
new file mode 100644
index 0000000000..877aea3a8d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
@@ -0,0 +1,57 @@
+From 32378d7b4383a79d13da9005035600d8f0c8c29d Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Tue, 29 Jul 2026 05:55:56 +0000
+Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
+
+SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
+from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
+them with their Python 3 C API equivalents:
+
+- PyString_FromString -> PyUnicode_FromString
+- PyString_AsString -> PyBytes_AsString
+- PyInt_AsLong -> PyLong_AsLong
+
+The replacements are safe since the macros were already aliased to
+these exact functions in SWIG's Python 3 code path.
+
+Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+(cherry picked from commit 5008d1d6a356b8d0a78060da2e1021507d529cff)
+
+Upstream-Status: Backport [https://github.com/dgibson/dtc/commit/5008d1d6a356b8d0a78060da2e1021507d529cff]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ pylibfdt/libfdt.i | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
+index 1f9c0471..b1cb9873 100644
+--- a/pylibfdt/libfdt.i
++++ b/pylibfdt/libfdt.i
+@@ -1136,7 +1136,7 @@ typedef uint32_t fdt32_t;
+ PyObject *buff;
+
+ if ($1) {
+- resultobj = PyString_FromString(
++ resultobj = PyUnicode_FromString(
+ fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
+ buff = PyByteArray_FromStringAndSize(
+ (const char *)($1 + 1), fdt32_to_cpu($1->len));
+@@ -1169,13 +1169,13 @@ typedef uint32_t fdt32_t;
+ }
+ $1 = PyBytes_AsString($input);
+ %#else
+- $1 = PyString_AsString($input); /* char *str */
++ $1 = PyBytes_AsString($input); /* char *str */
+ %#endif
+ }
+
+ /* typemaps used for fdt_next_node() */
+ %typemap(in, numinputs=1) int *depth (int depth) {
+- depth = (int) PyInt_AsLong($input);
++ depth = (int) PyLong_AsLong($input);
+ $1 = &depth;
+ }
+
diff --git a/meta/recipes-devtools/python/python3-dtc_1.8.1.bb b/meta/recipes-devtools/python/python3-dtc_1.8.1.bb
index 51abf3640a..915cd6a730 100644
--- a/meta/recipes-devtools/python/python3-dtc_1.8.1.bb
+++ b/meta/recipes-devtools/python/python3-dtc_1.8.1.bb
@@ -7,6 +7,7 @@ LICENSE = "BSD-2-Clause OR GPL-2.0-only"
DEPENDS = "flex-native bison-native swig-native python3-setuptools-scm-native libyaml dtc"
SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https;tag=v${PV} \
+ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \
"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH v2 1/2] swig: upgrade 4.4.1 -> 4.5.0
2026-08-11 10:25 ` [OE-core] " Richard Purdie
@ 2026-08-11 11:15 ` Jaipaul Cheernam
0 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 11:15 UTC (permalink / raw)
To: Richard Purdie, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1647 bytes --]
Hi Richard,
I will send v3 by fixing dtc and u-boot-tools.
Note: The following recipes in meta-openembedded may also be affected
if python/swig bindings are enabled:
- gensio (meta-oe): fix available upstream [1]
- unbound (meta-networking): fix available upstream [2]
- ldns (meta-oe): fix pending upstream [3]
[1]https://github.com/cminyard/gensio/commit/e024df7fc3d21896bd9d2e26964a0b59b7c2a91b
[2]https://github.com/NLnetLabs/unbound/commit/93a56205cfa6b9a6d34db7245aa71e5ca67d1fd7
[3]https://github.com/NLnetLabs/ldns/issues/314
As they are not enabled now, will not provide a fix.
Regards,
Jaipaul
On 2026-08-11 12:25, Richard Purdie wrote:
> On Tue, 2026-08-11 at 08:12 +0200, Jaipaul Cheernam via lists.openembedded.org wrote:
>> ChangeLog:https://www.swig.org/Release/CHANGES.current
>>
>> Release Notes:https://www.swig.org/Release/RELEASENOTES
>>
>> CompareLog:https://github.com/swig/swig/compare/v4.4.1...v4.5.0
>>
>> - Refresh determinism.patch
>>
>> Signed-off-by: Jaipaul Cheernam<jaipaul.cheernam@est.tech>
>> ---
>> .../swig/swig/determinism.patch | 20 +++++++++----------
>> .../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
>> 2 files changed, 12 insertions(+), 12 deletions(-)
>> rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
> I suspect this breaks u-boot-tools:
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/4370
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/4214
>
> and maybe python3-dtc:
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/89/builds/4188
>
> Cheers,
>
> Richard
[-- Attachment #2: Type: text/html, Size: 11106 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH v3 3/4] u-boot-tools: fix pylibfdt build with swig 4.5.0
2026-08-11 11:11 ` [PATCH v3 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
@ 2026-08-11 12:58 ` Mathieu Dubois-Briand
2026-08-11 13:38 ` Quentin Schulz
1 sibling, 0 replies; 19+ messages in thread
From: Mathieu Dubois-Briand @ 2026-08-11 12:58 UTC (permalink / raw)
To: Jaipaul Cheernam, openembedded-core
On Tue Aug 11, 2026 at 1:11 PM CEST, Jaipaul Cheernam wrote:
> SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
> from its runtime. Backport the dtc upstream fix to u-boot's bundled
> pylibfdt/libfdt.i to replace them with Python 3 equivalents.
>
> Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
> ---
Hi Jaipaul,
Thanks for your patch.
Can you confirm this is based on today master? The u-boot patch fails to
apply on my side:
ERROR: u-boot-tools-1_2026.07-r0 do_patch: Applying patch '/srv/pokybuild/yocto-worker/musl-qemux86-64/build/layers/openembedded-core/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch' on target directory '/srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/x86-64-v3-poky-linux-musl/u-boot-tools/2026.07/sources/u-boot-tools-2026.07'
CmdError('quilt --quiltrc /srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/x86-64-v3-poky-linux-musl/u-boot-tools/2026.07/recipe-sysroot-native/etc/quiltrc push', 1, "stdout: Applying patch 0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
can't find file to patch at input line 33
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 32378d7b4383a79d13da9005035600d8f0c8c29d Mon Sep 17 00:00:00 2001
|From: Jitka Plesnikova <jplesnik@redhat.com>
|Date: Tue, 29 Jul 2026 05:55:56 +0000
|Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
|
|SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
|from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
|them with their Python 3 C API equivalents:
|
|- PyString_FromString -> PyUnicode_FromString
|- PyString_AsString -> PyBytes_AsString
|- PyInt_AsLong -> PyLong_AsLong
|
|The replacements are safe since the macros were already aliased to
|these exact functions in SWIG's Python 3 code path.
|
|Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
|Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|(cherry picked from commit 5008d1d6a356b8d0a78060da2e1021507d529cff)
|
|Upstream-Status: Backport [https://github.com/dgibson/dtc/commit/5008d1d6a356b8d0a78060da2e1021507d529cff]
|
|Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|---
| scripts/dtc/pylibfdt/libfdt.i | 6 +++---
| 1 file changed, 3 insertions(+), 3 deletions(-)
|
|diff --git a/scripts/dtc/pylibfdt/libfdt.i b/scripts/dtc/pylibfdt/libfdt.i
|index 1f9c0471..b1cb9873 100644
|--- a/scripts/dtc/pylibfdt/libfdt.i
|+++ b/scripts/dtc/pylibfdt/libfdt.i
--------------------------
No file to patch. Skipping patch.
2 out of 2 hunks ignored
Patch 0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch does not apply (enforce with -f)
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/4216
https://autobuilder.yoctoproject.org/valkyrie/#/builders/3/builds/4423
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH v3 3/4] u-boot-tools: fix pylibfdt build with swig 4.5.0
2026-08-11 11:11 ` [PATCH v3 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
2026-08-11 12:58 ` [OE-core] " Mathieu Dubois-Briand
@ 2026-08-11 13:38 ` Quentin Schulz
1 sibling, 0 replies; 19+ messages in thread
From: Quentin Schulz @ 2026-08-11 13:38 UTC (permalink / raw)
To: jaipaul.cheernam, openembedded-core
Hi Jaipaul,
On 8/11/26 1:11 PM, Jaipaul Cheernam via lists.openembedded.org wrote:
> SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
> from its runtime. Backport the dtc upstream fix to u-boot's bundled
> pylibfdt/libfdt.i to replace them with Python 3 equivalents.
>
> Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
> ---
> ...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++++++
> .../u-boot/u-boot-tools_2026.07.bb | 4 +-
> 2 files changed, 60 insertions(+), 1 deletion(-)
> create mode 100644 meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
>
> diff --git a/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch b/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
> new file mode 100644
> index 0000000000..5fdccf5e9d
> --- /dev/null
> +++ b/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
> @@ -0,0 +1,57 @@
> +From 32378d7b4383a79d13da9005035600d8f0c8c29d Mon Sep 17 00:00:00 2001
> +From: Jitka Plesnikova <jplesnik@redhat.com>
> +Date: Tue, 29 Jul 2026 05:55:56 +0000
> +Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
> +
> +SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
> +from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
> +them with their Python 3 C API equivalents:
> +
> +- PyString_FromString -> PyUnicode_FromString
> +- PyString_AsString -> PyBytes_AsString
> +- PyInt_AsLong -> PyLong_AsLong
> +
> +The replacements are safe since the macros were already aliased to
> +these exact functions in SWIG's Python 3 code path.
> +
> +Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
> +Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> +Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> +(cherry picked from commit 5008d1d6a356b8d0a78060da2e1021507d529cff)
> +
> +Upstream-Status: Backport [https://github.com/dgibson/dtc/commit/5008d1d6a356b8d0a78060da2e1021507d529cff]
> +
Not a backport. This commit doesn't exist in U-Boot. Please work with
upstream U-Boot on fixing this so that other build systems/distros don't
need to duplicate the work and we don't have to carry this patch forever
in Yocto.
Cheers,
Quentin
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0
2026-08-10 15:45 [PATCH] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
` (2 preceding siblings ...)
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
@ 2026-08-11 13:51 ` Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 1/4] " Jaipaul Cheernam
` (3 more replies)
3 siblings, 4 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 13:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
Upgrade swig to 4.5.0 and fix build breakage in recipes that used
Python 2 C API macros removed in swig 4.5.0.
Note: The following recipes in meta-openembedded may also be affected
if python/swig bindings are enabled:
- gensio (meta-oe): fix available upstream [1]
- unbound (meta-networking): fix available upstream [2]
- ldns (meta-oe): fix pending upstream [3]
[1] https://github.com/cminyard/gensio/commit/e024df7fc3d21896bd9d2e26964a0b59b7c2a91b
[2] https://github.com/NLnetLabs/unbound/commit/93a56205cfa6b9a6d34db7245aa71e5ca67d1fd7
[3] https://github.com/NLnetLabs/ldns/issues/314
Changes in v4:
- Fixed u-boot-tools patch path (libfdt.i_shipped, not libfdt.i)
- Submitted fix to u-boot upstream [4]
[4] https://patchwork.ozlabs.org/patch/2283713/
Changes in v3:
- Added u-boot-tools and python3-dtc patches to fix pylibfdt build
Changes in v2:
- Added babeltrace2 patch to fix SWIG 4.5.0 compatibility
Jaipaul Cheernam (4):
swig: upgrade 4.4.1 -> 4.5.0
babeltrace2: fix build with swig 4.5.0
u-boot-tools: fix pylibfdt build with swig 4.5.0
python3-dtc: fix build with swig 4.5.0
...-removed-SWIG-Python-2-compatibility.patch | 55 +++++++++++++++
.../u-boot/u-boot-tools_2026.07.bb | 4 +-
...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++
.../python/python3-dtc_1.8.1.bb | 1 +
.../swig/swig/determinism.patch | 20 +++---
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 +-
...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 70 +++++++++++++++++++
.../recipes-kernel/lttng/babeltrace2_2.1.2.bb | 1 +
8 files changed, 199 insertions(+), 13 deletions(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
create mode 100644 meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
create mode 100644 meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v4 1/4] swig: upgrade 4.4.1 -> 4.5.0
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
@ 2026-08-11 13:51 ` Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 2/4] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
` (2 subsequent siblings)
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 13:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
ChangeLog: https://www.swig.org/Release/CHANGES.current
Release Notes: https://www.swig.org/Release/RELEASENOTES
CompareLog: https://github.com/swig/swig/compare/v4.4.1...v4.5.0
- Refresh determinism.patch
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
.../swig/swig/determinism.patch | 20 +++++++++----------
.../swig/{swig_4.4.1.bb => swig_4.5.0.bb} | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
rename meta/recipes-devtools/swig/{swig_4.4.1.bb => swig_4.5.0.bb} (92%)
diff --git a/meta/recipes-devtools/swig/swig/determinism.patch b/meta/recipes-devtools/swig/swig/determinism.patch
index d6af38248d..9b021091cd 100644
--- a/meta/recipes-devtools/swig/swig/determinism.patch
+++ b/meta/recipes-devtools/swig/swig/determinism.patch
@@ -1,26 +1,26 @@
-From 7df78bedb666e49131c48f1854c6be1597bd133c Mon Sep 17 00:00:00 2001
+From 218e2a20ff978cb28fefdf7b35af8a27768df4db Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
-Date: Mon, 1 Mar 2021 00:11:10 +0000
+Date: Mon, 10 Aug 2026 11:13:20 +0000
Subject: [PATCH] swig: Fix reproducibility issue
Remove the compiler commandline/platform from the compiled binary as this
breaks reproducibilty.
-Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take]
+Upstream-Status: Inappropriate [OE reproducibility fix upstream unlikely to take]
RP 2021/3/1
---
Source/Modules/main.cxx | 1 -
1 file changed, 1 deletion(-)
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
-index f68b609..0c2aba3 100644
+index 83ab22a..79a513a 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
-@@ -633,7 +633,6 @@ static void getoptions(int argc, char *argv[]) {
- }
+@@ -642,7 +642,6 @@ static void getoptions(int argc, char *argv[]) {
+ }
} else if (strcmp(argv[i], "-version") == 0 || strcmp(argv[1], "--version") == 0) {
- fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
-- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
- fprintf(stdout, "\nConfigured options: %cpcre\n",
+ fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
+- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
+ fprintf(stdout,
+ "\nConfigured options: %cpcre\n",
#ifdef HAVE_PCRE
- '+'
diff --git a/meta/recipes-devtools/swig/swig_4.4.1.bb b/meta/recipes-devtools/swig/swig_4.5.0.bb
similarity index 92%
rename from meta/recipes-devtools/swig/swig_4.4.1.bb
rename to meta/recipes-devtools/swig/swig_4.5.0.bb
index 842a7b0945..161c23f0af 100644
--- a/meta/recipes-devtools/swig/swig_4.4.1.bb
+++ b/meta/recipes-devtools/swig/swig_4.5.0.bb
@@ -13,9 +13,9 @@ SECTION = "devel"
DEPENDS = "libpcre2 bison-native"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
- file://determinism.patch \
+ file://determinism.patch \
"
-SRC_URI[sha256sum] = "40162a706c56f7592d08fd52ef5511cb7ac191f3593cf07306a0a554c6281fcf"
+SRC_URI[sha256sum] = "22ae0e887f8cca8031a325c67d005207653200b40e71edb3f88780e28e47d0ff"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/swig/files/swig/"
UPSTREAM_CHECK_REGEX = "swig-(?P<pver>\d+(\.\d+)+)"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 2/4] babeltrace2: fix build with swig 4.5.0
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 1/4] " Jaipaul Cheernam
@ 2026-08-11 13:51 ` Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
2026-08-11 13:52 ` [PATCH v4 4/4] python3-dtc: fix " Jaipaul Cheernam
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 13:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2/3 compatibility macros PyString_FromString
and SWIG_Python_str_FromChar. Backport upstream fix that replaces both
with PyUnicode_FromString.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 70 +++++++++++++++++++
.../recipes-kernel/lttng/babeltrace2_2.1.2.bb | 1 +
2 files changed, 71 insertions(+)
create mode 100644 meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
diff --git a/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch b/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
new file mode 100644
index 0000000000..e0b042d62d
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace2/0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
@@ -0,0 +1,70 @@
+From 1c59884d4d3c74d8ea7257d9cdc0fa4b533ae7b3 Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Mon, 28 Jul 2026 13:29:18 +0000
+Subject: [PATCH] bt2: replace removed Python 2 C API macros for SWIG 4.5.0
+ compatibility
+
+SWIG 4.5.0 has removed some Python 2/3 compatibility macros. The two
+that affect us are `PyString_FromString` and
+`SWIG_Python_str_FromChar`, which are both replaced with
+`PyUnicode_FromString`.
+
+Change-Id: I3c74d8ea7257d9cdc0fa4b533ae7b3a5ef9521d1
+Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
+Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
+Reviewed-on: https://review.lttng.org/c/babeltrace/+/18423
+Tested-by: jenkins <jenkins@lttng.org>
+(cherry picked from commit 1c59884d4d3c74d8ea7257d9cdc0fa4b533ae7b3)
+
+Upstream-Status: Backport [https://github.com/efficios/babeltrace/commit/1c59884d4d]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ src/bindings/python/bt2/bt2/native_bt.i | 4 ++--
+ src/bindings/python/bt2/bt2/native_bt_error.i.hpp | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bindings/python/bt2/bt2/native_bt.i b/src/bindings/python/bt2/bt2/native_bt.i
+index 7f8d9f699..1807d8ff6 100644
+--- a/src/bindings/python/bt2/bt2/native_bt.i
++++ b/src/bindings/python/bt2/bt2/native_bt.i
+@@ -56,7 +56,7 @@ typedef uint64_t bt_listener_id;
+ *
+ * We initialize the output parameter `temp_value` to an invalid but non-zero
+ * pointer value. This is to make sure we don't rely on its initial value in
+- * the epilogue (where we call SWIG_Python_str_FromChar). When they fail,
++ * the epilogue (where we call PyUnicode_FromString). When they fail,
+ * functions on which we apply this typemap don't guarantee that the value of
+ * `temp_value` will be unchanged or valid.
+ */
+@@ -67,7 +67,7 @@ typedef uint64_t bt_listener_id;
+ %typemap(argout) (const char **) {
+ if (*$1) {
+ /* SWIG_AppendOutput() steals the created object */
+- $result = SWIG_AppendOutput($result, SWIG_Python_str_FromChar(*$1));
++ $result = SWIG_AppendOutput($result, PyUnicode_FromString(*$1));
+ } else {
+ /* SWIG_AppendOutput() steals Py_None */
+ Py_INCREF(Py_None);
+diff --git a/src/bindings/python/bt2/bt2/native_bt_error.i.hpp b/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+index ba8cef097..2be1e347c 100644
+--- a/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
++++ b/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+@@ -19,7 +19,7 @@ static PyObject *bt_bt2_format_bt_error_cause(const bt_error_cause *error_cause)
+ BT_COMMON_COLOR_WHEN_NEVER);
+ BT_ASSERT(error_cause_str);
+
+- py_error_cause_str = PyString_FromString(error_cause_str);
++ py_error_cause_str = PyUnicode_FromString(error_cause_str);
+
+ g_free(error_cause_str);
+
+@@ -35,7 +35,7 @@ static PyObject *bt_bt2_format_bt_error(const bt_error *error)
+ BT_COMMON_COLOR_WHEN_NEVER);
+ BT_ASSERT(error_str);
+
+- py_error_str = PyString_FromString(error_str);
++ py_error_str = PyUnicode_FromString(error_str);
+
+ g_free(error_str);
+
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb b/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
index 7c151bf729..9962ef377c 100644
--- a/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
+++ b/meta/recipes-kernel/lttng/babeltrace2_2.1.2.bb
@@ -15,6 +15,7 @@ SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.1;protocol=http
file://0001-Make-bt_field_blob_get_length-return-size_t-instead-.patch \
file://external-python-tests.patch \
file://0001-src-explicitly-only-build-shared-plugins.patch \
+ file://0001-bt2-replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch \
"
SRCREV = "d0e946a71faf5f0c2d7f1fb5b92a369983e9cf10"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 3/4] u-boot-tools: fix pylibfdt build with swig 4.5.0
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 1/4] " Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 2/4] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
@ 2026-08-11 13:51 ` Jaipaul Cheernam
2026-08-11 13:52 ` [PATCH v4 4/4] python3-dtc: fix " Jaipaul Cheernam
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 13:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime. Backport the dtc upstream fix to u-boot's bundled
pylibfdt/libfdt.i to replace them with Python 3 equivalents.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...-removed-SWIG-Python-2-compatibility.patch | 55 +++++++++++++++++++
.../u-boot/u-boot-tools_2026.07.bb | 4 +-
2 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
diff --git a/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch b/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
new file mode 100644
index 0000000000..c1d0204e32
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
@@ -0,0 +1,55 @@
+From 886616d03b6afcc5ce8b34e7af91f7ccfbb0a5c Mon Sep 17 00:00:00 2001
+From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+Date: Tue, 11 Aug 2026 13:21:01 +0000
+Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
+
+SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
+from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
+them with their Python 3 C API equivalents:
+
+- PyString_FromString -> PyUnicode_FromString
+- PyString_AsString -> PyBytes_AsString
+- PyInt_AsLong -> PyLong_AsLong
+
+The replacements are safe since the macros were already aliased to
+these exact functions in SWIG's Python 3 code path.
+
+This is a backport of dtc commit 5008d1d6a356 ("pylibfdt: Replace
+removed SWIG Python 2 compatibility macros").
+
+Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/2283713/]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
+index e4659489..326a15c7 100644
+--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
+@@ -1033,7 +1033,7 @@ typedef uint32_t fdt32_t;
+ PyObject *buff;
+
+ if ($1) {
+- resultobj = PyString_FromString(
++ resultobj = PyUnicode_FromString(
+ fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
+ buff = PyByteArray_FromStringAndSize(
+ (const char *)($1 + 1), fdt32_to_cpu($1->len));
+@@ -1064,13 +1064,13 @@ typedef uint32_t fdt32_t;
+ }
+ $1 = PyBytes_AsString($input);
+ %#else
+- $1 = PyString_AsString($input); /* char *str */
++ $1 = PyBytes_AsString($input); /* char *str */
+ %#endif
+ }
+
+ /* typemaps used for fdt_next_node() */
+ %typemap(in, numinputs=1) int *depth (int depth) {
+- depth = (int) PyInt_AsLong($input);
++ depth = (int) PyLong_AsLong($input);
+ $1 = &depth;
+ }
+
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb b/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb
index 9e7a178310..ea90b726c5 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb
@@ -1,4 +1,6 @@
require u-boot-common.inc
require u-boot-tools.inc
-SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch"
+SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch \
+ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \
+ "
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 4/4] python3-dtc: fix build with swig 4.5.0
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
` (2 preceding siblings ...)
2026-08-11 13:51 ` [PATCH v4 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
@ 2026-08-11 13:52 ` Jaipaul Cheernam
3 siblings, 0 replies; 19+ messages in thread
From: Jaipaul Cheernam @ 2026-08-11 13:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Jaipaul Cheernam
SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime. Backport the upstream fix to replace them with
Python 3 equivalents.
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...-removed-SWIG-Python-2-compatibility.patch | 57 +++++++++++++++++++
.../python/python3-dtc_1.8.1.bb | 1 +
2 files changed, 58 insertions(+)
create mode 100644 meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
diff --git a/meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch b/meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
new file mode 100644
index 0000000000..877aea3a8d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-dtc/0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch
@@ -0,0 +1,57 @@
+From 32378d7b4383a79d13da9005035600d8f0c8c29d Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Tue, 29 Jul 2026 05:55:56 +0000
+Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
+
+SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
+from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
+them with their Python 3 C API equivalents:
+
+- PyString_FromString -> PyUnicode_FromString
+- PyString_AsString -> PyBytes_AsString
+- PyInt_AsLong -> PyLong_AsLong
+
+The replacements are safe since the macros were already aliased to
+these exact functions in SWIG's Python 3 code path.
+
+Signed-off-by: Jitka Plesnikova <jplesnik@redhat.com>
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+(cherry picked from commit 5008d1d6a356b8d0a78060da2e1021507d529cff)
+
+Upstream-Status: Backport [https://github.com/dgibson/dtc/commit/5008d1d6a356b8d0a78060da2e1021507d529cff]
+
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ pylibfdt/libfdt.i | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
+index 1f9c0471..b1cb9873 100644
+--- a/pylibfdt/libfdt.i
++++ b/pylibfdt/libfdt.i
+@@ -1136,7 +1136,7 @@ typedef uint32_t fdt32_t;
+ PyObject *buff;
+
+ if ($1) {
+- resultobj = PyString_FromString(
++ resultobj = PyUnicode_FromString(
+ fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
+ buff = PyByteArray_FromStringAndSize(
+ (const char *)($1 + 1), fdt32_to_cpu($1->len));
+@@ -1169,13 +1169,13 @@ typedef uint32_t fdt32_t;
+ }
+ $1 = PyBytes_AsString($input);
+ %#else
+- $1 = PyString_AsString($input); /* char *str */
++ $1 = PyBytes_AsString($input); /* char *str */
+ %#endif
+ }
+
+ /* typemaps used for fdt_next_node() */
+ %typemap(in, numinputs=1) int *depth (int depth) {
+- depth = (int) PyInt_AsLong($input);
++ depth = (int) PyLong_AsLong($input);
+ $1 = &depth;
+ }
+
diff --git a/meta/recipes-devtools/python/python3-dtc_1.8.1.bb b/meta/recipes-devtools/python/python3-dtc_1.8.1.bb
index 51abf3640a..915cd6a730 100644
--- a/meta/recipes-devtools/python/python3-dtc_1.8.1.bb
+++ b/meta/recipes-devtools/python/python3-dtc_1.8.1.bb
@@ -7,6 +7,7 @@ LICENSE = "BSD-2-Clause OR GPL-2.0-only"
DEPENDS = "flex-native bison-native swig-native python3-setuptools-scm-native libyaml dtc"
SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https;tag=v${PV} \
+ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \
"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-08-11 13:56 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 15:45 [PATCH] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-10 21:02 ` [OE-core] " Richard Purdie
2026-08-11 6:12 ` [PATCH v2 0/2] " Jaipaul Cheernam
2026-08-11 6:12 ` [PATCH v2 1/2] " Jaipaul Cheernam
2026-08-11 10:25 ` [OE-core] " Richard Purdie
2026-08-11 11:15 ` Jaipaul Cheernam
2026-08-11 6:12 ` [PATCH v2 2/2] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 1/4] " Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 2/4] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
2026-08-11 11:11 ` [PATCH v3 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
2026-08-11 12:58 ` [OE-core] " Mathieu Dubois-Briand
2026-08-11 13:38 ` Quentin Schulz
2026-08-11 11:11 ` [PATCH v3 4/4] python3-dtc: fix " Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 0/4] swig: upgrade 4.4.1 -> 4.5.0 Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 1/4] " Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 2/4] babeltrace2: fix build with swig 4.5.0 Jaipaul Cheernam
2026-08-11 13:51 ` [PATCH v4 3/4] u-boot-tools: fix pylibfdt " Jaipaul Cheernam
2026-08-11 13:52 ` [PATCH v4 4/4] python3-dtc: fix " Jaipaul Cheernam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.