gitui icon indicating copy to clipboard operation
gitui copied to clipboard

cargo install fails due to ratatui-version missmatch

Open NilsWer opened this issue 1 year ago • 2 comments

Describe the bug

cargo install gitui fails. ratatui version seems to be outdated at https://crates.io/crates/gitui/0.26.3/dependencies (^0.26) compared to Cargo.toml in git-repo (0.27) (https://github.com/extrawurst/gitui/commit/95bbbda9af9a31830b32f491a8308e667c017f94)

Compiling the git-repo works fine.

Reproduce

does not work

  1. cargo install gitui

works

  1. git clone [...] temp_dir
  2. cd temp_dir
  3. cargo run

Context (please complete the following information)

  • GitUI Version: 0.26.3
  • Rust version: 1.80

Additional context

Whole error:

[...] Compiling syntect v5.2.0 Compiling ratatui v0.26.3 Compiling crossterm v0.28.1 Compiling which v6.0.3 Compiling two-face v0.4.0 Compiling ratatui v0.28.1 Compiling tui-textarea v0.4.0 Compiling git2 v0.18.3 Compiling git2-hooks v0.3.3 Compiling asyncgit v0.26.3 error[E0308]: mismatched types --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:157:28 | 157 | .set_cursor_line_style(self.theme.text(true, false)); | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected ratatui::style::Style, found a differ | | | arguments to this method are incorrect | = note: ratatui::style::Style and ratatui::style::Style have similar names, but are actually distinct types note: ratatui::style::Style is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1 | 227 | pub struct Style { | ^^^^^^^^^^^^^^^^ note: ratatui::style::Style is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style.rs:228:1 | 228 | pub struct Style { | ^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate ratatui are being used? note: method defined here --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1770:12 | 1770 | pub fn set_cursor_line_style(&mut self, style: Style) { | ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:160:5 | 159 | text_area.set_placeholder_style( | --------------------- arguments to this method are incorrect 160 | / self.theme 161 | | .text(self.selected.unwrap_or_default(), false), | |___________________________________________________________________^ expected ratatui::style::Style, found a diff | = note: ratatui::style::Style and ratatui::style::Style have similar names, but are actually distinct types note: ratatui::style::Style is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1 | 227 | pub struct Style { | ^^^^^^^^^^^^^^^^ note: ratatui::style::Style is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style.rs:228:1 | 228 | pub struct Style { | ^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate ratatui are being used? note: method defined here --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1850:12 | 1850 | pub fn set_placeholder_style(&mut self, style: Style) { | ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:164:5 | 163 | text_area.set_style( | --------- arguments to this method are incorrect 164 | self.theme.text(self.selected.unwrap_or(true), false), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected ratatui::style::Style, found a diff | = note: ratatui::style::Style and ratatui::style::Style have similar names, but are actually distinct types note: ratatui::style::Style is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1 | 227 | pub struct Style { | ^^^^^^^^^^^^^^^^ note: ratatui::style::Style is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style.rs:228:1 | 228 | pub struct Style { | ^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate ratatui are being used? note: method defined here --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1629:12 | 1629 | pub fn set_style(&mut self, style: Style) { | ^^^^^^^^^

error[E0308]: mismatched types --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:169:6 | 168 | text_area.set_block( | --------- arguments to this method are incorrect 169 | / Block::default() 170 | | .borders(Borders::ALL) 171 | | .border_style( 172 | | ratatui::style::Style::default() ... | 176 | | ) 177 | | .title(self.title.clone()), | |__________________________________________________^ expected Block<'_>, found ratatui::widgets::Block<'_> | = note: ratatui::widgets::Block<'_> and Block<'_> have similar names, but are actually distinct types note: ratatui::widgets::Block<'_> is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/widgets/block.rs:64:1 | 64 | pub struct Block<'a> { | ^^^^^^^^^^^^^^^^^^^^ note: Block<'_> is defined in crate ratatui --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/widgets/block.rs:109:1 | 109 | pub struct Block<'a> { | ^^^^^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate ratatui are being used? note: method defined here --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1648:12 | 1648 | pub fn set_block(&mut self, block: Block<'a>) { | ^^^^^^^^^

error[E0277]: the trait bound impl ratatui::widgets::Widget + '_: Widget is not satisfied --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:644:20 | 644 | f.render_widget(ta.widget(), area); | ------------- ^^^^^^^^^^^ the trait Widget is not implemented for impl ratatui::widgets::Widget + '_ | | | required by a bound introduced by this call | = help: the following other types implement trait Widget: &W &str BarChart<'> Canvas<', F> Chart<'> Gauge<'> LineGauge<'> Paragraph<'> and 10 others note: required by a bound in ratatui::Frame::<'_>::render_widget --> /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/terminal/frame.rs:74:29 | 74 | pub fn render_widget<W: Widget>(&mut self, widget: W, area: Rect) { | ^^^^^^ required by this bound in Frame::<'_>::render_widget

Some errors have detailed explanations: E0277, E0308. For more information about an error, try rustc --explain E0277. The following warnings were emitted during compilation:

warning: [email protected]: buildname 'nightly 2024-08-28 (17ca14e)'

error: could not compile gitui (bin "gitui") due to 5 previous errors error: failed to compile gitui v0.26.3, intermediate artifacts can be found at /tmp/cargo-installfSFcy2. To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

NilsWer avatar Aug 28 '24 10:08 NilsWer

cargo install gitui --locked worked for me.

apraga avatar Sep 10 '24 20:09 apraga

this works for me too, using ratatui v0.26.3

I read a little in the book and --locked does not look like a good permanent solution to me.

The downside to using --locked is that you will not receive any fixes or updates to any dependency. Note that Cargo did not start publishing Cargo.lock files until version 1.37, which means packages published with prior versions will not have a Cargo.lock file available. https://doc.rust-lang.org/cargo/commands/cargo-install.html

NilsWer avatar Sep 10 '24 20:09 NilsWer