Skip to content

Can't build from git clone #1704

@alienjon

Description

@alienjon

I'm trying to build from git clone (I'm in Gentoo and can't seem to install with pip and there's no ebuild for this package that I can see). Regular build command (uv --sync --all-extras) fails with:

warning: The `tool.uv.dev-dependencies` field (used in `pyproject.toml`) is deprecated and will be removed in a future release; use `dependency-groups.dev` instead
Resolved 90 packages in 5ms
  × Failed to build `orjson==3.10.15`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `maturin.build_wheel` failed (exit status: 1)

      [stdout]
      Running `maturin pep517 build-wheel -i /root/.cache/uv/builds-v0/.tmpD34mSs/bin/python --compatibility off`

      [stderr]
      📦 Including license file `LICENSE-APACHE`
      📦 Including license file `LICENSE-MIT`
      🍹 Building a mixed python/rust project
      🐍 Found CPython 3.14 at /root/.cache/uv/builds-v0/.tmpD34mSs/bin/python
      🔗 Found pyo3-ffi bindings
         Compiling pyo3-build-config v0.23.3
      (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/include/pyo3/pyo3-build-config)
         Compiling pyo3-ffi v0.23.3 (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/include/pyo3/pyo3-ffi)
         Compiling orjson v3.10.15 (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src)
      error: failed to run custom build command for `pyo3-ffi v0.23.3
      (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/include/pyo3/pyo3-ffi)`

      Caused by:
        process didn't exit successfully:
      `/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/target/release/build/pyo3-ffi-6acf633eebd63a26/build-script-build`
      (exit status: 1)
        --- stdout
        cargo:rustc-check-cfg=cfg(Py_LIMITED_API)
        cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)
        cargo:rustc-check-cfg=cfg(PyPy)
        cargo:rustc-check-cfg=cfg(GraalPy)
        cargo:rustc-check-cfg=cfg(py_sys_config, values("Py_DEBUG", "Py_REF_DEBUG", "Py_TRACE_REFS", "COUNT_ALLOCS"))
        cargo:rustc-check-cfg=cfg(invalid_from_utf8_lint)
        cargo:rustc-check-cfg=cfg(pyo3_disable_reference_pool)
        cargo:rustc-check-cfg=cfg(pyo3_leak_on_drop_without_reference_pool)
        cargo:rustc-check-cfg=cfg(diagnostic_namespace)
        cargo:rustc-check-cfg=cfg(c_str_lit)
        cargo:rustc-check-cfg=cfg(rustc_has_once_lock)
        cargo:rustc-check-cfg=cfg(io_error_more)
        cargo:rustc-check-cfg=cfg(fn_ptr_eq)
        cargo:rustc-check-cfg=cfg(Py_3_7)
        cargo:rustc-check-cfg=cfg(Py_3_8)
        cargo:rustc-check-cfg=cfg(Py_3_9)
        cargo:rustc-check-cfg=cfg(Py_3_10)
        cargo:rustc-check-cfg=cfg(Py_3_11)
        cargo:rustc-check-cfg=cfg(Py_3_12)
        cargo:rustc-check-cfg=cfg(Py_3_13)
        cargo:rerun-if-env-changed=PYO3_CROSS
        cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
        cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
        cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY

        --- stderr
        error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13)
        = help: please check if an updated version of PyO3 is available. Current version: 0.23.3
        = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      💥 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_BUILD_EXTENSION_MODULE="1"
      PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/root/.cache/uv/builds-v0/.tmpD34mSs/bin/python"
      PYTHON_SYS_EXECUTABLE="/root/.cache/uv/builds-v0/.tmpD34mSs/bin/python" "cargo" "rustc" "--profile" "release" "--message-format"
      "json-render-diagnostics" "--manifest-path" "/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/Cargo.toml"
      "--lib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/root/.cache/uv/builds-v0/.tmpD34mSs/bin/python', '--compatibility',
      'off'] returned non-zero exit status 1

      hint: This usually indicates a problem with the package or the build environment.
  help: `orjson` (v3.10.15) was included because `python-kasa[speedups]` (v0.10.2) depends on `orjson`

Forcing forward compatability (PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 uv sync --all-extras) fails with:

