-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
(Originally sent to swig-user mailing list)
Our conda-forge feedstock received an automatic PR to add PyPy support. Unfortunately, I get a lot of errors when compiling the SWIG wrapper like this:
$SRC_DIR/build/src/swig/CMakeFiles/_stir.dir/stirPYTHON_wrap.cxx:158287:1:
error: too many initializers for 'PyHeapTypeObject' {aka '_heaptypeobject'}
This is with swig 4.0.2 and pypy 3.8. You can find the log at Pipelines - Run 20220414.1 logs (azure.com)
I find the following in the wrapped file (EDIT: generated locally by swig 3.0.12)
#if PY_VERSION_HEX < 0x02030000
typedef struct {
PyTypeObject type;
PyNumberMethods as_number;
PyMappingMethods as_mapping;
PySequenceMethods as_sequence;
PyBufferProcs as_buffer;
PyObject *name, *slots;
} PyHeapTypeObject;
#endif
/// stuff
static PyHeapTypeObject SwigPyBuiltin__swig__SwigPyIterator_type = {
{
#if PY_VERSION_HEX >= 0x03000000
PyVarObject_HEAD_INIT(NULL, 0)
#else
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
#endif
"stir.SwigPyIterator", /* tp_name */
sizeof(SwigPyObject), /* tp_basicsize */
0, /* tp_itemsize */
_wrap_delete_SwigPyIterator_destructor_closure, /* tp_dealloc */
(printfunc) 0, /* tp_print */
(getattrfunc) 0, /* tp_getattr */
/// more stuff
I cannot find any reference to PyHeapTypeObject
but wonder if the #if PY_VERSION_HEX
statements are failing with PyPy.