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

3.13 support #698

Closed
Tinche opened this issue Jun 1, 2024 · 14 comments · Fixed by #711
Closed

3.13 support #698

Tinche opened this issue Jun 1, 2024 · 14 comments · Fixed by #711

Comments

@Tinche
Copy link

Tinche commented Jun 1, 2024

Howdy!

I'm trying to test cattrs on Python 3.13 (beta1). I've added a msgspec converter in the next version so now we optionally depend on msgspec, which means I can't test on 3.13 until you support it. ;)

The installation seems to be failing in GCC: https://github.com/python-attrs/cattrs/actions/runs/9333591881/job/25690767935

msgspec/_core.c:11254:15: error: too few arguments to function 
  ‘_PyLong_AsByteArray’
  11254 |     int out = _PyLong_AsByteArray((PyLongObject *)int128, buf, 16, 0, 
  0);
        |               ^~~~~~~~~~~~~~~~~~~
  In file included from 
  /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/include/python3.13/longobject.h:10
  7,
                   from 
  /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/include/python3.13/Python.h:72,
                   from msgspec/_core.c:9:
  /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/include/python3.13/cpython/longobj
  ect.h:99:17: note: declared here
     99 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
        |                 ^~~~~~~~~~~~~~~~~~~
  error: command '/usr/bin/gcc' failed with exit code 1
@max-muoto
Copy link

max-muoto commented Jun 11, 2024

@jcrist Put up a PR attempting to fix this if you can run the CI pipeline: #703

@mgorny
Copy link

mgorny commented Jul 12, 2024

With that PR applied (and fixed locally), I'm getting another error (with 3.13.0b3):

2024-07-12 20:56:32,621 root INFO x86_64-pc-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -march=znver2 --param=l1-cache-size=32 --
param=l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches -UNDEBUG -fPIC -I/usr/include/python3.13 -c msgspec/_core.c -o /tmp/portage
/dev-python/msgspec-0.18.6/work/msgspec-0.18.6-python3_13/build/temp.linux-x86_64-cpython-313/msgspec/_core.o
msgspec/_core.c: In function ‘find_keyword’:
msgspec/_core.c:501:13: error: implicit declaration of function ‘_PyUnicode_EQ’; did you mean ‘PyUnicode_New’? [-Wimplicit-function-dec
laration]
  501 |         if (_PyUnicode_EQ(kwname, key)) {
      |             ^~~~~~~~~~~~~
      |             PyUnicode_New
msgspec/_core.c: In function ‘typenode_collect_convert_structs’:
msgspec/_core.c:4453:12: error: implicit declaration of function ‘_PySet_NextEntry’ [-Wimplicit-function-declaration]
 4453 |     while (_PySet_NextEntry(state->structs_set, &set_pos, &set_item, &set_hash)) {
      |            ^~~~~~~~~~~~~~~~
error: command '/usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc' failed with exit code 1

@rosset
Copy link

rosset commented Aug 6, 2024

fails to build with Python 3.13.0rc1 (Fedora)

copying msgspec/py.typed -> build/lib.linux-x86_64-cpython-313/msgspec
UPDATING build/lib.linux-x86_64-cpython-313/msgspec/_version.py
set build/lib.linux-x86_64-cpython-313/msgspec/_version.py to '0.18.6'
running build_ext
building 'msgspec._core' extension
creating build/temp.linux-x86_64-cpython-313
creating build/temp.linux-x86_64-cpython-313/msgspec
gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -O3 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -I/usr/include/python3.13 -c msgspec/_core.c -o build/temp.linux-x86_64-cpython-313/msgspec/_core.o
msgspec/_core.c: In function ‘find_keyword’:
msgspec/_core.c:500:13: error: implicit declaration of function ‘_PyUnicode_EQ’; did you mean ‘PyUnicode_New’? [-Wimplicit-function-declaration]
500 | if (_PyUnicode_EQ(kwname, key)) {
| ^~~~~~~~~~~~~
| PyUnicode_New
msgspec/_core.c: In function ‘typenode_collect_convert_structs’:
msgspec/_core.c:4452:12: error: implicit declaration of function ‘_PySet_NextEntry’ [-Wimplicit-function-declaration]
4452 | while (_PySet_NextEntry(state->structs_set, &set_pos, &set_item, &set_hash)) {
| ^~~~~~~~~~~~~~~~
msgspec/_core.c: In function ‘ms_uuid_to_16_bytes’:
msgspec/_core.c:11254:15: error: too few arguments to function ‘_PyLong_AsByteArray’
11254 | int out = _PyLong_AsByteArray((PyLongObject )int128, buf, 16, 0, 0);
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.13/longobject.h:107,
from /usr/include/python3.13/Python.h:77,
from msgspec/_core.c:9:
/usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject
v,
| ^~~~~~~~~~~~~~~~~~~
error: command '/usr/lib64/ccache/gcc' failed with exit code 1
error: subprocess-exited-with-error

× Building wheel for msgspec (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for msgspec (pyproject.toml): finished with status 'error'
Failed to build msgspec
full command: /usr/bin/python3 /usr/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /builddir/build/BUILD/python-msgspec-0.18.6-build/msgspec-0.18.6/.pyproject-builddir/tmpan89ffv8
cwd: /builddir/build/BUILD/python-msgspec-0.18.6-build/msgspec-0.18.6
ERROR: Failed building wheel for msgspec
ERROR: Failed to build one or more wheels

@edgarrmondragon
Copy link
Contributor

@rosset can you give #711 a try?

@ofek
Copy link
Contributor

ofek commented Sep 18, 2024

Has there been any progress on this?

@mgorny
Copy link

mgorny commented Sep 18, 2024

I can confirm that with #711 as it is now, I can get it to build successfully and pass all tests on 3.13.0rc2.

@marvin8
Copy link

marvin8 commented Oct 21, 2024

Do you plan on releasing a new version or should this fix work without needing a new release?

@edgarrmondragon
Copy link
Contributor

Do you plan on releasing a new version or should this fix work without needing a new release?

@marvin8 You can use the fix in #711 already by installing from GitHub:

pip install git+https://github.com/jcrist/msgspec.git@main

@marvin8
Copy link

marvin8 commented Oct 22, 2024

Thank you... not really what I was asking though. 😄

I'll wait for your next release then.

@Tishka17
Copy link

Tishka17 commented Nov 9, 2024

Any chances?

@Etherdrake
Copy link

Etherdrake commented Dec 5, 2024

Thank you @edgarrmondragon. Hope this can get fixed in the next release though.

@montsamu
Copy link

Do you plan on releasing a new version or should this fix work without needing a new release?

@marvin8 You can use the fix in #711 already by installing from GitHub:

pip install git+https://github.com/jcrist/msgspec.git@main

Trying this, I instead encounter a different set of warnings and (more importantly) an error:


      x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/samont/Projects/github.com/montsamu/primamateria/venv/include -I/usr/include/python3.13t -c msgspec/_core.c -o build/temp.linux-x86_64-cpython-313t/msgspec/_core.o
      msgspec/_core.c:2150:5: warning: braces around scalar initializer
       2150 |     { MS_IMMORTAL_INITIAL_REFCNT },
            |     ^
      msgspec/_core.c:2150:5: note: (near initialization for ‘_NoDefault_Object.ob_tid’)
      msgspec/_core.c:2151:5: warning: initialization of ‘short unsigned int’ from ‘PyTypeObject *’ {aka ‘struct _typeobject *’} makes integer from pointer without a cast [-Wint-conversion]
       2151 |     &NoDefault_Type
            |     ^
      msgspec/_core.c:2151:5: note: (near initialization for ‘_NoDefault_Object._padding’)
      msgspec/_core.c:2151:5: error: initializer element is not computable at load time
      msgspec/_core.c:2151:5: note: (near initialization for ‘_NoDefault_Object._padding’)
      msgspec/_core.c:2254:5: warning: braces around scalar initializer
       2254 |     { MS_IMMORTAL_INITIAL_REFCNT },
            |     ^
      msgspec/_core.c:2254:5: note: (near initialization for ‘_Unset_Object.ob_tid’)
      msgspec/_core.c:2255:5: warning: initialization of ‘short unsigned int’ from ‘PyTypeObject *’ {aka ‘struct _typeobject *’} makes integer from pointer without a cast [-Wint-conversion]
       2255 |     &Unset_Type
            |     ^
      msgspec/_core.c:2255:5: note: (near initialization for ‘_Unset_Object._padding’)
      msgspec/_core.c:2255:5: error: initializer element is not computable at load time
      msgspec/_core.c:2255:5: note: (near initialization for ‘_Unset_Object._padding’)
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

@edgarrmondragon
Copy link
Contributor

@montsamu building on free-threaded is not supported (#744). Can you try vanilla Python 3.13?

@montsamu
Copy link

@montsamu building on free-threaded is not supported (#744). Can you try vanilla Python 3.13?

My mistake, yes it works fine under vanilla 3.13 when I tried it. Thank you.

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 a pull request may close this issue.

10 participants