warning: The `tool.uv.dev-dependencies` field (used in `pyproject.toml`) is deprecated and will be removed in a future release; use `dependency-groups.dev` instead
Resolved 90 packages in 18ms
  × Failed to build `orjson==3.10.15`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `maturin.build_wheel` failed (exit status: 1)

      [stdout]
      Running `maturin pep517 build-wheel -i /root/.cache/uv/builds-v0/.tmpTqUVMv/bin/python --compatibility off`

      [stderr]
      📦 Including license file `LICENSE-APACHE`
      📦 Including license file `LICENSE-MIT`
      🍹 Building a mixed python/rust project
      🐍 Found CPython 3.14 at /root/.cache/uv/builds-v0/.tmpTqUVMv/bin/python
      🔗 Found pyo3-ffi bindings
         Compiling pyo3-build-config v0.23.3
      (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/include/pyo3/pyo3-build-config)
         Compiling pyo3-ffi v0.23.3 (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/include/pyo3/pyo3-ffi)
         Compiling orjson v3.10.15 (/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src)
      error[E0425]: cannot find type `c_void` in this scope
        --> include/pyo3/pyo3-ffi/src/pyhash.rs:19:38
         |
      19 |     pub fn Py_HashBuffer(ptr: *const c_void, len: Py_ssize_t) -> Py_hash_t;
         |                                      ^^^^^^ not found in this scope
         |
      note: found an item that was configured out
        --> include/pyo3/pyo3-ffi/src/pyhash.rs:6:19
         |
       5 | #[cfg(not(any(Py_LIMITED_API, PyPy)))]
         |          --------------------------- the item is gated here
       6 | use std::os::raw::c_void;
         |                   ^^^^^^
      help: consider importing one of these items
         |
       8 + use std::ffi::c_void;
         |
       8 + use std::os::raw::c_void;
         |
       8 + use core::ffi::c_void;
         |
       8 + use libc::c_void;
         |

      error[E0425]: cannot find type `Py_ssize_t` in this scope
        --> include/pyo3/pyo3-ffi/src/pyhash.rs:19:51
         |
      19 |     pub fn Py_HashBuffer(ptr: *const c_void, len: Py_ssize_t) -> Py_hash_t;
         |                                                   ^^^^^^^^^^ not found in this scope
         |
      note: found an item that was configured out
        --> include/pyo3/pyo3-ffi/src/pyhash.rs:2:32
         |
       1 | #[cfg(not(any(Py_LIMITED_API, PyPy)))]
         |          --------------------------- the item is gated here
       2 | use crate::pyport::{Py_hash_t, Py_ssize_t};
         |                                ^^^^^^^^^^
      help: consider importing this type alias through its public re-export
         |
       8 + use crate::Py_ssize_t;
         |

      error[E0425]: cannot find type `Py_hash_t` in this scope
        --> include/pyo3/pyo3-ffi/src/pyhash.rs:19:66
         |
      19 |     pub fn Py_HashBuffer(ptr: *const c_void, len: Py_ssize_t) -> Py_hash_t;
         |                                                                  ^^^^^^^^^ not found in this scope
         |
      note: found an item that was configured out
        --> include/pyo3/pyo3-ffi/src/pyhash.rs:2:21
         |
       1 | #[cfg(not(any(Py_LIMITED_API, PyPy)))]
         |          --------------------------- the item is gated here
       2 | use crate::pyport::{Py_hash_t, Py_ssize_t};
         |                     ^^^^^^^^^
      note: found an item that was configured out
        --> include/pyo3/pyo3-ffi/src/setobject.rs:3:20
         |
       2 | #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
         |          ------------------------------------ the item is gated here
       3 | use crate::pyport::Py_hash_t;
         |                    ^^^^^^^^^
      help: consider importing this type alias through its public re-export
         |
       8 + use crate::Py_hash_t;
         |

      For more information about this error, try `rustc --explain E0425`.
      error: could not compile `pyo3-ffi` (lib) due to 3 previous errors
      warning: build failed, waiting for other jobs to finish...
      warning: orjson@3.10.15: include/yyjson/yyjson.c: In function ‘read_string’:
      warning: orjson@3.10.15: include/yyjson/yyjson.c:5268:29: warning: variable ‘pos’ set but not used [-Wunused-but-set-variable]
      warning: orjson@3.10.15:  5268 |     u8 *src = ++cur, *dst, *pos;
      warning: orjson@3.10.15:       |                             ^~~
      💥 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_BUILD_EXTENSION_MODULE="1"
      PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/root/.cache/uv/builds-v0/.tmpTqUVMv/bin/python"
      PYTHON_SYS_EXECUTABLE="/root/.cache/uv/builds-v0/.tmpTqUVMv/bin/python" "cargo" "rustc" "--profile" "release" "--message-format"
      "json-render-diagnostics" "--manifest-path" "/root/.cache/uv/sdists-v9/pypi/orjson/3.10.15/Cijcxx-_lJav4KeYc_vA2/src/Cargo.toml"
      "--lib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/root/.cache/uv/builds-v0/.tmpTqUVMv/bin/python', '--compatibility',
      'off'] returned non-zero exit status 1

      hint: This usually indicates a problem with the package or the build environment.
  help: `orjson` (v3.10.15) was included because `python-kasa[speedups]` (v0.10.2) depends on `orjson`

I'm running python 3.14.4 and would rather not play with downgrading. I suspect a dependency issue, but not sure what I'm looking for. orjson is installed on my system (v3.11.8) and py03-ffi is not an option to install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions