kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.4k stars 150 forks source link

joshuto compile error #371

Closed og900aero closed 11 months ago

og900aero commented 1 year ago

I want build/compile joshuto on Debian unstable. I type the following commands:

  1. sudo cargo build
  2. sudo cargo install --path=. --force

And I get the following error messages on the end:

error[E0308]: mismatched types
   --> src/ui/widgets/tui_file_preview.rs:44:45
    |
44  |                     buf.set_line(area.x, y, line, area.width);
    |                         --------            ^^^^ expected struct `ratatui::text::Line`, found struct `ratatui::text::line::Line`
    |                         |
    |                         arguments to this function are incorrect
    |
    = note: struct `ratatui::text::line::Line` and struct `ratatui::text::Line` have similar names, but are actually distinct types
note: struct `ratatui::text::line::Line` is defined in crate `ratatui`
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ratatui-0.22.0/src/text/line.rs:8:1
    |
8   | pub struct Line<'a> {
    | ^^^^^^^^^^^^^^^^^^^
note: struct `ratatui::text::Line` is defined in crate `ratatui`
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ratatui-0.21.0/src/text/line.rs:6:1
    |
6   | pub struct Line<'a> {
    | ^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
note: associated function defined here
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ratatui-0.21.0/src/buffer.rs:333:12
    |
333 |     pub fn set_line(&mut self, x: u16, y: u16, line: &Line<'_>, width: u16) -> (u16, u16) {
    |            ^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `joshuto` due to previous error
error: failed to compile `joshuto v0.9.5 (https://github.com/kamiyaa/joshuto.git#a8dca77e)`, intermediate artifacts can be found at `/tmp/cargo-installxNDZMN`
S1M1S commented 1 year ago

Exact same error here when running cargo install-update joshuto

hotleave commented 1 year ago

I have the same error when install with cargo install --path . --force,but cargo build --release is OK,so just copy target/release/joshuto to ~/.cargo/bin,and done

og900aero commented 1 year ago

I have the same error when install with cargo install --path . --force,but cargo build --release is OK,so just copy target/release/joshuto to ~/.cargo/bin,and done

Thx. Working great.

kamiyaa commented 1 year ago

Should be fixed in 715b5fbdc62caeababee1857c696d0796805c3d3

S1M1S commented 1 year ago

cargo install --git https://github.com/kamiyaa/joshuto/ --branch main working with no errors for me

og900aero commented 1 year ago

Should be fixed in 715b5fb

I try, but not work.

kamiyaa commented 1 year ago

Should be fixed in 715b5fb

I try, but not work.

Whats the error?

og900aero commented 1 year ago

Should be fixed in 715b5fb

I try, but not work.

Whats the error?

Same the first comment.

xfzv commented 1 year ago

Can confirm I'm also getting the error reported by OP with cargo install joshuto.

EvanCarroll commented 1 year ago

The version on cargo is 0.9.5, which doesn't have the fix in 715b5fb. So cargo install joshuto won't work yet, use the previously provided command

cargo install --git https://github.com/kamiyaa/joshuto/ --branch main

for now until @kamiyaa pushes out a new version.

ubuntupunk commented 11 months ago

bump on raspberry pi

og900aero commented 11 months ago

cargo intall --locked xplr works.