Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Python 3.11 support #58

Closed
wants to merge 4 commits into from
Closed

WIP: Python 3.11 support #58

wants to merge 4 commits into from

Conversation

antocuni
Copy link
Owner

@antocuni antocuni commented Oct 19, 2021

I opened this PR to check whether capnpy is compatible with python3.11, but it turns out that there are at least two problems:

  1. tox seems to crash; github action output:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.0-alpha.1/x64/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 145, in __makeattr
    modpath, attrname = self.__map__[name]
                        ~~~~~~~~~~~~^^^^^^
KeyError: '__spec__'
  1. I tried to compile it manually on my machine and stumbled upon this Cython issue: [BUG] PyCode_New and PyCode_NewWithPosOnlyArgs are going away in 3.11 cython/cython#4365

@kvelicka
Copy link

Hi.

For sake of documentation: there seems to be another issue, seemingly related to cython/cython#4461. We seem to be building with the newest Cython (0.29.34) which supposedly solves things but doesn't appear to in our case.

      [1/4] Cythonizing capnpy/packing.pyx
      [2/4] Cythonizing capnpy/segment/base.pyx
      [3/4] Cythonizing capnpy/segment/builder.pyx
      [4/4] Cythonizing capnpy/_hash.pyx
      building 'capnpy.segment.base' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/capnpy
      creating build/temp.linux-x86_64-cpython-311/capnpy/segment
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-kyeri00_/capnpy_6c6a984da1bc4a1cb9c15350e1d81411/capnpy -I/pyenv/versions/3.11.2/include/python3.11 -c capnpy/segment/base.c -o build/temp.linux-x86_64-cpython-311/capnpy/segment/base.o -O3
      gcc -pthread -shared -L/pyenv/versions/3.11.2/lib -Wl,-rpath,/pyenv/versions/3.11.2/lib -L/pyenv/versions/3.11.2/lib -Wl,-rpath,/pyenv/versions/3.11.2/lib build/temp.linux-x86_64-cpython-311/capnpy/segment/base.o -L/pyenv/versions/3.11.2/lib -o build/lib.linux-x86_64-cpython-311/capnpy/segment/base.cpython-311-x86_64-linux-gnu.so
      building 'capnpy.segment.segment' extension
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-kyeri00_/capnpy_6c6a984da1bc4a1cb9c15350e1d81411/capnpy -I/pyenv/versions/3.11.2/include/python3.11 -c capnpy/segment/segment.c -o build/temp.linux-x86_64-cpython-311/capnpy/segment/segment.o -O3
      capnpy/segment/segment.c:216:12: fatal error: longintrepr.h: No such file or directory
        216 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

@kvelicka
Copy link

Hi.

For sake of documentation: there seems to be another issue, seemingly related to cython/cython#4461. We seem to be building with the newest Cython (0.29.34) which supposedly solves things but doesn't appear to in our case.

      [1/4] Cythonizing capnpy/packing.pyx
      [2/4] Cythonizing capnpy/segment/base.pyx
      [3/4] Cythonizing capnpy/segment/builder.pyx
      [4/4] Cythonizing capnpy/_hash.pyx
      building 'capnpy.segment.base' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/capnpy
      creating build/temp.linux-x86_64-cpython-311/capnpy/segment
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-kyeri00_/capnpy_6c6a984da1bc4a1cb9c15350e1d81411/capnpy -I/pyenv/versions/3.11.2/include/python3.11 -c capnpy/segment/base.c -o build/temp.linux-x86_64-cpython-311/capnpy/segment/base.o -O3
      gcc -pthread -shared -L/pyenv/versions/3.11.2/lib -Wl,-rpath,/pyenv/versions/3.11.2/lib -L/pyenv/versions/3.11.2/lib -Wl,-rpath,/pyenv/versions/3.11.2/lib build/temp.linux-x86_64-cpython-311/capnpy/segment/base.o -L/pyenv/versions/3.11.2/lib -o build/lib.linux-x86_64-cpython-311/capnpy/segment/base.cpython-311-x86_64-linux-gnu.so
      building 'capnpy.segment.segment' extension
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-kyeri00_/capnpy_6c6a984da1bc4a1cb9c15350e1d81411/capnpy -I/pyenv/versions/3.11.2/include/python3.11 -c capnpy/segment/segment.c -o build/temp.linux-x86_64-cpython-311/capnpy/segment/segment.o -O3
      capnpy/segment/segment.c:216:12: fatal error: longintrepr.h: No such file or directory
        216 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

Resolving this may be as simple as merging https://github.com/antocuni/capnpy/pull/61/files

Increase the minimum cython version to 0.29.30
@wridgers wridgers mentioned this pull request Jul 13, 2023
@wridgers wridgers closed this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants