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

Port for use with Python 3.13 free-threaded build? #187

Open
smontanaro opened this issue Nov 2, 2024 · 1 comment
Open

Port for use with Python 3.13 free-threaded build? #187

smontanaro opened this issue Nov 2, 2024 · 1 comment

Comments

@smontanaro
Copy link

I'm trying to build/install Jupyter with a free-threaded build of Python 3.13. The compile fails because _ffi.c (I think) uses the limited API, which isn't supported in the free-threaded build. Details about porting code for free-threading are here:

https://py-free-threading.github.io/porting/#limited-api-support

Any chance this could be worked into argon2-cffi?

      running build_ext
      generating cffi module 'build/temp.macosx-15.1-arm64-cpython-313t/_ffi.c'
      creating build/temp.macosx-15.1-arm64-cpython-313t
      building '_ffi' extension
      creating build/temp.macosx-15.1-arm64-cpython-313t/build/temp.macosx-15.1-arm64-cpython-313t
      creating build/temp.macosx-15.1-arm64-cpython-313t/extras/libargon2/src
      creating build/temp.macosx-15.1-arm64-cpython-313t/extras/libargon2/src/blake2
      clang-18 -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -Iextras/libargon2/include -I/Users/skip/py3.13/include -I/Users/skip/.local/include/python3.13t -c build/temp.macosx-15.1-arm64-cpython-313t/_ffi.c -o build/temp.macosx-15.1-arm64-cpython-313t/build/temp.macosx-15.1-arm64-cpython-313t/_ffi.o
      In file included from build/temp.macosx-15.1-arm64-cpython-313t/_ffi.c:57:
      /Users/skip/.local/include/python3.13t/Python.h:51:4: error: "The limited API is not currently supported in the free-threaded build"
         51 | #  error "The limited API is not currently supported in the free-threaded build"
            |    ^
      In file included from build/temp.macosx-15.1-arm64-cpython-313t/_ffi.c:57:
      In file included from /Users/skip/.local/include/python3.13t/Python.h:72:
      /Users/skip/.local/include/python3.13t/object.h:213:5: error: unknown type name 'PyMutex'
        213 |     PyMutex ob_mutex;           // per-object lock
            |     ^
      /Users/skip/.local/include/python3.13t/object.h:320:22: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        320 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local);
            |                      ^
      /Users/skip/.local/include/python3.13t/object.h:324:25: error: call to undeclared function '_Py_atomic_load_ssize_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        324 |     Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared);
            |                         ^
      /Users/skip/.local/include/python3.13t/object.h:358:13: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        358 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
            |             ^
      /Users/skip/.local/include/python3.13t/object.h:358:63: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
        358 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
        359 |             _Py_IMMORTAL_REFCNT_LOCAL);
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/skip/.local/include/python3.13t/object.h:396:9: error: call to undeclared function '_Py_IsOwnedByCurrentThread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        396 |     if (_Py_IsOwnedByCurrentThread(ob)) {
            |         ^
      /Users/skip/.local/include/python3.13t/object.h:436:5: error: call to undeclared function '_Py_atomic_store_ssize_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        436 |     _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);
            |     ^
      /Users/skip/.local/include/python3.13t/object.h:810:22: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        810 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
            |                      ^
      /Users/skip/.local/include/python3.13t/object.h:816:9: error: call to undeclared function '_Py_IsOwnedByCurrentThread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        816 |     if (_Py_IsOwnedByCurrentThread(op)) {
            |         ^
      /Users/skip/.local/include/python3.13t/object.h:817:9: error: call to undeclared function '_Py_atomic_store_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        817 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, new_local);
            |         ^
      /Users/skip/.local/include/python3.13t/object.h:820:9: error: call to undeclared function '_Py_atomic_add_ssize'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        820 |         _Py_atomic_add_ssize(&op->ob_ref_shared, (1 << _Py_REF_SHARED_SHIFT));
            |         ^
      /Users/skip/.local/include/python3.13t/object.h:904:22: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        904 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
            |                      ^
      /Users/skip/.local/include/python3.13t/object.h:909:9: error: call to undeclared function '_Py_IsOwnedByCurrentThread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        909 |     if (_Py_IsOwnedByCurrentThread(op)) {
            |         ^
      /Users/skip/.local/include/python3.13t/object.h:911:9: error: call to undeclared function '_Py_atomic_store_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        911 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, local);
            |         ^
      /Users/skip/.local/include/python3.13t/object.h:913:13: error: call to undeclared function '_Py_MergeZeroLocalRefcount'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        913 |             _Py_MergeZeroLocalRefcount(op);
            |             ^
      /Users/skip/.local/include/python3.13t/object.h:917:9: error: call to undeclared function '_Py_DecRefShared'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        917 |         _Py_DecRefShared(op);
            |         ^
      1 warning and 16 errors generated.
      error: command '/opt/homebrew/Cellar/llvm@18/18.1.8/bin/clang-18' failed with exit code 1
      [end of output]
@hynek
Copy link
Owner

hynek commented Nov 3, 2024

please refer to hynek/argon2-cffi-bindings#67 and hynek/argon2-cffi-bindings#70

the TL;DR is that right now we’re blocked by the cffi dependency but things are in motion

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

No branches or pull requests

2 participants