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 xplr FAILS #667

Closed
FedericoMuciaccia opened this issue Sep 18, 2023 · 6 comments
Closed

cargo install xplr FAILS #667

FedericoMuciaccia opened this issue Sep 18, 2023 · 6 comments

Comments

@FedericoMuciaccia
Copy link

I have a fresh Debian 12 OS with a fresh Rust installation

if I run cargo intall xplr I get the following error:

   Compiling xplr v0.21.3
error[E0308]: mismatched types
  --> /home/federico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xplr-0.21.3/src/ui.rs:50:33
   |
50 |             .unwrap_or_else(|e| Text::raw(format!("{e:?}")))
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Text<'_>`, found a different `Text<'_>`
   |
   = note: `Text<'_>` and `Text<'_>` have similar names, but are actually distinct types
note: `Text<'_>` is defined in crate `ratatui`
  --> /home/federico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/text/text.rs:32:1
   |
32 | pub struct Text<'a> {
   | ^^^^^^^^^^^^^^^^^^^
note: `Text<'_>` is defined in crate `ratatui`
  --> /home/federico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/text/text.rs:32:1
   |
32 | pub struct Text<'a> {
   | ^^^^^^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `ratatui` are being used?

error[E0308]: mismatched types
  --> /home/federico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xplr-0.21.3/src/ui.rs:47:9
   |
43 |   pub fn string_to_text<'a>(string: String) -> Text<'a> {
   |                                                -------- expected `ratatui::text::Text<'a>` because of return type
...
47 | /         string
48 | |             .as_bytes()
49 | |             .into_text()
50 | |             .unwrap_or_else(|e| Text::raw(format!("{e:?}")))
   | |____________________________________________________________^ expected `Text<'a>`, found `Text<'_>`
   |
   = note: `Text<'_>` and `Text<'a>` have similar names, but are actually distinct types
note: `Text<'_>` is defined in crate `ratatui`
  --> /home/federico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/text/text.rs:32:1
   |
32 | pub struct Text<'a> {
   | ^^^^^^^^^^^^^^^^^^^
note: `Text<'a>` is defined in crate `ratatui`
  --> /home/federico/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/text/text.rs:32:1
   |
32 | pub struct Text<'a> {
   | ^^^^^^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `ratatui` are being used?

For more information about this error, try `rustc --explain E0308`.
error: could not compile `xplr` (lib) due to 2 previous errors
error: failed to compile `xplr v0.21.3`, intermediate artifacts can be found at `/tmp/cargo-installIMkWCS`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
@FedericoMuciaccia
Copy link
Author

typo: cargo install xplr

@FedericoMuciaccia
Copy link
Author

as a sidenote, joshuto had a similar issue; which is now fixed
kamiyaa/joshuto#371
(maybe it can help)

@sayanarijit
Copy link
Owner

Pls use --locked

@FedericoMuciaccia
Copy link
Author

cargo intall --locked xplr made the compilation ok.

Why is --locked necessary here?
Can it be avoided with future releases of ratatui and xplr ?

@sayanarijit
Copy link
Owner

It uses Cargo.lock to install the pinned dependencies, rather than trying to use the latest versions.

@sayanarijit
Copy link
Owner

Closing this.

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

No branches or pull requests

2 participants