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

🐹 tui-textarea, ratatui dependency problem #259

Open
OmegaTymbJIep opened this issue Sep 24, 2024 · 7 comments Β· May be fixed by #260
Open

🐹 tui-textarea, ratatui dependency problem #259

OmegaTymbJIep opened this issue Sep 24, 2024 · 7 comments Β· May be fixed by #260

Comments

@OmegaTymbJIep
Copy link

OmegaTymbJIep commented Sep 24, 2024

What

Hi! Can't install/build the latest version of corset, it seems like the problem is the same as in #214. The two versions of ratatui are conflicting.

Proof

Here is the trace
corset on ξ‚  master [✘?] is πŸ“¦ v9.7.13 via 🐹 v1.22.5 via πŸ¦€ v1.74.0 took 1m18s 
❯ cargo build
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
   Compiling corset v9.7.13 (/Users/omegatymbjiep/rust/linea/corset)
warning: unused import: `anyhow::Result`
 --> src/transformer/ifs.rs:1:5
  |
1 | use anyhow::Result;
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `super::flatten_list`
 --> src/transformer/ifs.rs:6:5
  |
6 | use super::flatten_list;
  |     ^^^^^^^^^^^^^^^^^^^

warning: `corset` (bin "cgo-corset") generated 2 warnings (run `cargo fix --bin "cgo-corset"` to apply 2 suggestions)
error[E0308]: mismatched types
    --> src/inspect/widgets/number.rs:24:34
     |
24   |             self.input.set_style(Style::default().fg(Color::LightRed));
     |                        --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                        |
     |                        arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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
    --> src/inspect/widgets/number.rs:26:17
     |
25   |               self.input.set_block(
     |                          --------- arguments to this method are incorrect
26   | /                 Block::default()
27   | |                     .borders(Borders::ALL)
28   | |                     .title(format!("{} ERROR: {}", &self.title, err)),
     | |_____________________________________________________________________^ 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`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0308]: mismatched types
    --> src/inspect/widgets/number.rs:31:34
     |
31   |             self.input.set_style(Style::default().fg(Color::LightGreen));
     |                        --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                        |
     |                        arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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
    --> src/inspect/widgets/number.rs:33:17
     |
32   |               self.input.set_block(
     |                          --------- arguments to this method are incorrect
33   | /                 Block::default()
34   | |                     .borders(Borders::ALL)
35   | |                     .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`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0308]: mismatched types
    --> src/inspect/widgets/number.rs:42:42
     |
42   |         self.input.set_cursor_line_style(Style::default());
     |                    --------------------- ^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                    |
     |                    arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0277]: the trait bound `impl ratatui::widgets::Widget + '_: ratatui::prelude::Widget` is not satisfied
  --> src/inspect/widgets/number.rs:46:33
   |
46 |                 f.render_widget(self.input.widget(), target);
   |                   ------------- ^^^^^^^^^^^^^^^^^^^ the trait `ratatui::prelude::Widget` is not implemented for `impl ratatui::widgets::Widget + '_`
   |                   |
   |                   required by a bound introduced by this call
   |
   = help: the following other types implement trait `ratatui::prelude::Widget`:
             ratatui::prelude::Line<'_>
             ratatui::prelude::Span<'_>
             Text<'_>
             BarChart<'_>
             ratatui::widgets::Block<'_>
             Canvas<'_, F>
             Chart<'_>
             ratatui::widgets::Clear
           and 10 others
note: required by a bound in `ratatui::Frame::<'_>::render_widget`
  --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/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`

error[E0308]: mismatched types
    --> src/inspect/widgets/regexp.rs:32:34
     |
32   |             self.input.set_style(Style::default().fg(Color::LightRed));
     |                        --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                        |
     |                        arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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
    --> src/inspect/widgets/regexp.rs:34:17
     |
33   |               self.input.set_block(
     |                          --------- arguments to this method are incorrect
34   | /                 Block::default()
35   | |                     .borders(Borders::ALL)
36   | |                     .title(format!("{} ERROR: {}", &self.title, err)),
     | |_____________________________________________________________________^ 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`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0308]: mismatched types
    --> src/inspect/widgets/regexp.rs:39:34
     |
39   |             self.input.set_style(Style::default().fg(Color::LightGreen));
     |                        --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                        |
     |                        arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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
    --> src/inspect/widgets/regexp.rs:41:17
     |
