Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ratatui update #2079

Open
extrawurst opened this issue Feb 20, 2024 · 8 comments
Open

ratatui update #2079

extrawurst opened this issue Feb 20, 2024 · 8 comments

Comments

@extrawurst
Copy link
Owner

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
@dam5h
Copy link
Contributor

dam5h commented Feb 21, 2024

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
Copy link
Owner Author

extrawurst commented Feb 21, 2024

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
Copy link
Contributor

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
Copy link
Owner Author

can you try cargo install gitui --locked please?

@louisbourque
Copy link
Contributor

can you try cargo install gitui --locked please?

That worked perfectly! Thanks!

@extrawurst
Copy link
Owner Author

i am going to update the readme accordingly

@dam5h
Copy link
Contributor

dam5h commented Feb 22, 2024

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

@extrawurst
Copy link
Owner Author

Now blocked on textarea: rhysd/tui-textarea#60

IndianBoy42 pushed a commit to IndianBoy42/gitui that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants