rye icon indicating copy to clipboard operation
rye copied to clipboard

failed to run `rye build` if the package is a larger cargo project workspace member

Open Lips7 opened this issue 1 year ago • 1 comments

Steps to Reproduce

  1. init a project inside a cargo project
  2. include the new project as a workspace member of the cargo project
  3. run rye build

Expected Result

build as same as maturin build

Actual Result

Matcher/matcher_py on  master [!⇡] is 📦 v0.4.3 via 🐍 v3.12.3 via 🦀 v1.81.0-nightly ❯ rye build
building matcher-py

  • Creating isolated environment: venv+uv...
  • Using external uv from /Users/lippsapple/.rye/uv/0.2.22/uv
  • Installing packages in isolated environment:
    • maturin>=1,<2
  • Getting build dependencies for sdist...
  • Building sdist... Running maturin pep517 write-sdist --sdist-directory /Users/lippsapple/Personal/project/Matcher/matcher_py/dist 🍹 Building a mixed python/rust project 🔗 Found pyo3 bindings 🐍 Found CPython 3.12 at /private/var/folders/2z/q88bfp8n6bz60g_sjh0_jcph0000gn/T/build-env-_t2h6c4u/bin/python3 📡 Using build options profile, bindings, rustc-args from pyproject.toml 📦 Built source distribution to /Users/lippsapple/Personal/project/Matcher/matcher_py/dist/matcher_py-0.4.3.tar.gz matcher_py-0.4.3.tar.gz
  • Building wheel from sdist
  • Creating isolated environment: venv+uv...
  • Using external uv from /Users/lippsapple/.rye/uv/0.2.22/uv
  • Installing packages in isolated environment:
    • maturin>=1,<2
  • Getting build dependencies for wheel...
  • Building wheel... Running maturin pep517 build-wheel -i /private/var/folders/2z/q88bfp8n6bz60g_sjh0_jcph0000gn/T/build-env-8wkeresb/bin/python --compatibility off error: failed to parse manifest at /private/var/folders/2z/q88bfp8n6bz60g_sjh0_jcph0000gn/T/build-via-sdist-7_59wuvs/matcher_py-0.4.3/matcher_py/Cargo.toml

Caused by: error inheriting edition from workspace root manifest's workspace.package.edition

Caused by: failed to find a workspace root 💥 maturin failed Caused by: Cargo metadata failed. Does your crate compile with cargo build? Caused by: cargo metadata exited with an error: Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/private/var/folders/2z/q88bfp8n6bz60g_sjh0_jcph0000gn/T/build-env-8wkeresb/bin/python', '--compatibility', 'off'] returned non-zero exit status 1

ERROR Backend subprocess exited when trying to invoke build_wheel error: failed to build dist

Version Info

rye 0.36.0 commit: 0.36.0 (12c024c7c 2024-07-07) platform: macos (aarch64) self-python: [email protected] symlink support: true uv enabled: true

Stacktrace

No response

Lips7 avatar Jul 11 '24 08:07 Lips7

maybe it is because rye build command move the entire project under /private, hence, the cargo.toml couldn't be recognized correctly.

Lips7 avatar Jul 11 '24 08:07 Lips7