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

Building from Git with 3.14 Linux no-GIL fails #11436

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

Building from Git with 3.14 Linux no-GIL fails #11436

clin1234 opened this issue Aug 15, 2024 · 4 comments

Comments

@clin1234
Copy link

(venv) @clin1234 ➜ /workspaces/venv $ pip install -U g                                                                  git+https://github.com/pyca/cryptography
Collecting git+https://github.com/pyca/cryptography
  Cloning https://github.com/pyca/cryptography to /tmp/pip-req-build-5219onmx
  Running command git clone --filter=blob:none --quiet https://github.com/pyca/cryptography /tmp/pip-req-build-5219onmx
  Resolved https://github.com/pyca/cryptography to commit e6cf6cab9999c9885155a961a80f91bb7d3158d1
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cffi>=1.12 (from cryptography==44.0.0.dev1)
  Using cached cffi-1.17.0-cp314-cp314t-linux_x86_64.whl
Collecting pycparser (from cffi>=1.12->cryptography==44.0.0.dev1)
  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: cryptography
  Building wheel for cryptography (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cryptography (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [257 lines of output]
      Running `maturin pep517 build-wheel -i /workspaces/venv/bin/python3.14t --compatibility off`
      📦 Including license file "/tmp/pip-req-build-5219onmx/LICENSE"
      📦 Including license file "/tmp/pip-req-build-5219onmx/LICENSE.APACHE"
      📦 Including license file "/tmp/pip-req-build-5219onmx/LICENSE.BSD"
      🍹 Building a mixed python/rust project
      🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.7
      🐍 Not using a specific python interpreter
      📡 Using build options features, locked from pyproject.toml
         Compiling proc-macro2 v1.0.86
         Compiling target-lexicon v0.12.16
         Compiling unicode-ident v1.0.12
         Compiling shlex v1.3.0
         Compiling cc v1.1.12
         Compiling pyo3-build-config v0.22.2
         Compiling quote v1.0.36
         Compiling syn v2.0.74
         Compiling vcpkg v0.2.15
         Compiling once_cell v1.19.0
         Compiling pkg-config v0.3.30
         Compiling openssl-sys v0.9.103
         Compiling libc v0.2.155
         Compiling cfg-if v1.0.0
         Compiling pyo3-ffi v0.22.2
         Compiling pyo3-macros-backend v0.22.2
         Compiling autocfg v1.3.0
         Compiling memoffset v0.9.1
         Compiling openssl v0.10.66
         Compiling foreign-types-shared v0.1.1
         Compiling heck v0.5.0
         Compiling foreign-types v0.3.2
         Compiling asn1_derive v0.17.0
         Compiling openssl-macros v0.1.1
         Compiling pyo3 v0.22.2
         Compiling bitflags v2.6.0
         Compiling pyo3-macros v0.22.2
         Compiling asn1 v0.17.0
         Compiling indoc v2.0.5
         Compiling unindent v0.2.3
         Compiling cryptography-key-parsing v0.1.0 (/tmp/pip-req-build-5219onmx/src/rust/cryptography-key-parsing)
      warning: [email protected]: cargo:rustc-check-cfg requires -Zcheck-cfg flag
      warning: [email protected]: cargo:rustc-check-cfg requires -Zcheck-cfg flag
         Compiling cryptography-x509 v0.1.0 (/tmp/pip-req-build-5219onmx/src/rust/cryptography-x509)
         Compiling cryptography-cffi v0.1.0 (/tmp/pip-req-build-5219onmx/src/rust/cryptography-cffi)
         Compiling cryptography-openssl v0.1.0 (/tmp/pip-req-build-5219onmx/src/rust/cryptography-openssl)
      warning: [email protected]: cargo:rustc-check-cfg requires -Zcheck-cfg flag
      warning: [email protected]: cargo:rustc-check-cfg requires -Zcheck-cfg flag
      warning: [email protected]: cargo:rustc-check-cfg requires -Zcheck-cfg flag
      warning: [email protected]: cargo:rustc-check-cfg requires -Zcheck-cfg flag
      The following warnings were emitted during compilation:
      
      warning: [email protected]: In file included from /tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c:57:
      warning: [email protected]: /usr/include/python3.14t/Python.h:51:4: error: #error "The limited API is not currently supported in the free-threaded build"
      warning: [email protected]:    51 | #  error "The limited API is not currently supported in the free-threaded build"
      warning: [email protected]:       |    ^~~~~
      warning: [email protected]: In file included from /usr/include/python3.14t/Python.h:68,
      warning: [email protected]:                  from /tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c:57:
      warning: [email protected]: /usr/include/python3.14t/object.h:146:5: error: unknown type name ‘PyMutex’
      warning: [email protected]:   146 |     PyMutex ob_mutex;           // per-object lock
      warning: [email protected]:       |     ^~~~~~~
      warning: [email protected]: /usr/include/python3.14t/object.h: In function ‘Py_SET_SIZE’:
      warning: [email protected]: /usr/include/python3.14t/object.h:293:5: warning: implicit declaration of function ‘_Py_atomic_store_ssize_relaxed’ [-Wimplicit-function-declaration]
      warning: [email protected]:   293 |     _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);
      warning: [email protected]:       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: In file included from /usr/include/python3.14t/Python.h:69,
      warning: [email protected]:                  from /tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c:57:
      warning: [email protected]: /usr/include/python3.14t/refcount.h: In function ‘Py_REFCNT’:
      warning: [email protected]: /usr/include/python3.14t/refcount.h:84:22: warning: implicit declaration of function ‘_Py_atomic_load_uint32_relaxed’ [-Wimplicit-function-declaration]
      warning: [email protected]:    84 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local);
      warning: [email protected]:       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /usr/include/python3.14t/refcount.h:84:22: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
      warning: [email protected]: /usr/include/python3.14t/refcount.h:88:25: warning: implicit declaration of function ‘_Py_atomic_load_ssize_relaxed’ [-Wimplicit-function-declaration]
      warning: [email protected]:    88 |     Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared);
      warning: [email protected]:       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /usr/include/python3.14t/refcount.h: In function ‘_Py_IsImmortal’:
      warning: [email protected]: /usr/include/python3.14t/refcount.h:101:63: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      warning: [email protected]:   101 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
      warning: [email protected]:       |                                                               ^~
      warning: [email protected]: /usr/include/python3.14t/refcount.h: In function ‘Py_SET_REFCNT’:
      warning: [email protected]: /usr/include/python3.14t/refcount.h:132:9: warning: implicit declaration of function ‘_Py_IsOwnedByCurrentThread’ [-Wimplicit-function-declaration]
      warning: [email protected]:   132 |     if (_Py_IsOwnedByCurrentThread(ob)) {
      warning: [email protected]:       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /usr/include/python3.14t/refcount.h: In function ‘Py_INCREF’:
      warning: [email protected]: /usr/include/python3.14t/refcount.h:227:22: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
      warning: [email protected]:   227 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
      warning: [email protected]:       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /usr/include/python3.14t/refcount.h:234:9: warning: implicit declaration of function ‘_Py_atomic_store_uint32_relaxed’ [-Wimplicit-function-declaration]
      warning: [email protected]:   234 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, new_local);
      warning: [email protected]:       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /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]
      warning: [email protected]:   237 |         _Py_atomic_add_ssize(&op->ob_ref_shared, (1 << _Py_REF_SHARED_SHIFT));
      warning: [email protected]:       |         ^~~~~~~~~~~~~~~~~~~~
      warning: [email protected]:       |         __atomic_add_fetch
      warning: [email protected]: /usr/include/python3.14t/refcount.h: In function ‘Py_DECREF’:
      warning: [email protected]: /usr/include/python3.14t/refcount.h:321:22: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
      warning: [email protected]:   321 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
      warning: [email protected]:       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /usr/include/python3.14t/refcount.h:330:13: warning: implicit declaration of function ‘_Py_MergeZeroLocalRefcount’ [-Wimplicit-function-declaration]
      warning: [email protected]:   330 |             _Py_MergeZeroLocalRefcount(op);
      warning: [email protected]:       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      warning: [email protected]: /usr/include/python3.14t/refcount.h:334:9: warning: implicit declaration of function ‘_Py_DecRefShared’; did you mean ‘_Py_DecRef’? [-Wimplicit-function-declaration]
      warning: [email protected]:   334 |         _Py_DecRefShared(op);
      warning: [email protected]:       |         ^~~~~~~~~~~~~~~~
      warning: [email protected]:       |         _Py_DecRef
      
      error: failed to run custom build command for `cryptography-cffi v0.1.0 (/tmp/pip-req-build-5219onmx/src/rust/cryptography-cffi)`
      
      Caused by:
        process didn't exit successfully: `/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-01ffb5525631fdf0/build-script-build` (exit status: 1)
        --- stdout
        cargo:rustc-check-cfg=cfg(python_implementation, values("CPython", "PyPy"))
        cargo:rerun-if-env-changed=PYO3_PYTHON
        cargo:rerun-if-changed=../../_cffi_src/
        cargo:rerun-if-changed=../../cryptography/__about__.py
        cargo:rustc-cfg=python_implementation="CPython"
        OUT_DIR = Some(/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out)
        TARGET = Some(x86_64-unknown-linux-gnu)
        OPT_LEVEL = Some(3)
        HOST = Some(x86_64-unknown-linux-gnu)
        cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
        CC_x86_64-unknown-linux-gnu = None
        cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
        CC_x86_64_unknown_linux_gnu = None
        cargo:rerun-if-env-changed=HOST_CC
        HOST_CC = None
        cargo:rerun-if-env-changed=CC
        CC = None
        cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
        RUSTC_WRAPPER = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        DEBUG = Some(false)
        CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
        CFLAGS_x86_64-unknown-linux-gnu = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
        CFLAGS_x86_64_unknown_linux_gnu = None
        cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        OUT_DIR = Some(/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out)
        cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
        CFLAGS_x86_64-unknown-linux-gnu = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
        CFLAGS_x86_64_unknown_linux_gnu = None
        cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        OUT_DIR = Some(/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out)
        cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
        CFLAGS_x86_64-unknown-linux-gnu = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
        CFLAGS_x86_64_unknown_linux_gnu = None
        cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        OUT_DIR = Some(/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out)
        cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
        CFLAGS_x86_64-unknown-linux-gnu = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
        CFLAGS_x86_64_unknown_linux_gnu = None
        cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        OUT_DIR = Some(/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out)
        cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
        cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
        CFLAGS_x86_64-unknown-linux-gnu = None
        cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
        CFLAGS_x86_64_unknown_linux_gnu = None
        cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:warning=In file included from /tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c:57:
        cargo:warning=/usr/include/python3.14t/Python.h:51:4: error: #error "The limited API is not currently supported in the free-threaded build"
        cargo:warning=   51 | #  error "The limited API is not currently supported in the free-threaded build"
        cargo:warning=      |    ^~~~~
        cargo:warning=In file included from /usr/include/python3.14t/Python.h:68,
        cargo:warning=                 from /tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c:57:
        cargo:warning=/usr/include/python3.14t/object.h:146:5: error: unknown type name ‘PyMutex’
        cargo:warning=  146 |     PyMutex ob_mutex;           // per-object lock
        cargo:warning=      |     ^~~~~~~
        cargo:warning=/usr/include/python3.14t/object.h: In function ‘Py_SET_SIZE’:
        cargo:warning=/usr/include/python3.14t/object.h:293:5: warning: implicit declaration of function ‘_Py_atomic_store_ssize_relaxed’ [-Wimplicit-function-declaration]
        cargo:warning=  293 |     _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);
        cargo:warning=      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=In file included from /usr/include/python3.14t/Python.h:69,
        cargo:warning=                 from /tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c:57:
        cargo:warning=/usr/include/python3.14t/refcount.h: In function ‘Py_REFCNT’:
        cargo:warning=/usr/include/python3.14t/refcount.h:84:22: warning: implicit declaration of function ‘_Py_atomic_load_uint32_relaxed’ [-Wimplicit-function-declaration]
        cargo:warning=   84 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local);
        cargo:warning=      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/usr/include/python3.14t/refcount.h:84:22: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
        cargo:warning=/usr/include/python3.14t/refcount.h:88:25: warning: implicit declaration of function ‘_Py_atomic_load_ssize_relaxed’ [-Wimplicit-function-declaration]
        cargo:warning=   88 |     Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared);
        cargo:warning=      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/usr/include/python3.14t/refcount.h: In function ‘_Py_IsImmortal’:
        cargo:warning=/usr/include/python3.14t/refcount.h:101:63: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
        cargo:warning=  101 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
        cargo:warning=      |                                                               ^~
        cargo:warning=/usr/include/python3.14t/refcount.h: In function ‘Py_SET_REFCNT’:
        cargo:warning=/usr/include/python3.14t/refcount.h:132:9: warning: implicit declaration of function ‘_Py_IsOwnedByCurrentThread’ [-Wimplicit-function-declaration]
        cargo:warning=  132 |     if (_Py_IsOwnedByCurrentThread(ob)) {
        cargo:warning=      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/usr/include/python3.14t/refcount.h: In function ‘Py_INCREF’:
        cargo:warning=/usr/include/python3.14t/refcount.h:227:22: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
        cargo:warning=  227 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
        cargo:warning=      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/usr/include/python3.14t/refcount.h:234:9: warning: implicit declaration of function ‘_Py_atomic_store_uint32_relaxed’ [-Wimplicit-function-declaration]
        cargo:warning=  234 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, new_local);
        cargo:warning=      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/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]
        cargo:warning=  237 |         _Py_atomic_add_ssize(&op->ob_ref_shared, (1 << _Py_REF_SHARED_SHIFT));
        cargo:warning=      |         ^~~~~~~~~~~~~~~~~~~~
        cargo:warning=      |         __atomic_add_fetch
        cargo:warning=/usr/include/python3.14t/refcount.h: In function ‘Py_DECREF’:
        cargo:warning=/usr/include/python3.14t/refcount.h:321:22: warning: conversion to ‘uint32_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
        cargo:warning=  321 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
        cargo:warning=      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/usr/include/python3.14t/refcount.h:330:13: warning: implicit declaration of function ‘_Py_MergeZeroLocalRefcount’ [-Wimplicit-function-declaration]
        cargo:warning=  330 |             _Py_MergeZeroLocalRefcount(op);
        cargo:warning=      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
        cargo:warning=/usr/include/python3.14t/refcount.h:334:9: warning: implicit declaration of function ‘_Py_DecRefShared’; did you mean ‘_Py_DecRef’? [-Wimplicit-function-declaration]
        cargo:warning=  334 |         _Py_DecRefShared(op);
        cargo:warning=      |         ^~~~~~~~~~~~~~~~
        cargo:warning=      |         _Py_DecRef
      
        --- stderr
      
      
        error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/usr/include" "-I" "/workspaces/venv/include" "-I" "/usr/include/python3.14t" "-Wall" "-Wextra" "-Wconversion" "-Wno-error=sign-conversion" "-Wno-unused-parameter" "-fmacro-prefix-map=/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out=." "-DPy_LIMITED_API=0x030700f0" "-o" "/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/5e6d3db45e392808-_openssl.o" "-c" "/tmp/pip-req-build-5219onmx/src/rust/target/release/build/cryptography-cffi-eec357800f931841/out/_openssl.c" with args cc did not execute successfully (status code exit status: 1).
      
      
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/workspaces/venv/bin/python3.14t" PYTHON_SYS_EXECUTABLE="/workspaces/venv/bin/python3.14t" "cargo" "rustc" "--features" "pyo3/abi3-py37" "--message-format" "json-render-diagnostics" "--locked" "--manifest-path" "/tmp/pip-req-build-5219onmx/src/rust/Cargo.toml" "--release" "--lib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/workspaces/venv/bin/python3.14t', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cryptography)```
@alex
Copy link
Member

alex commented Aug 15, 2024

Building with no-GIL support isn't going to work for a little bit, as need support from both cffi and pyo3. Those are tracked:

Since this is a long way down the line, I'm going to close this, as there's no action items for us at the moment.

@alex alex closed this as completed Aug 15, 2024
@nitzmahone
Copy link

I've gotten a successful 3.13t build from cryptography 44.0.0.dev1 with a couple of small tweaks to CFFI- force-disabling limited API/abi3 features everywhere, and a bleeding-edge top-of-main build of maturin. The resulting extension still segfaults immediately when built by released pyo3 0.22.2.

#0  __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:314
#1  0x00007ffff7a44690 in _PyImport_ResolveNameWithPackageContext (name=0x0) at /usr/src/debug/python3.13-3.13.0~rc1-2.fc40.x86_64/Python/import.c:747
#2  _PyModule_CreateInitialized (module=0x7fffe9b208f8 <cryptography_rust::_rust::_PYO3_DEF+8>, module_api_version=<optimized out>)
    at /usr/src/debug/python3.13-3.13.0~rc1-2.fc40.x86_64/Objects/moduleobject.c:226
#3  0x00007fffe984cfd3 in pyo3::sync::GILOnceCell<T>::init ()
   from /home/mdavis/projects/cryptography/src/cryptography/hazmat/bindings/_rust.cpython-313t-x86_64-linux-gnu.so
