extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.5k stars 570 forks source link

ratatui update #2079

Closed extrawurst closed 3 months ago

extrawurst commented 8 months ago

based off of #1959

dam5h commented 8 months ago

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`
extrawurst commented 8 months ago

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

louisbourque commented 8 months ago

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
...
extrawurst commented 8 months ago

can you try cargo install gitui --locked please?

louisbourque commented 8 months ago

can you try cargo install gitui --locked please?

That worked perfectly! Thanks!

extrawurst commented 8 months ago

i am going to update the readme accordingly

dam5h commented 8 months ago

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

extrawurst commented 6 months ago

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