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 fails without exporting #297

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

Build fails without exporting #297

clin1234 opened this issue Aug 15, 2024 · 2 comments

Comments

@clin1234
Copy link

(venv) @clin1234 ➜ /workspaces/pydantic-core (main) $ pip install git+https://github.com/samuelcolvin/watchfiles -v
Using pip 24.2 from /workspaces/venv/lib/python3.14t/site-packages/pip (python 3.14)
Collecting git+https://github.com/samuelcolvin/watchfiles
  Cloning https://github.com/samuelcolvin/watchfiles to /tmp/pip-req-build-av9j5tr8
  Running command git version
  git version 2.45.2
  Running command git clone --filter=blob:none https://github.com/samuelcolvin/watchfiles /tmp/pip-req-build-av9j5tr8
  Cloning into '/tmp/pip-req-build-av9j5tr8'...
  Running command git rev-parse HEAD
  4314094e5ee37dcd3d1986cbcead4b1fd141afe5
  Resolved https://github.com/samuelcolvin/watchfiles to commit 4314094e5ee37dcd3d1986cbcead4b1fd141afe5
  Running command git rev-parse HEAD
  4314094e5ee37dcd3d1986cbcead4b1fd141afe5
  Running command pip subprocess to install build dependencies
  Using pip 24.2 from /workspaces/venv/lib/python3.14t/site-packages/pip (python 3.14)
  Collecting maturin<2,>=0.14.16
    Obtaining dependency information for maturin<2,>=0.14.16 from https://files.pythonhosted.org/packages/2b/f9/98ba27c5f7c031f12d11cb64651c44730eb566cd10b3080f9a498c210b7e/maturin-1.7.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl.metadata
    Using cached maturin-1.7.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl.metadata (18 kB)
  Using cached maturin-1.7.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl (8.8 MB)
  Installing collected packages: maturin
  Successfully installed maturin-1.7.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  📦 Including license file "/tmp/pip-req-build-av9j5tr8/LICENSE"
  🍹 Building a mixed python/rust project
  🔗 Found pyo3 bindings
  🐍 Found CPython 3.14t at /workspaces/venv/bin/python3.14t
  📡 Using build options bindings from pyproject.toml
  watchfiles-0.0.0.dist-info
  Checking for Rust toolchain....
  Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-xoqrwc69 --interpreter /workspaces/venv/bin/python3.14t`
  Preparing metadata (pyproject.toml) ... done
Collecting anyio>=3.0.0 (from watchfiles==0.0.0)
  Obtaining dependency information for anyio>=3.0.0 from https://files.pythonhosted.org/packages/7b/a2/10639a79341f6c019dedc95bd48a4928eed9f1d1197f4c04f546fc7ae0ff/anyio-4.4.0-py3-none-any.whl.metadata
  Using cached anyio-4.4.0-py3-none-any.whl.metadata (4.6 kB)
Collecting idna>=2.8 (from anyio>=3.0.0->watchfiles==0.0.0)
  Obtaining dependency information for idna>=2.8 from https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl.metadata
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting sniffio>=1.1 (from anyio>=3.0.0->watchfiles==0.0.0)
  Obtaining dependency information for sniffio>=1.1 from https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl.metadata
  Using cached sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
Using cached anyio-4.4.0-py3-none-any.whl (86 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
Building wheels for collected packages: watchfiles
  Running command Building wheel for watchfiles (pyproject.toml)
  Running `maturin pep517 build-wheel -i /workspaces/venv/bin/python3.14t --compatibility off`
  📦 Including license file "/tmp/pip-req-build-av9j5tr8/LICENSE"
  🍹 Building a mixed python/rust project
  🔗 Found pyo3 bindings
  🐍 Found CPython 3.14t at /workspaces/venv/bin/python3.14t
  📡 Using build options bindings from pyproject.toml
     Compiling target-lexicon v0.12.14
     Compiling python3-dll-a v0.2.10
     Compiling once_cell v1.19.0
     Compiling libc v0.2.154
     Compiling pyo3-build-config v0.22.2
     Compiling proc-macro2 v1.0.81
     Compiling unicode-ident v1.0.12
     Compiling quote v1.0.36
     Compiling pyo3-ffi v0.22.2
     Compiling pyo3-macros-backend v0.22.2
     Compiling crossbeam-utils v0.8.19
     Compiling autocfg v1.3.0
  error: failed to run custom build command for `pyo3-ffi v0.22.2`

  Caused by:
    process didn't exit successfully: `/tmp/pip-req-build-av9j5tr8/target/release/build/pyo3-ffi-45464569400b73b2/build-script-build` (exit status: 1)
    --- stdout
    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.22.2
    = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
  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" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-req-build-av9j5tr8/Cargo.toml" "--release" "--lib"`
  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/workspaces/venv/bin/python3.14t', '--compatibility', 'off'] returned non-zero exit status 1
  error: subprocess-exited-with-error
  
  × Building wheel for watchfiles (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/tmpcae05_ad
  cwd: /tmp/pip-req-build-av9j5tr8
  Building wheel for watchfiles (pyproject.toml) ... error
  ERROR: Failed building wheel for watchfiles
Failed to build watchfiles
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (watchfiles)

However:

(venv) @clin1234 ➜ /workspaces/pydantic-core (main) $ PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 pip install git+https://github.com/samuelcol
vin/watchfiles -v
Using pip 24.2 from /workspaces/venv/lib/python3.14t/site-packages/pip (python 3.14)
Collecting git+https://github.com/samuelcolvin/watchfiles
  Cloning https://github.com/samuelcolvin/watchfiles to /tmp/pip-req-build-5fh17_id
  Running command git version
  git version 2.45.2
  Running command git clone --filter=blob:none https://github.com/samuelcolvin/watchfiles /tmp/pip-req-build-5fh17_id
  Cloning into '/tmp/pip-req-build-5fh17_id'...
  Running command git rev-parse HEAD
  4314094e5ee37dcd3d1986cbcead4b1fd141afe5
  Resolved https://github.com/samuelcolvin/watchfiles to commit 4314094e5ee37dcd3d1986cbcead4b1fd141afe5
  Running command git rev-parse HEAD
  4314094e5ee37dcd3d1986cbcead4b1fd141afe5
  Running command pip subprocess to install build dependencies
  Using pip 24.2 from /workspaces/venv/lib/python3.14t/site-packages/pip (python 3.14)
  Collecting maturin<2,>=0.14.16
    Obtaining dependency information for maturin<2,>=0.14.16 from https://files.pythonhosted.org/packages/2b/f9/98ba27c5f7c031f12d11cb64651c44730eb566cd10b3080f9a498c210b7e/maturin-1.7.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl.metadata
    Using cached maturin-1.7.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl.metadata (18 kB)
  Using cached maturin-1.7.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl (8.8 MB)
  Installing collected packages: maturin
  Successfully installed maturin-1.7.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  📦 Including license file "/tmp/pip-req-build-5fh17_id/LICENSE"
  🍹 Building a mixed python/rust project
  🔗 Found pyo3 bindings
  🐍 Found CPython 3.14t at /workspaces/venv/bin/python3.14t
  📡 Using build options bindings from pyproject.toml
  watchfiles-0.0.0.dist-info
  Checking for Rust toolchain....
  Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-09f_bml4 --interpreter /workspaces/venv/bin/python3.14t`
  Preparing metadata (pyproject.toml) ... done
Collecting anyio>=3.0.0 (from watchfiles==0.0.0)
  Obtaining dependency information for anyio>=3.0.0 from https://files.pythonhosted.org/packages/7b/a2/10639a79341f6c019dedc95bd48a4928eed9f1d1197f4c04f546fc7ae0ff/anyio-4.4.0-py3-none-any.whl.metadata
  Using cached anyio-4.4.0-py3-none-any.whl.metadata (4.6 kB)
Collecting idna>=2.8 (from anyio>=3.0.0->watchfiles==0.0.0)
  Obtaining dependency information for idna>=2.8 from https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl.metadata
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting sniffio>=1.1 (from anyio>=3.0.0->watchfiles==0.0.0)
  Obtaining dependency information for sniffio>=1.1 from https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl.metadata
  Using cached sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
Using cached anyio-4.4.0-py3-none-any.whl (86 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
Building wheels for collected packages: watchfiles
  Running command Building wheel for watchfiles (pyproject.toml)
  Running `maturin pep517 build-wheel -i /workspaces/venv/bin/python3.14t --compatibility off`
  📦 Including license file "/tmp/pip-req-build-5fh17_id/LICENSE"
  🍹 Building a mixed python/rust project
  🔗 Found pyo3 bindings
  🐍 Found CPython 3.14t at /workspaces/venv/bin/python3.14t
  📡 Using build options bindings from pyproject.toml
     Compiling target-lexicon v0.12.14
     Compiling python3-dll-a v0.2.10
     Compiling once_cell v1.19.0
     Compiling libc v0.2.154
     Compiling pyo3-build-config v0.22.2
     Compiling proc-macro2 v1.0.81
     Compiling unicode-ident v1.0.12
     Compiling quote v1.0.36
     Compiling pyo3-macros-backend v0.22.2
     Compiling pyo3-ffi v0.22.2
     Compiling autocfg v1.3.0
     Compiling crossbeam-utils v0.8.19
     Compiling memoffset v0.9.1
     Compiling syn v2.0.60
     Compiling cfg-if v1.0.0
     Compiling heck v0.5.0
     Compiling pyo3 v0.22.2
     Compiling inotify-sys v0.1.5
     Compiling bitflags v1.3.2
     Compiling log v0.4.21
     Compiling same-file v1.0.6
     Compiling walkdir v2.5.0
     Compiling mio v0.8.11
     Compiling inotify v0.9.6
     Compiling crossbeam-channel v0.5.12
     Compiling filetime v0.2.23
     Compiling pyo3-macros v0.22.2
     Compiling indoc v2.0.5
     Compiling unindent v0.2.3
     Compiling notify v6.1.1
     Compiling watchfiles_rust_notify v0.0.0 (/tmp/pip-req-build-5fh17_id)
      Finished release [optimized] target(s) in 36.41s
  📦 Built wheel for CPython 3.14t to /tmp/pip-req-build-5fh17_id/target/wheels/watchfiles-0.0.0-cp314-cp314t-linux_x86_64.whl
  /tmp/pip-req-build-5fh17_id/target/wheels/watchfiles-0.0.0-cp314-cp314t-linux_x86_64.whl
  Building wheel for watchfiles (pyproject.toml) ... done
  Created wheel for watchfiles: filename=watchfiles-0.0.0-cp314-cp314t-linux_x86_64.whl size=3142596 sha256=d8e3948e4f8b89d1889b05dd67183d5b1ba90d8e5f42fffcc4f14051bfa4d7f3
  Stored in directory: /tmp/pip-ephem-wheel-cache-srendf96/wheels/f1/25/96/ceb5dc47db732a9ba3b2968d383c4178b37e945ddac9d7ad81
Successfully built watchfiles
Installing collected packages: sniffio, idna, anyio, watchfiles
  changing mode of /workspaces/venv/bin/watchfiles to 777
Successfully installed anyio-4.4.0 idna-3.7 sniffio-1.3.1 watchfiles-0.0.0
@samuelcolvin
Copy link
Owner

Creating issues like this with no description or suggestions is not particularly friendly.

Especially when you're trying to build with Python 3.14!

@clin1234
Copy link
Author

What I was trying to say is that exporting PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 will allow compilation to succeed with Python versions that pyo3 does not officially support yet.

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