40   |               self.input.set_block(
     |                          --------- arguments to this method are incorrect
41   | /                 Block::default()
42   | |                     .borders(Borders::ALL)
43   | |                     .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`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0308]: mismatched types
    --> src/inspect/widgets/regexp.rs:50:42
     |
50   |         self.input.set_cursor_line_style(Style::default());
     |                    --------------------- ^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                    |
     |                    arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0277]: the trait bound `impl ratatui::widgets::Widget + '_: ratatui::prelude::Widget` is not satisfied
  --> src/inspect/widgets/regexp.rs:54:33
   |
54 |                 f.render_widget(self.input.widget(), target);
   |                   ------------- ^^^^^^^^^^^^^^^^^^^ the trait `ratatui::prelude::Widget` is not implemented for `impl ratatui::widgets::Widget + '_`
   |                   |
   |                   required by a bound introduced by this call
   |
   = help: the following other types implement trait `ratatui::prelude::Widget`:
             ratatui::prelude::Line<'_>
             ratatui::prelude::Span<'_>
             Text<'_>
             BarChart<'_>
             ratatui::widgets::Block<'_>
             Canvas<'_, F>
             Chart<'_>
             ratatui::widgets::Clear
           and 10 others
note: required by a bound in `ratatui::Frame::<'_>::render_widget`
  --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/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`

error[E0308]: mismatched types
    --> src/inspect/widgets/scan.rs:38:38
     |
38   |                 self.input.set_style(Style::default().fg(Color::LightRed));
     |                            --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                            |
     |                            arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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
    --> src/inspect/widgets/scan.rs:40:21
     |
39   |                   self.input.set_block(
     |                              --------- arguments to this method are incorrect
40   | /                     Block::default()
41   | |                         .borders(Borders::ALL)
42   | |                         .title(format!("ERROR: {}", err)),
     | |_________________________________________________________^ 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`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0308]: mismatched types
    --> src/inspect/widgets/scan.rs:46:38
     |
46   |                 self.input.set_style(Style::default().fg(Color::LightGreen));
     |                            --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                            |
     |                            arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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
    --> src/inspect/widgets/scan.rs:48:21
     |
