Re: PyHeapTypeObject errors with PyPy

<[email protected]> Mon, 18 Apr 2022 20:33:07 +0100
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>
Thanks William

 

I've created PyHeapTypeObject errors with PyPy · Issue #2262 · swig/swig (github.com) <https://github.com/swig/swig/issues/2262>  with more information.

 

Kris

 

From: William S Fulton <[email protected]> 
Sent: 17 April 2022 17:44
To: [email protected]
Cc: swig-user <[email protected]>
Subject: Re: [Swig-user] PyHeapTypeObject errors with PyPy

 

Can you try with master please? There is one fix since 4.0.2 was released that looks like it might be relevant: https://github.com/swig/swig/pull/1843.

 

William

 

On Fri, 15 Apr 2022 at 16:14, <[email protected] <mailto:[email protected]> > wrote:

Hi

 

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) <https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=492070&view=logs&j=4f922444-fdfe-5dcf-b824-02f86439ef14&t=b2a8456a-fb11-5506-ca32-5ccd32538dc0&l=6141> 

 

I find the following in the wrapped file

 

 

#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 */

    /// more stuff

 

 

I cannot find any reference to PyHeapTypeObject but wonder if the #if PY_VERSION_HEX statements are failing with PyPy.

 

Anyone any suggestions?

 

Thanks a lot

 

Kris

 

_______________________________________________
Swig-user mailing list
[email protected] <mailto:[email protected]> 
https://lists.sourceforge.net/lists/listinfo/swig-user

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user