mosquito / cysystemd

systemd wrapper on Cython
Apache License 2.0
101 stars 21 forks source link

Python 3.11 build fails #57

Closed Cap-JaTu closed 1 year ago

Cap-JaTu commented 1 year ago

pip install systemd==0.16.1 on Python 3.11 explodes with tons of C warnings and errors. Apparently Python ABI changed and none of those changes are yet compensated to this library.

Partial list includes:

      cython_utility: In function ‘__Pyx_ParseOptionalKeywords’:
        652 | static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op)
            |                          ^~~~~~~~~~~~~~~~~~
      cython_utility:524:21: warning: ‘PyUnicode_GET_SIZE’ is deprecated [-Wdeprecated-dec
larations]

      cython_utility: In function ‘__Pyx_CreateCodeObjectForTraceback’:
      cython_utility:786:9: warning: passing argument 14 of ‘PyCode_New’ makes pointer fro
m integer without a cast [-Wint-conversion]
      systemd/_daemon.c:215:72: note: in definition of macro ‘__Pyx_PyCode_New’
        215 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline
, lnos)

      /usr/include/python3.11/cpython/code.h:151:45: note: expected ‘int’ but argument is
of type ‘PyObject *’ {aka ‘struct _object *’}
        151 |         PyObject *, PyObject *, PyObject *, int, PyObject *,
            |                                             ^~~
      systemd/_daemon.c:215:11: error: too few arguments to function ‘PyCode_New’
        215 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline
, lnos)

      cython_utility: In function ‘__Pyx_AddTraceback’:
      systemd/_daemon.c:322:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
        322 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
mosquito commented 1 year ago

@Cap-JaTu the project has been renamed for avoid confisions to cysystemd. The first of all pelase use the lastest version it this.

In thesystemd==0.16.1 python 3.6 has been defined as the last supported version. Why the behaviour just reported above is unexpected?

Of course as a workaround you may install the latest Cython version before installing systemd==0.16.1, this should regen the .c files and probably should fix your problem, but I do not really recommend to do it for your projects.

Cap-JaTu commented 1 year ago

There is tons of confusion.

What you state about version 3.6 is correct. However, in https://github.com/mosquito/cysystemd/blob/master/README.rst there is a mention about 3.10.

Still, by clicking "Homepage" on https://pypi.org/project/systemd/, I'll land to this project. So, I'll assume the issues should be filed here. Did I get that wrong?

mosquito commented 1 year ago

@Cap-JaTu fixed in 0.17.0

Cap-JaTu commented 1 year ago

Thank you very much!

Fix confirmed.