sayanarijit / xplr

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

dependency issue: ratatui #625

Closed uncomfyhalomacro closed 1 year ago

uncomfyhalomacro commented 1 year ago

It seems I am unable to build xplr because of the following error:

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

error[E0308]: mismatched types
   --> 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 `ratatui::text::Text<'a>`, found `ratatui::text::Text<'_>`
    |
    = note: `ratatui::text::Text<'_>` and `ratatui::text::Text<'a>` have similar names, but are actually distinct types
note: `ratatui::text::Text<'_>` is defined in crate `ratatui`
   --> /home/uncomfy/development/projects/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.21.0/src/text.rs:264:1
    |
264 | pub struct Text<'a> {
    | ^^^^^^^^^^^^^^^^^^^
note: `ratatui::text::Text<'a>` is defined in crate `ratatui`
   --> /home/uncomfy/development/projects/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.20.1/src/text.rs:277:1
    |
277 | 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`.

I was trying to check why xplr failed to build in https://build.opensuse.org/package/show/utilities/xplr and I seem to get the exact same error.

sayanarijit commented 1 year ago

Thanks for reporting. Does %{cargo_build} --locked work?

georgiancamarasan commented 1 year ago

I got the same error, but using --locked worked for me. Thanks.

uncomfyhalomacro commented 1 year ago

@sayanarijit I resolved it. I just need to set the opensuse service file to not update the deps.

theoparis commented 1 year ago

The proper solution seems to be to update ratatui to 0.21.0.