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

Cargo install on Windows fails while compiling monotrail-utils #647

Closed
fleimgruber opened this issue Feb 12, 2024 · 2 comments · Fixed by #648
Closed

Cargo install on Windows fails while compiling monotrail-utils #647

fleimgruber opened this issue Feb 12, 2024 · 2 comments · Fixed by #648

Comments

@fleimgruber
Copy link

Steps to Reproduce

  1. cargo install --git https://github.com/mitsuhiko/rye --tag 0.22.0 rye

Expected Result

rye is installed via Cargo

Actual Result

   ...
   Compiling monotrail-utils v0.0.1 (https://github.com/konstin/poc-monotrail?rev=136807e1fe87e9319e0223f76b602ba5db881322#136807e1)
error[E0308]: mismatched types
   --> rye\src\cli\add.rs:323:21
    |
322 |                   requirement.version_or_url = Some(VersionOrUrl::VersionSpecifier(
    |                                                     ------------------------------ arguments to this enum variant are incorrect
323 | /                     VersionSpecifiers::from_iter(Some(
324 | |                         VersionSpecifier::new(
325 | |                             // local versions or versions with only one component cannot
326 | |                             // use ~= but need to use ==.
...   |
338 | |                         .map_err(|msg| anyhow!("invalid version specifier: {}", msg))?,
339 | |                     )),
    | |______________________^ expected `VersionSpecifiers`, found a different `VersionSpecifiers`
    |
    = note: `VersionSpecifiers` and `VersionSpecifiers` have similar names, but are actually distinct types
note: `VersionSpecifiers` is defined in crate `pep440_rs`
   --> C:\Users\LeimgruberF\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pep440_rs-0.4.0\src\version_specifier.rs:58:1
    |
58  | pub struct VersionSpecifiers(Vec<VersionSpecifier>);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `VersionSpecifiers` is defined in crate `pep440_rs`
   --> C:\Users\LeimgruberF\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pep440_rs-0.3.12\src\version_specifier.rs:58:1
    |
58  | pub struct VersionSpecifiers(Vec<VersionSpecifier>);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `pep440_rs` are being used?
note: tuple variant defined here
   --> C:\Users\LeimgruberF\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pep508_rs-0.2.3\src\lib.rs:371:5
    |
371 |     VersionSpecifier(VersionSpecifiers),
    |     ^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rye` (bin "rye") due to 1 previous error
error: failed to compile `rye v0.22.0 (https://github.com/mitsuhiko/rye?tag=0.22.0#203a0f33)`, intermediate artifacts can be found at `C:\Users\LEIMGR~1\AppData\Local\Temp\cargo-installN44umq`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Version Info

OS: Windows
Rust toolchain: stable-x86_64-pc-windows-msvc (default), rustc 1.76.0 (07dca489a 2024-02-04)

Stacktrace

No response

@fleimgruber fleimgruber changed the title Cargo install fails compiling monotrail-utils Cargo install on Windows fails while compiling monotrail-utils Feb 12, 2024
@RGGH
Copy link

RGGH commented Feb 12, 2024

Not just windows, I get the VersionSpecifier(VersionSpecifiers) error when doing a Cargo install on Linux Mint as well.

@mitsuhiko
Copy link
Collaborator

For now pass --locked so that it picks up the version in the Cargo.lock. Refs #624

mitsuhiko added a commit that referenced this issue Feb 12, 2024
j178 pushed a commit to j178/rye that referenced this issue Feb 18, 2024
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

Successfully merging a pull request may close this issue.

3 participants