public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jitka Plesnikova <jplesnik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/nordugrid-arc] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
Date: Tue, 11 Aug 2026 07:59:04 GMT	[thread overview]
Message-ID: <178643514479.1.12703753943275858052.rpms-nordugrid-arc-c8098325c339@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/nordugrid-arc
Branch : rawhide
Commit : c8098325c3394ae3e4d80de46ca357c797360bdb
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2026-07-28T15:29:18+02:00
Stats  : +118/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/nordugrid-arc/c/c8098325c3394ae3e4d80de46ca357c797360bdb?branch=rawhide

Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility

---
diff --git a/nordugrid-arc-swig45.patch b/nordugrid-arc-swig45.patch
new file mode 100644
index 0000000..df15128
--- /dev/null
+++ b/nordugrid-arc-swig45.patch
@@ -0,0 +1,110 @@
+diff -up nordugrid-arc-7.1.2/src/hed/acc/PythonBroker/PythonBrokerPlugin.cpp.swig45 nordugrid-arc-7.1.2/src/hed/acc/PythonBroker/PythonBrokerPlugin.cpp
+--- nordugrid-arc-7.1.2/src/hed/acc/PythonBroker/PythonBrokerPlugin.cpp.swig45	2026-07-28 10:13:28.445651632 +0200
++++ nordugrid-arc-7.1.2/src/hed/acc/PythonBroker/PythonBrokerPlugin.cpp	2026-07-28 10:13:28.454210671 +0200
+@@ -126,7 +126,7 @@ namespace Arc {
+ #if PY_MAJOR_VERSION >= 3
+     PyObjectP py_arc_module_name = PyUnicode_FromString("arc");
+ #else
+-    PyObjectP py_arc_module_name = PyString_FromString("arc");
++    PyObjectP py_arc_module_name = PyUnicode_FromString("arc");
+ #endif
+     if (!py_arc_module_name) {
+       logger.msg(ERROR, "Cannot convert ARC module name to Python string");
+@@ -201,7 +201,7 @@ namespace Arc {
+ #if PY_MAJOR_VERSION >= 3
+     PyObjectP py_module_name = PyUnicode_FromString(module_name.c_str());
+ #else
+-    PyObjectP py_module_name = PyString_FromString(module_name.c_str());
++    PyObjectP py_module_name = PyUnicode_FromString(module_name.c_str());
+ #endif
+     if (!py_module_name) {
+       logger.msg(ERROR, "Cannot convert module name to Python string");
+diff -up nordugrid-arc-7.1.2/src/services/wrappers/python/pythonwrapper.cpp.swig45 nordugrid-arc-7.1.2/src/services/wrappers/python/pythonwrapper.cpp
+--- nordugrid-arc-7.1.2/src/services/wrappers/python/pythonwrapper.cpp.swig45	2026-07-28 10:13:28.447651675 +0200
++++ nordugrid-arc-7.1.2/src/services/wrappers/python/pythonwrapper.cpp	2026-07-28 10:13:28.455079702 +0200
+@@ -151,7 +151,7 @@ Service_PythonWrapper::Service_PythonWra
+ #if PY_MAJOR_VERSION >= 3
+     py_module_name = PyUnicode_FromString(module_name.c_str());
+ #else
+-    py_module_name = PyString_FromString(module_name.c_str());
++    py_module_name = PyUnicode_FromString(module_name.c_str());
+ #endif
+     if (py_module_name == NULL) {
+         logger.msg(Arc::ERROR, "Cannot convert module name to Python string");
+@@ -172,7 +172,7 @@ Service_PythonWrapper::Service_PythonWra
+ #if PY_MAJOR_VERSION >= 3
+     py_arc_module_name = PyUnicode_FromString("arc");
+ #else
+-    py_arc_module_name = PyString_FromString("arc");
++    py_arc_module_name = PyUnicode_FromString("arc");
+ #endif
+     if (py_arc_module_name == NULL) {
+         logger.msg(Arc::ERROR, "Cannot convert ARC module name to Python string");
+diff -up nordugrid-arc-7.1.2/swig/Arc.i.swig45 nordugrid-arc-7.1.2/swig/Arc.i
+--- nordugrid-arc-7.1.2/swig/Arc.i.swig45	2026-07-28 10:13:28.449651717 +0200
++++ nordugrid-arc-7.1.2/swig/Arc.i	2026-07-28 10:13:28.456239355 +0200
+@@ -90,7 +90,7 @@ class StaticPropertyWrapper(object):
+ %typemap(in) time_t
+ {
+   if      (PyLong_Check($input))  $1 = (time_t) PyLong_AsLong($input);
+-  else if (PyInt_Check($input))   $1 = (time_t) PyInt_AsLong($input);
++  else if (PyLong_Check($input))   $1 = (time_t) PyLong_AsLong($input);
+   else if (PyFloat_Check($input)) $1 = (time_t) PyFloat_AsDouble($input);
+   else {
+     PyErr_SetString(PyExc_TypeError,"Expected a large type");
+@@ -107,7 +107,7 @@ class StaticPropertyWrapper(object):
+ 
+ %typemap(in) uint32_t
+ {
+-  if      (PyInt_Check($input))   $1 = (uint32_t) PyInt_AsLong($input);
++  if      (PyLong_Check($input))   $1 = (uint32_t) PyLong_AsLong($input);
+   else if (PyFloat_Check($input)) $1 = (uint32_t) PyFloat_AsDouble($input);
+   else {
+     PyErr_SetString(PyExc_TypeError,"Unable to convert type to 32bit number (int/float)");
+@@ -118,7 +118,7 @@ class StaticPropertyWrapper(object):
+ 
+ %typemap(out) uint32_t
+ {
+-  $result = PyInt_FromLong((int)$1);
++  $result = PyLong_FromLong((int)$1);
+ }
+ #endif
+ 
+diff -up nordugrid-arc-7.1.2/swig/data.i.swig45 nordugrid-arc-7.1.2/swig/data.i
+--- nordugrid-arc-7.1.2/swig/data.i.swig45	2026-07-28 10:13:28.450651739 +0200
++++ nordugrid-arc-7.1.2/swig/data.i	2026-07-28 10:13:28.456694868 +0200
+@@ -121,10 +121,10 @@ typedef struct {
+ 
+ %typemap(out) Arc::DataBufferForWriteResult {
+   $result = PyTuple_New(5);
+-  PyTuple_SetItem($result,0,PyInt_FromLong($1.result));
+-  PyTuple_SetItem($result,1,PyInt_FromLong($1.handle));
+-  PyTuple_SetItem($result,2,PyInt_FromLong($1.size));
+-  PyTuple_SetItem($result,3,PyInt_FromLong($1.offset));
++  PyTuple_SetItem($result,0,PyLong_FromLong($1.result));
++  PyTuple_SetItem($result,1,PyLong_FromLong($1.handle));
++  PyTuple_SetItem($result,2,PyLong_FromLong($1.size));
++  PyTuple_SetItem($result,3,PyLong_FromLong($1.offset));
+ %#if PY_VERSION_HEX>=0x03000000
+   PyTuple_SetItem($result,4,$1.buffer?PyUnicode_FromStringAndSize($1.buffer,$1.size):Py_None);
+ %#else
+@@ -133,7 +133,7 @@ typedef struct {
+ }
+ 
+ %typemap(out) Arc::DataBufferForReadResult {
+-  $result = PyTuple_Pack(3, PyInt_FromLong($1.result), PyInt_FromLong($1.handle), PyInt_FromLong($1.size));
++  $result = PyTuple_Pack(3, PyLong_FromLong($1.result), PyLong_FromLong($1.handle), PyLong_FromLong($1.size));
+ }
+ 
+ %typemap(in) (char* DataBufferIsReadBuf, unsigned int DataBufferIsReadSize) {
+@@ -142,8 +142,8 @@ typedef struct {
+   $1 = PyBytes_AsString($input);
+   $2 = ($1)?PyBytes_Size($input):0;
+ %#else
+-  $1 = PyString_AsString($input);
+-  $2 = ($1)?PyString_Size($input):0;
++  $1 = PyBytes_AsString($input);
++  $2 = ($1)?PyBytes_Size($input):0;
+ %#endif
+ }
+ 

diff --git a/nordugrid-arc.spec b/nordugrid-arc.spec
index df1c153..13bb470 100644
--- a/nordugrid-arc.spec
+++ b/nordugrid-arc.spec
@@ -23,7 +23,7 @@
 
 Name:		nordugrid-arc
 Version:	7.1.2
-Release:	6%{?dist}
+Release:	7%{?dist}
 Summary:	Advanced Resource Connector Middleware
 #		Apache-2.0: most files
 #		MIT: src/external/cJSON/cJSON.c src/external/cJSON/cJSON.h
@@ -38,6 +38,9 @@ Patch0:		0001-Handle-Python-multi-phase-initialization-support-in-.patch
 Patch1:		0001-Fix-compilation-with-Python-3.15.patch
 #		https://source.coderefinery.org/nordugrid/arc/-/merge_requests/1997
 Patch2:		0001-Support-OpenSSL-4.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch3:		nordugrid-arc-swig45.patch
 
 #		Packages dropped without replacements
 Obsoletes:	%{name}-arcproxyalt < 6.0.0
@@ -562,6 +565,7 @@ publishes metrics about jobs and datastaging on the ARC-CE.
 %patch -P0 -p1
 %patch -P1 -p1
 %patch -P2 -p1
+%patch -P3 -p1
 
 %build
 autoreconf -v -f -i
@@ -1140,6 +1144,9 @@ semanage fcontext -a -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null
 %{_sbindir}/arc-exporter
 
 %changelog
+* Tue Jul 28 2026 Jitka Plesnikova <jplesnik@redhat.com> - 7.1.2-7
+- Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 7.1.2-6
 - Rebuilt for Python 3.15.0b4 ABI change
 

                 reply	other threads:[~2026-08-11  7:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=178643514479.1.12703753943275858052.rpms-nordugrid-arc-c8098325c339@fedoraproject.org \
    --to=jplesnik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

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

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