y-crdt/ypy

Unable to install with Rust compiliation error

ethankhall opened this issue · 3 comments

Description

I'm trying to install ypy as a transitive dependency and am getting the following error. I tried with 0.5.0 and 0.5.2 with the same result.

> rustc -V
rustc 1.57.0 (f1edd0429 2021-11-29)

> cargo -V
cargo 1.57.0 (b2e52d7ca 2021-10-21)

> maturin --help
maturin 0.12.20

> pipenv --version
pipenv, version 2022.6.7

> python --version
Python 3.8.9

> pipenv install y-py==0.5.0
Installing y-py==0.5.0...
Error:  An error occurred while installing y-py==0.5.0!
Error text: Collecting y-py==0.5.0
  Downloading y_py-0.5.0.tar.gz (36 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: y-py
  Building wheel for y-py (pyproject.toml): started
  Building wheel for y-py (pyproject.toml): finished with status 'error'
Failed to build y-py

  error: subprocess-exited-with-error

  × Building wheel for y-py (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [85 lines of output]
      Running `maturin pep517 build-wheel -i /Users/ethan/.local/share/virtualenvs/3d-models-8Ws8ixiA/bin/python --compatibility off`
      ⚠️  Warning: Please use maturin in pyproject.toml with a version constraint, e.g. `requires = ["maturin>=0.12,<0.13"]`. This will become an error.
         Compiling proc-macro2 v1.0.40
         Compiling libc v0.2.126
         Compiling unicode-ident v1.0.1
         Compiling quote v1.0.20
         Compiling target-lexicon v0.12.4
         Compiling syn v1.0.98
         Compiling cfg-if v1.0.0
         Compiling wasm-bindgen-shared v0.2.81
         Compiling once_cell v1.12.1
         Compiling log v0.4.17
         Compiling getrandom v0.1.16
         Compiling autocfg v1.1.0
         Compiling smallvec v1.9.0
         Compiling lazy_static v1.4.0
         Compiling bumpalo v3.10.0
         Compiling parking_lot_core v0.9.3
         Compiling wasm-bindgen v0.2.81
         Compiling ppv-lite86 v0.2.16
         Compiling scopeguard v1.1.0
         Compiling unindent v0.1.9
         Compiling indoc v1.0.6
         Compiling lib0 v0.7.1
         Compiling smallstr v0.2.0
         Compiling lock_api v0.4.7
         Compiling pyo3-build-config v0.16.5
         Compiling rand_core v0.5.1
         Compiling parking_lot v0.12.1
         Compiling rand_chacha v0.2.2
         Compiling rand v0.7.3
         Compiling pyo3-ffi v0.16.5
         Compiling pyo3 v0.16.5
         Compiling wasm-bindgen-backend v0.2.81
         Compiling pyo3-macros-backend v0.16.5
         Compiling wasm-bindgen-macro-support v0.2.81
         Compiling wasm-bindgen-macro v0.2.81
         Compiling pyo3-macros v0.16.5
         Compiling yrs v0.7.1
         Compiling y-py v0.5.0 (/private/var/folders/gq/cpjxq2196f3dmyj7hjs8pv_h0000gn/T/pip-install-90z9pgas/y-py_d793641b962c41ff8c6ae81ddc8ee697)
      error: could not compile `y-py` due to 6 previous errors
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `cargo rustc --manifest-path Cargo.toml --message-format json --release --lib -- -C link-arg=-undefined -C link-arg=dynamic_lookup -C link-args=-Wl,-install_name,@rpath/y_py.cpython-38-darwin.so`
      🔗 Found pyo3 bindings
      🐍 Found CPython 3.8 at /Users/ethan/.local/share/virtualenvs/3d-models-8Ws8ixiA/bin/python
      error: there is no argument named `shared`
         --> src/type_conversions.rs:252:102
          |
      252 |                     "Cannot integrate a nested Ypy object because is already integrated into a YDoc: {shared}"
          |                                                                                                      ^^^^^^^^


      error: there is no argument named `v`
         --> src/type_conversions.rs:267:98
          |
      267 |                 "Cannot integrate a nested Ypy object because is already integrated into a YDoc: {v}"
          |                                                                                                  ^^^


      error: there is no argument named `v`
         --> src/type_conversions.rs:271:58
          |
      271 |                 "Cannot integrate this type into a YDoc: {v}"
          |                                                          ^^^


      error: there is no argument named `key`
         --> src/y_map.rs:161:46
          |
      161 |             Err(PyKeyError::new_err(format!("{key}")))
          |                                              ^^^^^


      error: there is no argument named `key`
         --> src/y_map.rs:182:58
          |
      182 |         entry.ok_or_else(|| PyKeyError::new_err(format!("{key}")))
          |                                                          ^^^^^


      error: aborting due to 5 previous errors


      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/ethan/.local/share/virtualenvs/3d-models-8Ws8ixiA/bin/python', '--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 y-py
ERROR: Could not build wheels for y-py, which is required to install pyproject.toml-based projects

Building on an M1 Mac

Looks like the Rust compiler version is not up to date. Captured identifiers in format strings came in v1.58.

I think if a rust-toolchain/rust-toolchain.toml file were added, then cargo would automatically install the repo's required version.

Added a rust-version to the Cargo.toml. This will force a minimum rustc version of 1.58.