public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/babeltrace2] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
@ 2026-07-28 17:15 Jitka Plesnikova
0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-07-28 17:15 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/babeltrace2
Branch : rawhide
Commit : acc8b53a7583eb9ccdb430561df230206e21285a
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2026-07-28T15:29:18+02:00
Stats : +49/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/babeltrace2/c/acc8b53a7583eb9ccdb430561df230206e21285a?branch=rawhide
Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
---
diff --git a/babeltrace2-swig45.patch b/babeltrace2-swig45.patch
new file mode 100644
index 0000000..8519f4a
--- /dev/null
+++ b/babeltrace2-swig45.patch
@@ -0,0 +1,42 @@
+diff -up babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt_error.i.hpp.swig45 babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt_error.i.hpp
+--- babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt_error.i.hpp.swig45 2026-07-27 17:08:20.369540786 +0200
++++ babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt_error.i.hpp 2026-07-27 17:08:20.373384418 +0200
+@@ -19,7 +19,7 @@ static PyObject *bt_bt2_format_bt_error_
+ 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(
+ 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 -up babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt.i.swig45 babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt.i
+--- babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt.i.swig45 2026-07-27 17:08:20.368540764 +0200
++++ babeltrace2-2.1.2/src/bindings/python/bt2/bt2/native_bt.i 2026-07-27 17:08:20.372876381 +0200
+@@ -62,7 +62,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.
+ */
+@@ -73,7 +73,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/babeltrace2.spec b/babeltrace2.spec
index 339bd54..d4b14cb 100644
--- a/babeltrace2.spec
+++ b/babeltrace2.spec
@@ -1,6 +1,6 @@
Name: babeltrace2
Version: 2.1.2
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: A trace manipulation toolkit
License: MIT AND GPL-2.0-only
URL: https://www.efficios.com/babeltrace
@@ -10,6 +10,9 @@ Source1: https://www.efficios.com/files/babeltrace/babeltrace2-%{version}
Source2: gpgkey-7F49314A26E0DE78427680E05F1B2A0789F12B11.gpg
Patch0: 0001-Fix-bt2.TraceCollectionMessageIterator-avoid-circula.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch1: babeltrace2-swig45.patch
BuildRequires: autoconf >= 2.69
BuildRequires: automake >= 1.13
@@ -123,6 +126,9 @@ rm -f %{buildroot}/%{_pkgdocdir}/std-ext-lib.md
%changelog
+* Mon Jul 27 2026 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.2-10
+- Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
+
* Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 2.1.2-9
- Rebuilt for Python 3.15.0b4 ABI change
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-28 17:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 17:15 [rpms/babeltrace2] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility Jitka Plesnikova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox