Giter Club home page Giter Club logo

Comments (6)

AndrejOrsula avatar AndrejOrsula commented on August 23, 2024 1

Hmm, okay. I am unsure what's the origin of issue as I have not experienced this before. I will keep it in mind. Thanks for reporting the issue!

from pyo3_bindgen.

AndrejOrsula avatar AndrejOrsula commented on August 23, 2024

Hello @retrokiller543,

Hmm, I am not sure...
I am unable to reproduce the issue with cargo install --locked pyo3_bindgen_cli --version 0.4.0.

The crate pyo3_bindgen_macros is optionally re-exported when the macros feature is enabled (enabled by default). However, you could try one of these variants to see if anything changes:

cargo install --locked pyo3_bindgen_cli --version 0.4.0 --features pyo3_bindgen/macros

OR

cargo install --locked pyo3_bindgen_cli --version 0.4.0 --no-default-features

from pyo3_bindgen.

retrokiller543 avatar retrokiller543 commented on August 23, 2024

with features on:

cargo install --locked pyo3_bindgen_cli --version 0.4.0 --features pyo3_bindgen/macros
    Updating crates.io index
  Downloaded pyo3_bindgen_cli v0.4.0
  Downloaded 1 crate (11.3 KB) in 0.92s
  Installing pyo3_bindgen_cli v0.4.0
    Updating crates.io index
    Updating crates.io index
   Compiling pyo3_bindgen_engine v0.4.0
   Compiling pyo3_bindgen_macros v0.4.0
   Compiling typed-builder-macro v0.18.1
   Compiling thiserror-impl v1.0.57
   Compiling clap_derive v4.5.0
   Compiling typed-builder v0.18.1
   Compiling clap v4.5.1
   Compiling pyo3_bindgen v0.4.0
error[E0463]: can't find crate for `pyo3_bindgen_macros`
   --> /home/tosic-killer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3_bindgen-0.4.0/src/lib.rs:114:9
    |
114 | pub use pyo3_bindgen_macros::import_python;
    |         ^^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `pyo3_bindgen` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `pyo3_bindgen_cli v0.4.0`, intermediate artifacts can be found at `/tmp/cargo-installKOCdjh`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Without features:

cargo install --locked pyo3_bindgen_cli --version 0.4.0 --no-default-features
    Updating crates.io index
  Installing pyo3_bindgen_cli v0.4.0
    Updating crates.io index
    Updating crates.io index
   Compiling target-lexicon v0.12.14
   Compiling proc-macro2 v1.0.78
   Compiling once_cell v1.19.0
   Compiling autocfg v1.1.0
   Compiling libc v0.2.153
   Compiling unicode-ident v1.0.12
   Compiling parking_lot_core v0.9.9
   Compiling portable-atomic v1.6.0
   Compiling thiserror v1.0.57
   Compiling smallvec v1.13.1
   Compiling scopeguard v1.2.0
   Compiling cfg-if v1.0.0
   Compiling either v1.10.0
   Compiling utf8parse v0.2.1
   Compiling rustc-hash v1.1.0
   Compiling colorchoice v1.0.0
   Compiling anstyle v1.0.6
   Compiling anstyle-parse v0.2.3
   Compiling anstyle-query v1.0.2
   Compiling strsim v0.11.0
   Compiling clap_lex v0.7.0
   Compiling heck v0.4.1
   Compiling prettyplease v0.2.16
   Compiling itertools v0.12.1
   Compiling anstream v0.6.13
   Compiling lock_api v0.4.11
   Compiling memoffset v0.9.0
   Compiling clap_builder v4.5.1
   Compiling quote v1.0.35
   Compiling pyo3-build-config v0.20.3
   Compiling syn v2.0.52
   Compiling parking_lot v0.12.1
   Compiling pyo3-ffi v0.20.3
   Compiling pyo3 v0.20.3
   Compiling pyo3_bindgen_engine v0.4.0
   Compiling pyo3_bindgen_macros v0.4.0
   Compiling typed-builder-macro v0.18.1
   Compiling thiserror-impl v1.0.57
   Compiling clap_derive v4.5.0
   Compiling typed-builder v0.18.1
   Compiling clap v4.5.1
   Compiling pyo3_bindgen v0.4.0
error[E0463]: can't find crate for `pyo3_bindgen_macros`
   --> /home/tosic-killer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3_bindgen-0.4.0/src/lib.rs:114:9
    |
114 | pub use pyo3_bindgen_macros::import_python;
    |         ^^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `pyo3_bindgen` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `pyo3_bindgen_cli v0.4.0`, intermediate artifacts can be found at `/tmp/cargo-installEP4C55`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I can add that i have tested on 2 diffrent computers and both linux and windows and it gives the same result.

However a fun little thing I have found when i try to import it and use apart of my build script is that when running it on one of my computers in RustRover it works both when running it from the terminal and by using the runner in the IDE, but nowhere else on the system.

Also i tried cloning the repo and installing the cli from local files and changed some things in the cargo.toml of the main crate pyo3_bindgen to have these dependencies and features it worked to install.

[dependencies]
pyo3 = { workspace = true }
pyo3_bindgen_engine = { workspace = true }
pyo3_bindgen_macros = { workspace = true }

[features]
default = ["macros"]
macros = []

from pyo3_bindgen.

AndrejOrsula avatar AndrejOrsula commented on August 23, 2024

Interesting. By any chance, do you have something in your ~/.cargo/config.toml that could change the behavior?

I tried with 1.75.0, 1.78.0 and 1.80.0-nightly but I am unable to reproduce the issue.

from pyo3_bindgen.

retrokiller543 avatar retrokiller543 commented on August 23, 2024

I only have this in my config

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

I also tried running it in stable but it not make any difference what version of rust I'm running

from pyo3_bindgen.

AndrejOrsula avatar AndrejOrsula commented on August 23, 2024

I removed macros from the default features in 0.5.0. The feature must now be enabled explicitly.

It is not really a solution, but it should be optional regardless.
Hopefully, this will reduce the occurrence of similar issues.

from pyo3_bindgen.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.