Skip to content

Error building wheel for rustpython_ast (pyo3) #115

@pawamoy

Description

@pawamoy

I cloned the repository, entered the ast-pyo3 directory, and ran pyproject-build:

% pyproject-build 
* Creating venv isolated environment...
* Installing packages in isolated environment... (maturin>=0.15,<0.16)
* Getting build dependencies for sdist...
* Building sdist...
Running `maturin pep517 write-sdist --sdist-directory /media/data/dev/griffe/rustpython_parser/ast-pyo3/dist`
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
🐍 Found CPython 3.11 at /tmp/build-env-m11693t3/bin/python3
📡 Using build options features from pyproject.toml
📦 Built source distribution to /media/data/dev/griffe/rustpython_parser/ast-pyo3/dist/rustpython_ast-0.0.1.tar.gz
rustpython_ast-0.0.1.tar.gz
* Building wheel from sdist
* Creating venv isolated environment...
* Installing packages in isolated environment... (maturin>=0.15,<0.16)
* Getting build dependencies for wheel...
* Building wheel...
Running `maturin pep517 build-wheel -i /tmp/build-env-ra719lal/bin/python --compatibility off`
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
🐍 Found CPython 3.11 at /tmp/build-env-ra719lal/bin/python
📡 Using build options features from pyproject.toml
   Compiling autocfg v1.1.0
   Compiling libc v0.2.153
   Compiling proc-macro2 v1.0.79
   Compiling cfg-if v1.0.0
   Compiling unicode-ident v1.0.12
   Compiling target-lexicon v0.12.14
   Compiling version_check v0.9.4
   Compiling once_cell v1.19.0
   Compiling ppv-lite86 v0.2.17
   Compiling ahash v0.8.11
   Compiling siphasher v0.3.11
   Compiling num-traits v0.2.18
   Compiling phf_shared v0.11.2
   Compiling libm v0.2.8
   Compiling zerocopy v0.7.32
   Compiling syn v1.0.109
   Compiling pyo3-build-config v0.19.2
   Compiling getrandom v0.2.12
   Compiling quote v1.0.35
   Compiling rand_core v0.6.4
   Compiling either v1.10.0
   Compiling hashbrown v0.14.3
   Compiling rand_chacha v0.3.1
   Compiling itertools v0.11.0
   Compiling rand v0.8.5
   Compiling ryu v1.0.17
   Compiling phf_generator v0.11.2
   Compiling phf_codegen v0.11.2
   Compiling unicode-width v0.1.11
   Compiling crunchy v0.2.2
   Compiling getopts v0.2.21
   Compiling malachite-base v0.4.5
   Compiling num-integer v0.1.46
   Compiling num-bigint v0.4.4
   Compiling anyhow v1.0.81
   Compiling log v0.4.21
   Compiling tiny-keccak v2.0.2
   Compiling paste v1.0.14
   Compiling unicode_names2_generator v1.2.2
   Compiling pyo3-ffi v0.19.2
   Compiling syn v2.0.53
   Compiling lock_api v0.4.11
   Compiling parking_lot_core v0.9.9
   Compiling unic-char-range v0.9.0
   Compiling unic-common v0.9.0
   Compiling memchr v2.7.1
   Compiling Inflector v0.11.4
   Compiling convert_case v0.4.0
   Compiling unicode_names2 v1.2.2
   Compiling rustpython-parser-vendored v0.3.1 (/tmp/build-via-sdist-_6kryhu2/rustpython_ast-0.0.1/local_dependencies/rustpython-parser-vendored)
   Compiling unic-ucd-version v0.9.0
   Compiling unic-char-property v0.9.0
   Compiling memoffset v0.9.0
   Compiling smallvec v1.13.2
   Compiling scopeguard v1.2.0
   Compiling derive_more v0.99.17
   Compiling rustpython-parser v0.3.1 (/tmp/build-via-sdist-_6kryhu2/rustpython_ast-0.0.1/local_dependencies/rustpython-parser)
   Compiling phf v0.11.2
   Compiling pyo3-macros-backend v0.19.2
   Compiling pyo3 v0.19.2
   Compiling malachite-nz v0.4.5
   Compiling is-macro v0.3.5
   Compiling static_assertions v1.1.0
   Compiling rustpython-parser-core v0.3.1 (/tmp/build-via-sdist-_6kryhu2/rustpython_ast-0.0.1/local_dependencies/rustpython-parser-core)
   Compiling parking_lot v0.12.1
   Compiling pyo3-macros v0.19.2
   Compiling unic-emoji-char v0.9.0
   Compiling unic-ucd-ident v0.9.0
   Compiling num-complex v0.4.5
   Compiling unindent v0.1.11
   Compiling lalrpop-util v0.20.2
   Compiling indoc v1.0.9
   Compiling rustc-hash v1.1.0
   Compiling malachite-q v0.4.5
   Compiling malachite v0.4.5
   Compiling malachite-bigint v0.2.0
   Compiling rustpython-ast v0.3.1 (/tmp/build-via-sdist-_6kryhu2/rustpython_ast-0.0.1/local_dependencies/rustpython-ast)
error[E0252]: the name `bigint` is defined multiple times
  --> local_dependencies/rustpython-ast/src/lib.rs:28:9
   |
26 | pub use malachite_bigint as bigint;
   |         -------------------------- previous import of the module `bigint` here
27 | #[cfg(feature = "num-bigint")]
28 | pub use num_bigint as bigint;
   |         ^^^^^^^^^^^^^^^^^^^^ `bigint` reimported here
   |
   = note: `bigint` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
   |
28 | pub use num_bigint as other_bigint;
   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~

warning: unused import: `num_bigint as bigint`
  --> local_dependencies/rustpython-ast/src/lib.rs:28:9
   |
28 | pub use num_bigint as bigint;
   |         ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0252`.
warning: `rustpython-ast` (lib) generated 1 warning
error: could not compile `rustpython-ast` (lib) due to 1 previous error; 1 warning emitted
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": `PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/tmp/build-env-ra719lal/bin/python" PYTHON_SYS_EXECUTABLE="/tmp/build-env-ra719lal/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/build-via-sdist-_6kryhu2/rustpython_ast-0.0.1/Cargo.toml" "--release" "--lib"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/build-env-ra719lal/bin/python', '--compatibility', 'off'] returned non-zero exit status 1

ERROR Backend subprocess exited when trying to invoke build_wheel

Any hint on how to fix that 🙂?

As to why I'm trying to build it, well, I'd like to try it in a project of mine to see how well it performs and how much work it would need to use it instead of Python's ast.

Quick question by the way: it builds an Abstract Syntax Tree and not a Concrete Syntax Tree right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions