#1145040 casadi: FTBFS with swig 4.5.0

Package:
src:casadi
Source:
src:casadi
Submitter:
Rafael Laboissière
Date:
2026-10-06 16:37:03 UTC
Severity:
normal
Tags:
#1145040#5
Date:
2026-08-21 16:37:10 UTC
From:
To:
Dear Maintainer,

The casadi package FTBFS with swig 4.5.0, which is currently in unstable. An excerpt of the build log is shown below.

This is due to the removal of the Python 2 compatibility macros in version 4.5.0. According to the SWIG authors, these macros were retained in the generated code (pyhead.swg) solely for user typemaps. Any typemap using these macros must be updated to call the Python 3 C API directly.

Best,

Rafael Laboissière

##### Build log excerpt

[ 60%] Building CXX object casadi/solvers/CMakeFiles/casadi_conic_ipqp.dir/ipqp_meta.cpp.o
cd <<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/casadi/solvers && /usr/bin/x86_64-linux-gnu-g++ -DCASADI_DEFAULT_COMPILER_PLUGIN=shell -DCASADI_IS_RELEASE=1 -DCASADI_MAJOR_VERSION=3 -DCASADI_MINOR_VERSION
=7 -DCASADI_PATCH_VERSION=2 -DCASADI_SNPRINTF=snprintf -DCASADI_VERSION=31 -DHAVE_MKSTEMPS -DUSE_CXX11 -DWITH_DEEPBIND -DWITH_DEPRECATED_FEATURES -DWITH_DL -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -Dcasadi_
conic_ipqp_EXPORTS -I<<BUILD-DIR>>/casadi-3.7.2+ds2/. -I<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu -I<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/casadi/core/runtime -I<<BUILD-DIR>>/casadi-3.7.2+
ds2/casadi/core/../.. -I<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/casadi/core/../.. -g -O2 -ffile-prefix-map=<<BUILD-DIR>>/casadi-3.7.2+ds2=. -fstack-protector-strong -fstack-clash-protection -Wformat
-Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC  -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT casadi/solvers/CMakeFiles/casadi_conic_ipqp.dir/ipqp_meta.cpp.o -MF CM
akeFiles/casadi_conic_ipqp.dir/ipqp_meta.cpp.o.d -o CMakeFiles/casadi_conic_ipqp.dir/ipqp_meta.cpp.o -c <<BUILD-DIR>>/casadi-3.7.2+ds2/casadi/solvers/ipqp_meta.cpp
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘PyObject* casadi::full(const DM&, bool)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:5591:31: error: ‘PyString_FromString’ was not declared in this scope; did you mean ‘PyLong_FromString’?
 5591 |       PyObject *method_name = PyString_FromString("toarray");
      |                               ^~~~~~~~~~~~~~~~~~~
      |                               PyLong_FromString
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘PyObject* casadi::get_Python_helper(const std::string&)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:5644:26: error: ‘PyString_FromString’ was not declared in this scope; did you mean ‘PyLong_FromString’?
 5644 |       PyObject* c_name = PyString_FromString("casadi");
      |                          ^~~~~~~~~~~~~~~~~~~
      |                          PyLong_FromString
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘bool casadi::to_ptr(PyObject*, std::vector<T>**)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:30: error: there are no arguments to ‘PyString_Check’ that depend on a template parameter, so a declaration of ‘PyString_Check’
 must be available [-Wtemplate-body]
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ^~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘bool casadi::to_ptr(PyObject*, std::string**)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6480:11: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6480 |       if (PyString_Check(p) || PyUnicode_Check(p)) {
      |           ^~~~~~~~~~~~~~
      |           PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘PyObject* casadi::from_ptr(const std::string*)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6515:14: error: ‘PyString_FromString’ was not declared in this scope; did you mean ‘PyLong_FromString’?
 6515 |       return PyString_FromString(a->c_str());
      |              ^~~~~~~~~~~~~~~~~~~
      |              PyLong_FromString
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘bool casadi::to_ptr(PyObject*, Slice**)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6539:11: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 6539 |       if (PyInt_Check(p)) {
      |           ^~~~~~~~~~~
      |           PySet_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6541:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 6541 |           (**m).start = PyInt_AsLong(p);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6552:56: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 6552 |             ? std::numeric_limits<casadi_int>::min() : PyInt_AsLong(r->start);
      |                                                        ^~~~~~~~~~~~
      |                                                        PyLong_AsLong
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In function ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**)’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:17: error: there are no arguments to ‘PyString_Check’ that depend on a template parameter, so a declaration of ‘PyString_Check’
 must be available [-Wtemplate-body]
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ^~~~~~~~~~~~~~
[ 61%] Building CXX object casadi/solvers/CMakeFiles/casadi_nlpsol_qrsqp.dir/qrsqp_meta.cpp.o
cd <<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/casadi/solvers && /usr/bin/x86_64-linux-gnu-g++ -DCASADI_DEFAULT_COMPILER_PLUGIN=shell -DCASADI_IS_RELEASE=1 -DCASADI_MAJOR_VERSION=3 -DCASADI_MINOR_VERSION
=7 -DCASADI_PATCH_VERSION=2 -DCASADI_SNPRINTF=snprintf -DCASADI_VERSION=31 -DHAVE_MKSTEMPS -DUSE_CXX11 -DWITH_DEEPBIND -DWITH_DEPRECATED_FEATURES -DWITH_DL -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -Dcasadi_
nlpsol_qrsqp_EXPORTS -I<<BUILD-DIR>>/casadi-3.7.2+ds2/. -I<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu -I<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/casadi/core/runtime -I<<BUILD-DIR>>/casadi-3.7.
2+ds2/casadi/core/../.. -I<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/casadi/core/../.. -g -O2 -ffile-prefix-map=<<BUILD-DIR>>/casadi-3.7.2+ds2=. -fstack-protector-strong -fstack-clash-protection -Wforma
t -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC  -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT casadi/solvers/CMakeFiles/casadi_nlpsol_qrsqp.dir/qrsqp_meta.cpp.o -
MF CMakeFiles/casadi_nlpsol_qrsqp.dir/qrsqp_meta.cpp.o.d -o CMakeFiles/casadi_nlpsol_qrsqp.dir/qrsqp_meta.cpp.o -c <<BUILD-DIR>>/casadi-3.7.2+ds2/casadi/solvers/qrsqp_meta.cpp
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = long long int; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:11657:22:   required from here
11657 |   if (!casadi::to_ptr(swig_obj[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = bool; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:16475:22:   required from here
16475 |   if (!casadi::to_ptr(swig_obj[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "[" "bool" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**) [with M = GenericType; PyObje
ct = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:17021:24:   required from here
17021 |     if (!casadi::to_ptr(swig_obj[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "dict" "'.");
      |          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:31: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ~~~~~~~~~~~~~~^~~~~
      |                 PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = double; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:18763:22:   required from here
18763 |   if (!casadi::to_ptr(swig_obj[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "float" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = Matrix<double>; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:25350:22:   required from here
25350 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "DM" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = SXElem; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:28209:22:   required from here
28209 |   if (!casadi::to_ptr(swig_obj[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "SXElem" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = Matrix<SXElem>; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:30132:22:   required from here
30132 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "SX" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = MX; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:34506:22:   required from here
34506 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "MX" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = std::__cxx11::basic_string<char>; PyObject = _objec
t]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:38233:22:   required from here
38233 |   if (!casadi::to_ptr(swig_obj[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "str" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**) [with M = Matrix<SXElem>; PyO
bject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:38274:22:   required from here
38274 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "dict" ":" "SX" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:31: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ~~~~~~~~~~~~~~^~~~~
      |                 PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**) [with M = MX; PyObject = _obj
ect]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:38403:22:   required from here
38403 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "dict" ":" "MX" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:31: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ~~~~~~~~~~~~~~^~~~~
      |                 PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = Sparsity; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:38499:22:   required from here
38499 |   if (!casadi::to_ptr(swig_obj[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "Sparsity" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**) [with M = std::vector<std::__
cxx11::basic_string<char> >; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:40899:24:   required from here
40899 |     if (!casadi::to_ptr(swig_obj[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "dict" ":" "[" "str" "]" "'.");
      |          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:31: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ~~~~~~~~~~~~~~^~~~~
      |                 PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**) [with M = Matrix<double>; PyO
bject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:41831:22:   required from here
41831 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "dict" ":" "DM" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:31: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ~~~~~~~~~~~~~~^~~~~
      |                 PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = Function; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:42977:22:   required from here
42977 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "Function" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::map<std::__cxx11::basic_string<char>, T2>**) [with M = Sparsity; PyObject
= _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:48392:22:   required from here
48392 |   if (!casadi::to_ptr(swig_obj[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "dict" ":" "Sparsity" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6579:31: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6579 |           if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
      |                 ~~~~~~~~~~~~~~^~~~~
      |                 PyMapping_Check
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx: In instantiation of ‘bool casadi::to_ptr(PyObject*, std::vector<T>**) [with M = GenericType; PyObject = _object]’:
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:95754:22:   required from here
95754 |   if (!casadi::to_ptr(swig_obj[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "GenericType" "]" "'.");
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
<<BUILD-DIR>>/casadi-3.7.2+ds2/obj-x86_64-linux-gnu/swig/casadiPYTHON_wrap.cxx:6204:44: error: ‘PyString_Check’ was not declared in this scope; did you mean ‘PyMapping_Check’?
 6204 |       if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
      |                              ~~~~~~~~~~~~~~^~~
      |                              PyMapping_Check

#1145040#10
Date:
2026-08-21 18:30:42 UTC
From:
To:
I proposed a patch for fixing the issue as a merge request at Salsa:
https://salsa.debian.org/science-team/casadi/-/merge_requests/1

Best,

Rafael Laboissière

#1145040#19
Date:
2026-09-09 20:30:37 UTC
From:
To:
user debian-python@lists.debian.org
usertags 1145040 python3.15
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].

I had to make a few changes to get the package back to a healthy state.
- I applied upstream's commit 28f0910 [2]: Python: stop relying on
   SWIG's removed Py2 compat macros [ci:run_slow]. This is a different
   patch than the one proposed by Rafael, more invasive but as it's
   already applied upstream it makes sense to use that one.
- The package repository was missing the `debian/*.install` files, so I
   added those
- And I had to also add a missing python3-numpy dependency.

I've applied these fixes in the sandbox [3] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/TODO/
[2]: https://github.com/casadi/casadi/commit/28f0910eedc41861e8544d4c7590b67f934dd57c
[3]: https://debusine.debian.net/debian/r-python-python3.15/

#1145040#24
Date:
2026-10-06 16:34:52 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
casadi, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1145040@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Roland Mas <lolando@debian.org> (supplier of updated casadi package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 06 Oct 2026 18:00:26 +0200
Source: casadi
Architecture: source
Version: 3.8.1+ds2-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Roland Mas <lolando@debian.org>
Closes: 1145040
Changes:
 casadi (3.8.1+ds2-1) unstable; urgency=medium
 .
   * New upstream release + include a fix backported from upstream.
   * Bug fix: "FTBFS with swig 4.5.0", thanks to Rafael Laboissière
     (Closes: #1145040).
Checksums-Sha1:
 41ea556900a749bc7f701cd240ec82ab199cf48c 2367 casadi_3.8.1+ds2-1.dsc
 82d593c025ea88ddaf8e242f45a2aef0cf4f2bd2 2375572 casadi_3.8.1+ds2.orig.tar.xz
 0d14aa9787cde3cc1a3631b923cd6875cadf8135 6892 casadi_3.8.1+ds2-1.debian.tar.xz
 f676721dfa127ce7157ec599aea9fe0e70b33b74 14164 casadi_3.8.1+ds2-1_amd64.buildinfo
Checksums-Sha256:
 49df1ed5b09eb0cd534bbed95265ea0bc29fb8e9c47128e428084bcefc759e18 2367 casadi_3.8.1+ds2-1.dsc
 58b5597bb83ca39631af6ed2cb2b0a538c63f2d824a015f32b309c2f503a12e5 2375572 casadi_3.8.1+ds2.orig.tar.xz
 d9b1fc187c0159a7b80d5161cb882671bef639e464d09bb6076a13cc4eb06a4b 6892 casadi_3.8.1+ds2-1.debian.tar.xz
 d5d21d349e46683c1f0d1a65f71b641a9c15a84ae60af5048ea918d9952b1897 14164 casadi_3.8.1+ds2-1_amd64.buildinfo
Files:
 7ce287a41a8a5f4db7542db29387d24a 2367 science optional casadi_3.8.1+ds2-1.dsc
 4f4f97470f32bb76473c41891551b995 2375572 science optional casadi_3.8.1+ds2.orig.tar.xz
 1df9d0e93e71919bb029428b9f8c78dc 6892 science optional casadi_3.8.1+ds2-1.debian.tar.xz
 d0c738395fdf4cfd94014f4e968c5ea2 14164 science optional casadi_3.8.1+ds2-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEtBU2D1kett1zr/uD0w3s0lmTIvwFAmrFHREACgkQ0w3s0lmT
IvzE+Q/7Bj90vaTcfdS4E4cbMUIJpdRIS+6OUvjfeoqvhN6UpUU4E9Ak8LbyKG7H
XwPYRGvGgR5a91nz4ZqzxyjJ1ladADgPXB9tiNfKIz2Nnb/j+TR5tzIRYPpICw1R
pqqfZnbujvpqLklefqqGR9MbKQuZ4ZAw+tNeFt7mIJb6xMyWQhfNxVIQ7VRXcTVW
Tm8dEFaeMk9t63ZXjgpG99qwqoCHvATGycWmt9OAHKzG7MrH5xlqqcT8hXhFncPx
51rMObz3HH7trtdLKsanl4NbXHGDVf1rgw1jDCA8iAjrCHb1PSJxYeLi0+OwJ2bU
n4kwq/Zb+6wGrXv3Uod/jJxz/ujsecUGK24cO325M3sNum12XtgIZ3ARvsUcbl3b
7+wOYo5+AQmRi2C9bHyK8DKyi7CUSJCNYu5qMZkCNmtSuYNN9LpzQrijjMFVAKCB
AiO4sfVSnqEWEj1iaEz+xZMyLOYgfhyIIuima8v/VjdJCnMnX1hncJtrY7UluCrz
SoLdNNBOpZbxH4DX6aLFyWoVBa539rW4BDCL/ijeEi3GB24zg8xLRb2zIUiww7/I
13uwas64bhEsw5pMeWCbO/JItDOyHbj9uIqm/BgNbd/joedRH4v6E/WYlWuvWwPe
0alsNIEbl+mJYhDMPdV4p3Dcb9J5/xkBQ+sfJS9st3lsRso0pNE=
=bGSa
-----END PGP SIGNATURE-----