#4  0x00007fffe99caf96 in pyo3::impl_::pymodule::ModuleDef::make_module ()
   from /home/mdavis/projects/cryptography/src/cryptography/hazmat/bindings/_rust.cpython-313t-x86_64-linux-gnu.so
#5  0x00007fffe992aec1 in core::ops::function::FnOnce::call_once ()

Bleeding-edge pyo3 0.23.0-dev supports an UNSAFE_PYO3_BUILD_FREE_THREADED=1 flag that sounds promising, but it looks like it's not quite all working yet, eg:

error[E0277]: can't compare `pyo3::Bound<'_, PyInt>` with `pyo3::Bound<'_, PyInt>`
   --> src/backend/dh.rs:431:31
    |
431 |         Ok(self.x.bind(py).eq(other.x.bind(py))?
    |                            -- ^^^^^^^^^^^^^^^^ no implementation for `pyo3::Bound<'_, PyInt> == pyo3::Bound<'_, PyInt>`
    |                            |
    |                            required by a bound introduced by this call
    |
    = help: the trait `PartialEq<pyo3::Bound<'_, PyInt>>` is not implemented for `pyo3::Bound<'_, PyInt>`
    = help: the following other types implement trait `PartialEq<Rhs>`:
              <&pyo3::Bound<'_, PyBool> as PartialEq<bool>>
              <&pyo3::Bound<'_, PyBytes> as PartialEq<[u8]>>
              <&pyo3::Bound<'_, PyFloat> as PartialEq<f32>>
              <&pyo3::Bound<'_, PyFloat> as PartialEq<f64>>
              <&pyo3::Bound<'_, PyString> as PartialEq<str>>
              <pyo3::Bound<'_, PyBool> as PartialEq<&bool>>
              <pyo3::Bound<'_, PyBool> as PartialEq<bool>>
              <pyo3::Bound<'_, PyBytes> as PartialEq<&[u8]>>
            and 19 others

error[E0277]: the `?` operator can only be applied to values that implement `Try`
   --> src/backend/dh.rs:431:12
    |
431 |         Ok(self.x.bind(py).eq(other.x.bind(py))?
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
    |
    = help: the trait `Try` is not implemented for `bool`

Anyway, things seem to be getting a lot closer to working- FWIW, CFFI is passing nearly all of its test suite under 3.13t once we force-disabled the various places it sneaks in limited API enablement, so at least the very basic stuff is somewhat functional.

@alex
Copy link
Member

alex commented Sep 5, 2024

I would not expect anything to work until the relevant tasks in the pyo3 issue are complete.

I would not consider things building, or even the tests passing, as proof that things are sound. Neither of these actually perform multi-threaded operations.

@nitzmahone
Copy link

Oh definitely- the really hard part starts once everything actually does build and run 😆 - still nice to see things falling in line to at least get us to the edge of the cliff we're trying to hurl ourselves over.

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