47   |                   self.input.set_block(
     |                              --------- arguments to this method are incorrect
48   | /                     Block::default()
49   | |                         .borders(Borders::ALL)
50   | |                         .title(node.to_string()),
     | |________________________________________________^ 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`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0308]: mismatched types
    --> src/inspect/widgets/scan.rs:64:42
     |
64   |         self.input.set_cursor_line_style(Style::default());
     |                    --------------------- ^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `ratatui::prelude::Style`
     |                    |
     |                    arguments to this method are incorrect
     |
     = note: `ratatui::prelude::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::prelude::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/omegatymbjiep/.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
    --> /Users/omegatymbjiep/.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[E0277]: the trait bound `impl ratatui::widgets::Widget + '_: ratatui::prelude::Widget` is not satisfied
  --> src/inspect/widgets/scan.rs:68:33
   |
68 |                 f.render_widget(self.input.widget(), target);
   |                   ------------- ^^^^^^^^^^^^^^^^^^^ the trait `ratatui::prelude::Widget` is not implemented for `impl ratatui::widgets::Widget + '_`
   |                   |
   |                   required by a bound introduced by this call
   |
   = help: the following other types implement trait `ratatui::prelude::Widget`:
             ratatui::prelude::Line<'_>
             ratatui::prelude::Span<'_>
             Text<'_>
             BarChart<'_>
             ratatui::widgets::Block<'_>
             Canvas<'_, F>
             Chart<'_>
             ratatui::widgets::Clear
           and 10 others
note: required by a bound in `ratatui::Frame::<'_>::render_widget`
  --> /Users/omegatymbjiep/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/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`

warning: `corset` (lib) generated 2 warnings (2 duplicates)
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
warning: `corset` (bin "corset") generated 2 warnings (2 duplicates)
error: could not compile `corset` (bin "corset") due to 18 previous errors; 2 warnings emitted

Why

I believe the problem is because of [email protected] that uses [email protected] while corset uses [email protected]. The funny thing is the [email protected]'s Cargo.toml (you can find line below here):

ratatui = { version = ">=0.23.0, <1", default-features = false, optional = true }

It means that whenever a new version of ratatui is released, the [email protected] dependency asks for a higher version. It's been released a new version and now they aren't compatible.

Possible Solution

I would recommend bumping the version of tui-textarea to v0.6.1 (the latest) it seems like plenty of bugs have been fixed since. That will cause the bumping of ratatui to v0.28.1 and crossterm to v0.28.1, but it breaks nothing.

Note: it will resolve this problem finally, as in the latest version of tui-textarea the version of ratatui is fixed to v0.28.0.

@OmegaTymbJIep OmegaTymbJIep linked a pull request Sep 24, 2024 that will close this issue
@DavePearce
Copy link
Collaborator

Hi @OmegaTymbJIep whilst I understand your suggestion of bumping the version, there is an ongoing issue with this dependency. It is constantly making breaking changes.

Therefore, I would suggest you build the tool using the --locked argument. For example:

cargo install --path . --locked

And you should be fine.

@OmegaTymbJIep
Copy link
Author

If the version is fixed in Cargo.toml, there shouldn't be any breaking changes as long as the version remains unchanged.

Anyway, it's true that --locked fixes that. It might be worth updating the installation section of the README, as it took some time to figure out why the program failed to run.

@DavePearce
Copy link
Collaborator

If the version is fixed in Cargo.toml, there shouldn't be any breaking changes as long as the version remains

Well, if you use =1.2.3 notation --- perhaps. But you need to do that on anything else which depends on ratatui as well. The problem is that ratatui does not adhere to semantic versioning and makes breaking changes even to patch versions (I think).

@DavePearce
Copy link
Collaborator

DavePearce commented Oct 3, 2024

I would recommend bumping the version of tui-textarea to v0.6.1 (the latest) it seems like plenty of bugs have been fixed since. That will cause the bumping of ratatui to v0.28.1 and crossterm to v0.28.1, but it breaks nothing.

Unfortunately, this does break things. As in the code does not compile and needs to be updated in some way.

@OmegaTymbJIep
Copy link
Author

OmegaTymbJIep commented Oct 3, 2024

Unfortunately, this does break things. As in the code does not compile and needs to be updated in some way.

PR (#260) changes only Cargo.toml, according to those versions. And it seems to be compiling.

UPD: I did cargo clean before compiling to avoid any caches.

@DavePearce
Copy link
Collaborator

Ok, hmmm well it didn't compile for me. Check that you can actually build the tool itself (e.g. cargo install -path .) But, if it works --- great!

@OmegaTymbJIep
Copy link
Author

It seems it works for me, below is a trace.

Here is the trace
corset on ξ‚  fix/ratatui-version is πŸ“¦ v9.7.13 via 🐹 v1.22.5 via πŸ¦€ v1.79.0 
❯ cargo install --path .
  Installing corset v9.7.13 (/Users/omegatymbjiep/rust/linea/corset)
    Updating crates.io index
     Locking 207 packages to latest compatible versions
      Adding base64 v0.13.1 (latest: v0.22.1)
      Adding bitflags v1.3.2 (latest: v2.6.0)
      Adding cached v0.48.1 (latest: v0.53.1)
      Adding cbindgen v0.26.0 (latest: v0.27.0)
      Adding float-cmp v0.9.0 (latest: v0.10.0)
      Adding generic-array v0.14.7 (latest: v1.1.0)
      Adding handlebars v5.1.2 (latest: v6.1.0)
      Adding hashbrown v0.12.3 (latest: v0.15.0)
      Adding hashbrown v0.13.2 (latest: v0.15.0)
      Adding hashbrown v0.14.5 (latest: v0.15.0)
      Adding heck v0.4.1 (latest: v0.5.0)
      Adding hermit-abi v0.1.19 (latest: v0.4.0)
      Adding hermit-abi v0.3.9 (latest: v0.4.0)
      Adding indexmap v1.9.3 (latest: v2.6.0)
      Adding itertools v0.10.5 (latest: v0.13.0)
      Adding itertools v0.12.1 (latest: v0.13.0)
      Adding linux-raw-sys v0.4.14 (latest: v0.6.5)
      Adding ron v0.7.1 (latest: v0.8.1)
      Adding simd-json v0.13.11 (latest: v0.14.0)
      Adding sorbus v0.9.0 (latest: v0.12.1)
      Adding syn v1.0.109 (latest: v2.0.79)
      Adding termcolor v1.1.3 (latest: v1.4.1)
      Adding toml v0.5.11 (latest: v0.8.19)
      Adding unicode-width v0.1.14 (latest: v0.2.0)
      Adding value-trait v0.8.1 (latest: v0.10.0)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.2+wasi-0.2.1)
      Adding windows-core v0.52.0 (latest: v0.58.0)
      Adding windows-sys v0.52.0 (latest: v0.59.0)
      Adding zerocopy v0.7.35 (latest: v0.8.0)
      Adding zerocopy-derive v0.7.35 (latest: v0.8.0)
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.13
   Compiling autocfg v1.4.0
   Compiling libc v0.2.159
   Compiling serde v1.0.210
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.5
   Compiling byteorder v1.5.0
   Compiling syn v1.0.109
   Compiling memchr v2.7.4
   Compiling once_cell v1.20.1
   Compiling thiserror v1.0.64
   Compiling ahash v0.8.11
   Compiling typenum v1.17.0
   Compiling generic-array v0.14.7
   Compiling num-traits v0.2.19
   Compiling rustix v0.38.37
   Compiling log v0.4.22
   Compiling errno v0.3.9
   Compiling quote v1.0.37
   Compiling syn v2.0.79
   Compiling rand_core v0.6.4
   Compiling rustversion v1.0.17
   Compiling bitflags v2.6.0
   Compiling paste v1.0.15
   Compiling heck v0.5.0
   Compiling crypto-common v0.1.6
   Compiling num-integer v0.1.46
   Compiling lock_api v0.4.12
   Compiling signal-hook v0.3.17
   Compiling crossbeam-utils v0.8.20
   Compiling parking_lot_core v0.9.10
   Compiling num-bigint v0.4.6
   Compiling digest v0.10.7
   Compiling ark-serialize-derive v0.4.2
   Compiling signal-hook-registry v1.4.2
   Compiling indexmap v1.9.3
   Compiling utf8parse v0.2.2
   Compiling itoa v1.0.11
   Compiling ucd-trie v0.1.7
   Compiling allocator-api2 v0.2.18
   Compiling serde_json v1.0.128
   Compiling unicode-segmentation v1.12.0
   Compiling ryu v1.0.18
   Compiling smallvec v1.13.2
   Compiling scopeguard v1.2.0
   Compiling anstyle-parse v0.2.5
   Compiling serde_derive v1.0.210
   Compiling zerocopy-derive v0.7.35
   Compiling thiserror-impl v1.0.64
   Compiling zeroize_derive v1.4.2
   Compiling ark-ff-macros v0.4.2
   Compiling ark-ff-asm v0.4.2
   Compiling derivative v2.2.0
   Compiling zeroize v1.8.1
   Compiling mio v1.0.2
   Compiling aho-corasick v1.1.3
   Compiling zerocopy v0.7.35
   Compiling regex-syntax v0.8.5
   Compiling fastrand v2.1.1
   Compiling cbindgen v0.26.0
   Compiling hashbrown v0.12.3
   Compiling anstyle-query v1.1.1
   Compiling anstyle v1.0.8
   Compiling is_terminal_polyfill v1.70.1
   Compiling colorchoice v1.0.2
   Compiling tempfile v3.13.0
   Compiling anstream v0.6.15
   Compiling signal-hook-mio v0.2.4
   Compiling pest v2.7.13
   Compiling parking_lot v0.12.3
   Compiling crossbeam-epoch v0.9.18
   Compiling ppv-lite86 v0.2.20
   Compiling strum_macros v0.26.4
   Compiling castaway v0.2.3
   Compiling hashbrown v0.14.5
   Compiling rand_chacha v0.3.1
   Compiling hashbrown v0.13.2
   Compiling terminal_size v0.4.0
   Compiling strsim v0.11.1
   Compiling unicode-width v0.1.14
   Compiling clap_lex v0.7.2
   Compiling core-foundation-sys v0.8.7
   Compiling pest_meta v2.7.13
   Compiling static_assertions v1.1.0
   Compiling rayon-core v1.12.1
   Compiling heck v0.4.1
   Compiling regex-automata v0.4.8
   Compiling compact_str v0.8.0
   Compiling iana-time-zone v0.1.61
   Compiling clap_builder v4.5.19
   Compiling lru v0.12.4
   Compiling strum v0.26.3
   Compiling crossterm v0.28.1
   Compiling crossbeam-deque v0.8.5
   Compiling try_match_inner v0.5.2
   Compiling pest_generator v2.7.13
   Compiling instability v0.3.2
   Compiling clap_derive v4.5.18
   Compiling rand v0.8.5
   Compiling owo-colors v4.1.0
   Compiling lazy_static v1.5.0
   Compiling ark-std v0.4.0
   Compiling adler2 v2.0.0
   Compiling regex v1.11.0
   Compiling cassowary v0.3.0
   Compiling toml v0.5.11
   Compiling anyhow v1.0.89
   Compiling either v1.13.0
   Compiling str_inflector v0.12.0
   Compiling itertools v0.10.5
   Compiling itertools v0.13.0
   Compiling miniz_oxide v0.8.0
   Compiling pest_derive v2.7.13
   Compiling try_match v0.4.2
   Compiling unicode-truncate v1.1.0
   Compiling clap v4.5.19
   Compiling chrono v0.4.38
   Compiling ark-serialize v0.4.2
   Compiling logging_timer_proc_macros v1.1.1
   Compiling atty v0.2.14
   Compiling ratatui v0.28.1
   Compiling thread_local v1.1.8
   Compiling crc32fast v1.4.2
   Compiling instant v0.1.13
   Compiling termcolor v1.1.3
   Compiling identity-hash v0.1.0
   Compiling bitflags v1.3.2
   Compiling base64 v0.13.1
   Compiling sorbus v0.9.0
   Compiling clap-verbosity-flag v2.2.2
   Compiling cached v0.48.1
   Compiling ron v0.7.1
   Compiling logging_timer v1.1.1
   Compiling flate2 v1.0.34
   Compiling buildstructor v0.5.4
   Compiling ark-ff v0.4.2
   Compiling handlebars v5.1.2
   Compiling rayon v1.10.0
   Compiling itertools v0.12.1
   Compiling buche v0.7.0
   Compiling ellipse v0.2.0
   Compiling convert_case v0.6.0
   Compiling corset v9.7.13 (/Users/omegatymbjiep/rust/linea/corset)
   Compiling memmap2 v0.9.5
   Compiling maplit v1.0.2
   Compiling regex-lite v0.1.6
   Compiling md5 v0.7.0
   Compiling tui-textarea v0.6.1
   Compiling ark-poly v0.4.2
   Compiling ark-ec v0.4.2
   Compiling ark-bls12-377 v0.4.0
warning: unused import: `anyhow::Result`
 --> src/transformer/ifs.rs:1:5
  |
1 | use anyhow::Result;
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `super::flatten_list`
 --> src/transformer/ifs.rs:6:5
  |
6 | use super::flatten_list;
  |     ^^^^^^^^^^^^^^^^^^^

warning: use of deprecated method `tui_textarea::TextArea::<'a>::widget`: calling this method is no longer necessary on rendering a textarea. pass &TextArea reference to `Frame::render_widget` method call directly
  --> src/inspect/widgets/number.rs:46:44
   |
46 |                 f.render_widget(self.input.widget(), target);
   |                                            ^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated method `tui_textarea::TextArea::<'a>::widget`: calling this method is no longer necessary on rendering a textarea. pass &TextArea reference to `Frame::render_widget` method call directly
  --> src/inspect/widgets/regexp.rs:54:44
   |
54 |                 f.render_widget(self.input.widget(), target);
   |                                            ^^^^^^

warning: use of deprecated method `tui_textarea::TextArea::<'a>::widget`: calling this method is no longer necessary on rendering a textarea. pass &TextArea reference to `Frame::render_widget` method call directly
  --> src/inspect/widgets/scan.rs:68:44
   |
68 |                 f.render_widget(self.input.widget(), target);
   |                                            ^^^^^^

warning: use of deprecated method `ratatui::Frame::<'_>::size`: use .area() as it's the more correct name
   --> src/inspect/mod.rs:381:22
    |
381 |         let size = f.size();
    |                      ^^^^

warning: variant `NoColumnsFound` is never constructed
  --> src/check.rs:19:5
   |
17 | enum CheckingError {
   |      ------------- variant in this enum
18 |     #[error("columns for {} not found in trace file", .0.pretty())]
19 |     NoColumnsFound(Handle),
   |     ^^^^^^^^^^^^^^
   |
   = note: `CheckingError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: associated function `all` is never used
  --> src/transformer.rs:87:12
   |
86 | impl ExpansionLevel {
   | ------------------- associated function in this implementation
87 |     pub fn all() -> u8 {
   |            ^^^

warning: function `flatten_list` is never used
   --> src/transformer.rs:155:4
    |
155 | fn flatten_list(mut e: Node) -> Node {
    |    ^^^^^^^^^^^^

warning: `corset` (bin "cgo-corset") generated 2 warnings (2 duplicates)
warning: `corset` (lib) generated 2 warnings (run `cargo fix --lib -p corset` to apply 2 suggestions)
warning: `corset` (bin "corset") generated 9 warnings (2 duplicates)
    Finished `release` profile [optimized + debuginfo] target(s) in 48.62s

<\details>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants