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

Build error from Git on 3.14 Linux no-GIL #834

Closed
clin1234 opened this issue Aug 15, 2024 · 2 comments
Closed

Build error from Git on 3.14 Linux no-GIL #834

clin1234 opened this issue Aug 15, 2024 · 2 comments

Comments

@clin1234
Copy link

  x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -g -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -g -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/workspaces/venv/include -I/usr/include/python3.14t -Ibuild/temp.linux-x86_64-cpython-314t/include -c build/temp.linux-x86_64-cpython-314t/_sodium.c -o build/temp.linux-x86_64-cpython-314t/build/temp.linux-x86_64-cpython-314t/_sodium.o
  In file included from build/temp.linux-x86_64-cpython-314t/_sodium.c:57:
  /usr/include/python3.14t/Python.h:51:4: error: #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 /usr/include/python3.14t/Python.h:68,
                   from build/temp.linux-x86_64-cpython-314t/_sodium.c:57:
  /usr/include/python3.14t/object.h:146:5: error: unknown type name ‘PyMutex’
    146 |     PyMutex ob_mutex;           // per-object lock
        |     ^~~~~~~
  /usr/include/python3.14t/object.h: In function ‘Py_SET_SIZE’:
  /usr/include/python3.14t/object.h:293:5: warning: implicit declaration of function ‘_Py_atomic_store_ssize_relaxed’ [-Wimplicit-function-declaration]
    293 |     _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);
        |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/python3.14t/Python.h:69,
                   from build/temp.linux-x86_64-cpython-314t/_sodium.c:57:
  /usr/include/python3.14t/refcount.h: In function ‘Py_REFCNT’:
  /usr/include/python3.14t/refcount.h:84:22: warning: implicit declaration of function ‘_Py_atomic_load_uint32_relaxed’ [-Wimplicit-function-declaration]
     84 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local);
        |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.14t/refcount.h:88:25: warning: implicit declaration of function ‘_Py_atomic_load_ssize_relaxed’ [-Wimplicit-function-declaration]
     88 |     Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared);
        |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.14t/refcount.h: In function ‘_Py_IsImmortal’:
  /usr/include/python3.14t/refcount.h:101:63: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
    101 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
        |                                                               ^~
  /usr/include/python3.14t/refcount.h: In function ‘Py_SET_REFCNT’:
  /usr/include/python3.14t/refcount.h:132:9: warning: implicit declaration of function ‘_Py_IsOwnedByCurrentThread’ [-Wimplicit-function-declaration]
    132 |     if (_Py_IsOwnedByCurrentThread(ob)) {
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.14t/refcount.h: In function ‘Py_INCREF’:
  /usr/include/python3.14t/refcount.h:234:9: warning: implicit declaration of function ‘_Py_atomic_store_uint32_relaxed’ [-Wimplicit-function-declaration]
    234 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, new_local);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.14t/refcount.h:237:9: warning: implicit declaration of function ‘_Py_atomic_add_ssize’; did you mean ‘__atomic_add_fetch’? [-Wimplicit-function-declaration]
    237 |         _Py_atomic_add_ssize(&op->ob_ref_shared, (1 << _Py_REF_SHARED_SHIFT));
        |         ^~~~~~~~~~~~~~~~~~~~
        |         __atomic_add_fetch
  /usr/include/python3.14t/refcount.h: In function ‘Py_DECREF’:
  /usr/include/python3.14t/refcount.h:330:13: warning: implicit declaration of function ‘_Py_MergeZeroLocalRefcount’ [-Wimplicit-function-declaration]
    330 |             _Py_MergeZeroLocalRefcount(op);
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.14t/refcount.h:334:9: warning: implicit declaration of function ‘_Py_DecRefShared’; did you mean ‘_Py_DecRef’? [-Wimplicit-function-declaration]
    334 |         _Py_DecRefShared(op);
        |         ^~~~~~~~~~~~~~~~
        |         _Py_DecRef
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for PyNaCl (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.
  full command: /workspaces/venv/bin/python3.14t /workspaces/venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmps_rv39l9
  cwd: /tmp/pip-req-build-pm8k_1qq
  Building wheel for PyNaCl (pyproject.toml) ... error
  ERROR: Failed building wheel for PyNaCl
Failed to build PyNaCl
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyNaCl)
@reaperhulk
Copy link
Member

python-cffi/cffi#40 is needed before we can look at this for pynacl. We'll keep an eye on this but there's no action we can take for the near future here.

@nitzmahone
Copy link

nitzmahone commented Sep 5, 2024

Did some minor surgery on CFFI tonight (force-disabling limited API support everywhere) - PyNACL main succesfully building and passing its tests under 3.13t (with and without PYTHON_GIL=0):

(tmp-8621ac4e4403c11) mdavis@mdavis-p1:~/projects/pynacl$ pip install . --no-build-isolation && PYTHON_GIL=0 pytest --capture=no --strict-markers
Processing /home/mdavis/projects/pynacl
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi>=1.18.0.dev0 in /home/mdavis/.virtualenvs/tmp-8621ac4e4403c11/lib64/python3.13t/site-packages (from PyNaCl==1.6.0.dev1) (1.18.0.dev0)
Requirement already satisfied: pycparser in /home/mdavis/.virtualenvs/tmp-8621ac4e4403c11/lib/python3.13t/site-packages (from cffi>=1.18.0.dev0->PyNaCl==1.6.0.dev1) (2.22)
Building wheels for collected packages: PyNaCl
  Building wheel for PyNaCl (pyproject.toml) ... done
  Created wheel for PyNaCl: filename=PyNaCl-1.6.0.dev1-cp313-cp313t-linux_x86_64.whl size=311422 sha256=41db158dc1df69dfcf78203ebfaafb6a7ffc64950b58474a2751c40b19014b6d
  Stored in directory: /tmp/pip-ephem-wheel-cache-z9de5srw/wheels/ac/91/e0/9fe918b5c7eb37a64443257841601f00708781ee58ce455eeb
Successfully built PyNaCl
Installing collected packages: PyNaCl
  Attempting uninstall: PyNaCl
    Found existing installation: PyNaCl 1.6.0.dev1
    Uninstalling PyNaCl-1.6.0.dev1:
      Successfully uninstalled PyNaCl-1.6.0.dev1
Successfully installed PyNaCl-1.6.0.dev1
========================================================================= test session starts ==========================================================================
platform linux -- Python 3.13.0rc1, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/mdavis/projects/pynacl
configfile: pyproject.toml
plugins: hypothesis-6.111.2
collected 4661 items                                                                                                                                                   

tests/test_aead.py ..........................................................................
(...)
tests/test_utils.py .....

================================================================== 4651 passed, 10 skipped in 13.71s ===================================================================
(tmp-8621ac4e4403c11) mdavis@mdavis-p1:~/projects/pynacl$ 

This means nearly nothing, of course- actually doing concurrent anything right now is likely to implode the universe, kick your dog, etc, but at least it builds and runs without segfaulting... 😆

We'll need to figure out a more dynamic approach to detection/control of the limited API knobs on free-threaded builds beyond the "disabled with prejudice" used for this test before there's anything commit-worthy, but anyway, progress!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants