Skip to content

PyHeapTypeObject errors with PyPy #2262

@KrisThielemans

Description

@KrisThielemans

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy