joshuto
joshuto copied to clipboard
cargo install fails on Debian and Ubuntu
I'm getting the following compile error with cargo install joshuto
error[E0308]: mismatched types
--> /home/parallels/.cargo/registry/src/index.crates.io-6f17d22bba15001f/joshuto-0.9.5/src/ui/widgets/tui_file_preview.rs:44:45
|
44 | buf.set_line(area.x, y, line, area.width);
| -------- ^^^^ expected `ratatui::text::Line<'_>`, found `ratatui::text::line::Line<'_>`
| |
| arguments to this method are incorrect
|
= note: `ratatui::text::line::Line<'_>` and `ratatui::text::Line<'_>` have similar names, but are actually distinct types
note: `ratatui::text::line::Line<'_>` is defined in crate `ratatui`
--> /home/parallels/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/text/line.rs:8:1
|
8 | pub struct Line<'a> {
| ^^^^^^^^^^^^^^^^^^^
note: `ratatui::text::Line<'_>` is defined in crate `ratatui`
--> /home/parallels/.cargo/registry/src/index.crates.io-6f17d22bba15001f/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: method defined here
--> /home/parallels/.cargo/registry/src/index.crates.io-6f17d22bba15001f/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` (bin "joshuto") due to previous error
uname -a
Linux debian-gnu-linux-12 6.1.0-9-arm64 #1 SMP Debian 6.1.27-1 (2023-05-08) aarch64 GNU/Linux
cargo install --git https://github.com/kamiyaa/joshuto.git
this works fine on my Ubuntu/Debian
I can reproduce this:
-
$ podman run --rm -it docker.io/library/rust:1.70-bookworm
-
$ cargo install joshuto
error[E0308]: mismatched types
--> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/joshuto-0.9.5/src/ui/widgets/tui_file_preview.rs:44:45
|
44 | buf.set_line(area.x, y, line, area.width);
| -------- ^^^^ expected `ratatui::text::Line<'_>`, found `Line<'_>`
| |
| arguments to this method are incorrect
|
= note: `Line<'_>` and `ratatui::text::Line<'_>` have similar names, but are actually distinct types
note: `Line<'_>` is defined in crate `ratatui`
--> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.24.0/src/text/line.rs:7:1
|
7 | pub struct Line<'a> {
| ^^^^^^^^^^^^^^^^^^^
note: `ratatui::text::Line<'_>` is defined in crate `ratatui`
--> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/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: method defined here
--> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/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` (bin "joshuto") due to previous error
error: failed to compile `joshuto v0.9.5`, intermediate artifacts can be found at `/tmp/cargo-installsHm6xN`
-
$ cargo install --git https://github.com/kamiyaa/joshuto.git
within the same container works just fine:
...
Compiling joshuto v0.9.5 (/usr/local/cargo/git/checkouts/joshuto-a6af16d32728ea1c/2796e82)
Finished release [optimized] target(s) in 1m 45s
Installing /usr/local/cargo/bin/joshuto
Installed package `joshuto v0.9.5 (https://github.com/kamiyaa/joshuto.git#2796e82a)` (executable `joshuto`)
$ joshuto --version
joshuto-0.9.5
$ uname -a
Linux 23c043e966eb 6.5.9-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 25 20:40:49 UTC 2023 x86_64 GNU/Linux
I am OK if you close this issue with "won't fix" because it's documented correctly in the README: https://github.com/kamiyaa/joshuto#for-single-user-with-cargo
I can reproduce this:
* `$ podman run --rm -it docker.io/library/rust:1.70-bookworm` * `$ cargo install joshuto`
error[E0308]: mismatched types --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/joshuto-0.9.5/src/ui/widgets/tui_file_preview.rs:44:45 | 44 | buf.set_line(area.x, y, line, area.width); | -------- ^^^^ expected `ratatui::text::Line<'_>`, found `Line<'_>` | | | arguments to this method are incorrect | = note: `Line<'_>` and `ratatui::text::Line<'_>` have similar names, but are actually distinct types note: `Line<'_>` is defined in crate `ratatui` --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.24.0/src/text/line.rs:7:1 | 7 | pub struct Line<'a> { | ^^^^^^^^^^^^^^^^^^^ note: `ratatui::text::Line<'_>` is defined in crate `ratatui` --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/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: method defined here --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/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` (bin "joshuto") due to previous error error: failed to compile `joshuto v0.9.5`, intermediate artifacts can be found at `/tmp/cargo-installsHm6xN`
* `$ cargo install --git https://github.com/kamiyaa/joshuto.git` within the same container works just fine:
... Compiling joshuto v0.9.5 (/usr/local/cargo/git/checkouts/joshuto-a6af16d32728ea1c/2796e82) Finished release [optimized] target(s) in 1m 45s Installing /usr/local/cargo/bin/joshuto Installed package `joshuto v0.9.5 (https://github.com/kamiyaa/joshuto.git#2796e82a)` (executable `joshuto`) $ joshuto --version joshuto-0.9.5 $ uname -a Linux 23c043e966eb 6.5.9-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 25 20:40:49 UTC 2023 x86_64 GNU/Linux
I am OK if you close this issue with "won't fix" because it's documented correctly in the README: https://github.com/kamiyaa/joshuto#for-single-user-with-cargo
Can you try this inside of docker ?
rustup update
If I'm not wrong, it seems like some update issue.
Thanks for your suggestion. I've tested this but to no avail:
$ podman run --rm -it docker.io/library/rust:1.70-bookworm
$ rustup update
$ cargo install joshuto
$ rustup update
$ cargo install joshuto
This results in the same error as above.
stdout from your suggestion (same before and after failed installation):
$ rustup update
info: no updatable toolchains installed
info: checking for self-update
info: cleaning up downloads & tmp directories