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

Free-threaded builds fail #67

Open
WhiteSymmetry opened this issue Sep 25, 2024 · 6 comments · May be fixed by #70
Open

Free-threaded builds fail #67

WhiteSymmetry opened this issue Sep 25, 2024 · 6 comments · May be fixed by #70

Comments

@WhiteSymmetry
Copy link

WhiteSymmetry commented Sep 25, 2024

Successfully built jupyterlab
Failed to build argon2-cffi-bindings
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (argon2-cffi-bindings)

OS: Ubuntu 24.10 (Oracular Oriole)
gcc --version
gcc (Ubuntu 14.2.0-4ubuntu2) 14.2.0
Miniconda
Commands (mamba, conda, pip)
pip install jupyterlab
python -Im pip install --no-binary=argon2-cffi-bindings argon2-cffi-binding
python -Im pip install argon2-cffi-bindings

python -m pip install argon2-cffi-bindings
Collecting argon2-cffi-bindings
Using cached argon2-cffi-bindings-21.2.0.tar.gz (1.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting cffi>=1.0.1 (from argon2-cffi-bindings)
Using cached cffi-1.17.1-cp313-cp313t-linux_x86_64.whl
Collecting pycparser (from cffi>=1.0.1->argon2-cffi-bindings)
Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: argon2-cffi-bindings
Building wheel for argon2-cffi-bindings (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for argon2-cffi-bindings (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [59 lines of output]
:488: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module '_cffi_backend', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.
running bdist_wheel
running build
running build_py
creating build/lib.linux-x86_64-cpython-313t/_argon2_cffi_bindings
copying src/_argon2_cffi_bindings/init.py -> build/lib.linux-x86_64-cpython-313t/_argon2_cffi_bindings
copying src/_argon2_cffi_bindings/_ffi_build.py -> build/lib.linux-x86_64-cpython-313t/_argon2_cffi_bindings
running build_ext
generating cffi module 'build/temp.linux-x86_64-cpython-313t/_ffi.c'
creating build/temp.linux-x86_64-cpython-313t
building '_ffi' extension
creating build/temp.linux-x86_64-cpython-313t/build/temp.linux-x86_64-cpython-313t
creating build/temp.linux-x86_64-cpython-313t/extras/libargon2/src
creating build/temp.linux-x86_64-cpython-313t/extras/libargon2/src/blake2
gcc -pthread -B /home/mk/miniconda3/envs/q13/shared/python_compiler_compat -fno-strict-overflow -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/mk/miniconda3/envs/q13/include -fPIC -O2 -isystem /home/mk/miniconda3/envs/q13/include -fPIC -Iextras/libargon2/include -I/home/mk/miniconda3/envs/q13/include/python3.13t -c build/temp.linux-x86_64-cpython-313t/_ffi.c -o build/temp.linux-x86_64-cpython-313t/build/temp.linux-x86_64-cpython-313t/_ffi.o -msse2
In file included from build/temp.linux-x86_64-cpython-313t/_ffi.c:57:
/home/mk/miniconda3/envs/q13/include/python3.13t/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 /home/mk/miniconda3/envs/q13/include/python3.13t/Python.h:68:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:213:5: error: unknown type name ‘PyMutex’
213 | PyMutex ob_mutex; // per-object lock
| ^~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h: In function ‘Py_REFCNT’:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:314:22: error: implicit declaration of function ‘_Py_atomic_load_uint32_relaxed’ [-Wimplicit-function-declaration]
314 | uint32_t local = _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:318:25: error: implicit declaration of function ‘_Py_atomic_load_ssize_relaxed’ [-Wimplicit-function-declaration]
318 | Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h: In function ‘_Py_IsImmortal’:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:352:63: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
352 | return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
| ^~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h: In function ‘Py_SET_REFCNT’:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:390:9: error: implicit declaration of function ‘_Py_IsOwnedByCurrentThread’ [-Wimplicit-function-declaration]
390 | if (_Py_IsOwnedByCurrentThread(ob)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h: In function ‘Py_SET_SIZE’:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:430:5: error: implicit declaration of function ‘_Py_atomic_store_ssize_relaxed’ [-Wimplicit-function-declaration]
430 | _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h: In function ‘Py_INCREF’:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:811:9: error: implicit declaration of function ‘_Py_atomic_store_uint32_relaxed’ [-Wimplicit-function-declaration]
811 | _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, new_local);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:814:9: error: implicit declaration of function ‘_Py_atomic_add_ssize’; did you mean ‘__atomic_add_fetch’? [-Wimplicit-function-declaration]
814 | _Py_atomic_add_ssize(&op->ob_ref_shared, (1 << _Py_REF_SHARED_SHIFT));
| ^~~~~~~~~~~~~~~~~~~~
| __atomic_add_fetch
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h: In function ‘Py_DECREF’:
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:907:13: error: implicit declaration of function ‘_Py_MergeZeroLocalRefcount’ [-Wimplicit-function-declaration]
907 | _Py_MergeZeroLocalRefcount(op);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mk/miniconda3/envs/q13/include/python3.13t/object.h:911:9: error: implicit declaration of function ‘_Py_DecRefShared’; did you mean ‘_Py_DecRef’? [-Wimplicit-function-declaration]
911 | _Py_DecRefShared(op);
| ^~~~~~~~~~~~~~~~
| _Py_DecRef
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for argon2-cffi-bindings
Failed to build argon2-cffi-bindings
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (argon2-cffi-bindings)

@hynek
Copy link
Owner

hynek commented Sep 25, 2024

What am I supposed to make of this? I don't know what you're trying to do, on what platform, using what commands. Your installer should be able to use argon2-cffi-bindings's wheels that work fine on all platforms that I have access to. Why it doesn't is not apparent from what you shared.

@hynek
Copy link
Owner

hynek commented Sep 25, 2024

Thank you for the update – so it's Conda and you're attempting a free-threaded build?

It looks like those aren't supported by CFFI yet, so I don't think I can do anything about it for now: python-cffi/cffi#126

@WhiteSymmetry
Copy link
Author

pip install cffi
Collecting cffi
Using cached cffi-1.17.1-cp313-cp313t-linux_x86_64.whl
Requirement already satisfied: pycparser in ./.local/lib/python3.13t/site-packages (from cffi) (2.22)
Installing collected packages: cffi
Successfully installed cffi-1.17.1

or

python3 -m pip install cffi
Defaulting to user installation because normal site-packages is not writeable
Collecting cffi
Using cached cffi-1.17.1-cp313-cp313t-linux_x86_64.whl
Collecting pycparser (from cffi)
Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: pycparser, cffi
Successfully installed cffi-1.17.1 pycparser-2.22

@WhiteSymmetry
Copy link
Author

WhiteSymmetry commented Sep 25, 2024

linux-64/python-3.13.0rc2-h6355ac2_1_cp313t.conda In this version (Threading), it gives an installation error in this version.

linux-64/python-3.13.0rc2-h9ebbce0_101_cp313.conda There is no problem with this version.

They worked there when I copied the modules I installed here to the other side.

python -m pip install argon2-cffi-bindings
Collecting argon2-cffi-bindings
Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)
Requirement already satisfied: cffi>=1.0.1 in ./miniconda3/envs/a13/lib/python3.13/site-packages (from argon2-cffi-bindings) (1.17.1)
Requirement already satisfied: pycparser in ./.local/lib/python3.13/site-packages (from cffi>=1.0.1->argon2-cffi-bindings) (2.22)
Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (86 kB)
Installing collected packages: argon2-cffi-bindings
Successfully installed argon2-cffi-bindings-21.2.0

@hynek hynek changed the title Failed to build argon2-cffi-bindings for Python 3.13.0rc2 Free-threaded builds fail Oct 4, 2024
@tacaswell
Copy link

@minrk has a patch that builds:

main...minrk:argon2-cffi-bindings:313t

I have been using this branch locally, but I'm not clear how I found it.

The downside is that with 313+jit that branch hangs in build.

@clin1234
Copy link

clin1234 commented Nov 28, 2024

Similar error here:

Collecting argon2-cffi-bindings (from -r sys312.txt (line 9))
  Downloading argon2-cffi-bindings-21.2.0.tar.gz (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 33.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [64 lines of output]
      <frozen importlib._bootstrap>:488: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module '_cffi_backend', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.
      running dist_info
      creating /tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info
      writing /tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/requires.txt
      writing top-level names to /tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/SOURCES.txt'
      ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
      reading manifest file '/tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file '/tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings.egg-info/SOURCES.txt'
      creating '/tmp/pip-modern-metadata-rniv4ow2/argon2_cffi_bindings-21.2.0.dist-info'
      Traceback (most recent call last):
        File "/workspaces/venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/workspaces/venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/workspaces/venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/build_meta.py", line 377, in prepare_metadata_for_build_wheel
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 86, in <module>
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/_distutils/core.py", line 183, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
          dist.run_commands()
          ~~~~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
          self.run_command(cmd)
          ~~~~~~~~~~~~~~~~^^^^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/dist.py", line 995, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/command/dist_info.py", line 99, in run
          bdist_wheel = self.get_finalized_command('bdist_wheel')
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/_distutils/cmd.py", line 303, in get_finalized_command
          cmd_obj.ensure_finalized()
          ~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
          ~~~~~~~~~~~~~~~~~~~~~^^
        File "<string>", line 75, in finalize_options
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/command/bdist_wheel.py", line 261, in finalize_options
          self._validate_py_limited_api()
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ze1wwqw1/overlay/lib/python3.14t/site-packages/setuptools/command/bdist_wheel.py", line 296, in _validate_py_limited_api
          raise ValueError(
          ...<4 lines>...
          )
      ValueError: `py_limited_api='cp314'` not supported. `Py_LIMITED_API` is currently incompatible with `Py_GIL_DISABLED` (sys.abiflags='t'). See https://github.com/python/cpython/issues/111506.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

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.

4 participants