gitui icon indicating copy to clipboard operation
gitui copied to clipboard

ratatui update

Open extrawurst opened this issue 1 year ago β€’ 8 comments

based off of #1959

  • we need to work upstream first so we can update to a ratatui that does not adds back the syn 1.x dependency
  • then update gitui to accommodate for some required changes

extrawurst avatar Feb 20 '24 18:02 extrawurst

Is this why master is not building for me?

error[E0308]: mismatched types
    --> src/components/textinput.rs:163:6
     |
162  |                   text_area.set_block(
     |                             --------- arguments to this method are incorrect
163  | /                     Block::default()
164  | |                         .borders(Borders::ALL)
165  | |                         .border_style(
166  | |                             ratatui::style::Style::default()
...    |
170  | |                         )
171  | |                         .title(self.title.clone()),
     | |__________________________________________________^ expected `ratatui::widgets::block::Block<'_>`, found `ratatui::widgets::Block<'_>`
     |
     = note: `ratatui::widgets::Block<'_>` and `ratatui::widgets::block::Block<'_>` have similar names, but are actually distinct types
note: `ratatui::widgets::Block<'_>` is defined in crate `ratatui`
    --> /home/dave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.24.0/src/widgets/block.rs:230:1
     |
230  | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /home/dave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.1/src/widgets/block.rs:64:1
     |
64   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/dave/.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
   --> src/components/textinput.rs:638:20
    |
638 |             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`:
              BarChart<'a>
              ratatui::widgets::Block<'a>
              Canvas<'a, F>
              Chart<'a>
              ratatui::widgets::Clear
              Gauge<'a>
              LineGauge<'a>
              ratatui::widgets::List<'a>
            and 4 others
note: required by a bound in `ratatui::Frame::<'_>::render_widget`

dam5h avatar Feb 21 '24 13:02 dam5h

No that looks suspicious. Have you tried a clean build?

as you can see all CI builds work. So I assume it’s something specific to your local env

extrawurst avatar Feb 21 '24 14:02 extrawurst

I get the same error if I run cargo install gitui. I tried a cargo uninstall gitui and re-installed and I get the same error.

If I run cargo build --release from the repo (master branch) it works fine.

Does cargo install pull something other than the master branch?

One thing I noticed, when I run cargo build --release:

...
   Compiling ron v0.8.1
   Compiling syntect v5.2.0
   Compiling ratatui v0.24.0
   Compiling which v6.0.0
   Compiling tui-textarea v0.4.0
...

When I run cargo install gitui:

...
   Compiling ron v0.8.1
   Compiling syntect v5.2.0
   Compiling ratatui v0.26.1
   Compiling ratatui v0.24.0
   Compiling which v6.0.0
   Compiling tui-textarea v0.4.0
...

louisbourque avatar Feb 21 '24 16:02 louisbourque

can you try cargo install gitui --locked please?

extrawurst avatar Feb 21 '24 16:02 extrawurst

can you try cargo install gitui --locked please?

That worked perfectly! Thanks!

louisbourque avatar Feb 21 '24 16:02 louisbourque

i am going to update the readme accordingly

extrawurst avatar Feb 21 '24 16:02 extrawurst

Ah, great news, thanks for the tip, --locked works great. Excited to check out the latest changes :+1:

dam5h avatar Feb 22 '24 04:02 dam5h

Now blocked on textarea: https://github.com/rhysd/tui-textarea/issues/60

extrawurst avatar Apr 24 '24 23:04 extrawurst