sayanarijit / xplr

A hackable, minimal, fast TUI file explorer
https://xplr.dev
MIT License
4.06k stars 75 forks source link

cargo install xplr FAILS #667

Closed FedericoMuciaccia closed 9 months ago

FedericoMuciaccia commented 9 months ago

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 commented 9 months ago

typo: cargo install xplr

FedericoMuciaccia commented 9 months ago

as a sidenote, joshuto had a similar issue; which is now fixed https://github.com/kamiyaa/joshuto/issues/371 (maybe it can help)

sayanarijit commented 9 months ago

Pls use --locked

FedericoMuciaccia commented 9 months ago

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 commented 9 months ago

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

sayanarijit commented 9 months ago

Closing this.