Linus-Mussmaecher / rucola

Terminal-based markdown note manager.
GNU General Public License v3.0
203 stars 3 forks source link

Cannot compile manually or install with cargo install #9

Closed IngoTB303 closed 2 months ago

IngoTB303 commented 2 months ago

rustup update: stable-x86_64-pc-windows-msvc unchanged - rustc 1.80.1 (3f5fd8dd4 2024-08-06) cargo --version: cargo 1.80.1 (376290515 2024-07-16)

"cargo install rucola-notes" runs and compiles until: Compiling tui-textarea v0.4.0 Then there are 14 compile errors. The same when I build it manually with "git clone https://github.com/Linus-Mussmaecher/rucola cd rucola cargo install --path ."

Errors:

error[E0308]: mismatched types --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:149:36 149 self.filter_area.set_style(self.styles.input_style); --------- ^^^^^^^^^^^^^^^^^^^^^^^ 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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\src\style.rs:228:1
228 pub struct Style {
^^^^^^^^^^^^^^^^
 = note: perhaps two different versions of crate `ratatui` are being used?

note: method defined here --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:151:36 151 .set_cursor_line_style(self.styles.input_style); --------------------- ^^^^^^^^^^^^^^^^^^^^^^^ 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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\src\style.rs:228:1
228 pub struct Style {
^^^^^^^^^^^^^^^^
 = note: perhaps two different versions of crate `ratatui` are being used?

note: method defined here --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:154:13 153 self.filter_area.set_block( --------- arguments to this method are incorrect 154 / Block::bordered() 155 .title(title_top) 156 .title(instructions) 157 .title(instructions_bot), ____^ 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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.27.0\src\widgets\block.rs:67:1 67 pub struct Block<'a> { ^^^^^^^^^^^^^^^^^^^^ note: Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:169:34 169 self.name_area.set_style(self.styles.input_style); --------- ^^^^^^^^^^^^^^^^^^^^^^^ 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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\src\style.rs:228:1
228 pub struct Style {
^^^^^^^^^^^^^^^^
 = note: perhaps two different versions of crate `ratatui` are being used?

note: method defined here --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:171:36 171 .set_cursor_line_style(self.styles.input_style); --------------------- ^^^^^^^^^^^^^^^^^^^^^^^ 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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\src\style.rs:228:1
228 pub struct Style {
^^^^^^^^^^^^^^^^
 = note: perhaps two different versions of crate `ratatui` are being used?

note: method defined here --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:173:34 173 self.name_area.set_block(Block::bordered().title(title_top)); --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected Block<'_>, found ratatui::widgets::Block<'_>
arguments to this method are incorrect
 = note: `ratatui::widgets::Block<'_>` and `Block<'_>` have similar names, but are actually distinct types
note: ratatui::widgets::Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.27.0\src\widgets\block.rs:67:1 67 pub struct Block<'a> { ^^^^^^^^^^^^^^^^^^^^ note: Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:183:34 183 self.name_area.set_block(Block::bordered().title(title_top)); --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected Block<'_>, found ratatui::widgets::Block<'_>
arguments to this method are incorrect
 = note: `ratatui::widgets::Block<'_>` and `Block<'_>` have similar names, but are actually distinct types
note: ratatui::widgets::Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.27.0\src\widgets\block.rs:67:1 67 pub struct Block<'a> { ^^^^^^^^^^^^^^^^^^^^ note: Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\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 --> C:\Users....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 + '_: ratatui::prelude::Widget is not satisfied --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:733:24 733 Widget::render(filter_input, filter_area, buf); -------------- ^^^^^^^^^^^^ 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`:
          &W
          &str
          BarChart<'_>
          Canvas<'_, F>
          Chart<'_>
          Gauge<'_>
          LineGauge<'_>
          Sparkline<'_>
        and 10 others
error[E0277]: the trait bound impl ratatui::widgets::Widget + '_: ratatui::prelude::Widget is not satisfied --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\select_screen.rs:825:32 825 Widget::render(create_input, center_area, buf); -------------- ^^^^^^^^^^^^ 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`:
          &W
          &str
          BarChart<'_>
          Canvas<'_, F>
          Chart<'_>
          Gauge<'_>
          LineGauge<'_>
          Sparkline<'_>
        and 10 others
error[E0308]: mismatched types --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\display_screen.rs:93:29 93 name_area.set_style(styles.input_style); --------- ^^^^^^^^^^^^^^^^^^ 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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\src\style.rs:228:1
228 pub struct Style {
^^^^^^^^^^^^^^^^
 = note: perhaps two different versions of crate `ratatui` are being used?

note: method defined here --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\display_screen.rs:94:41 94 name_area.set_cursor_line_style(styles.input_style); --------------------- ^^^^^^^^^^^^^^^^^^ 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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\src\style.rs:228:1
228 pub struct Style {
^^^^^^^^^^^^^^^^
 = note: perhaps two different versions of crate `ratatui` are being used?

note: method defined here --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\display_screen.rs:100:29 100 name_area.set_block(Block::bordered().title(title_top)); --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected Block<'_>, found ratatui::widgets::Block<'_>
arguments to this method are incorrect
 = note: `ratatui::widgets::Block<'_>` and `Block<'_>` have similar names, but are actually distinct types
note: ratatui::widgets::Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.27.0\src\widgets\block.rs:67:1 67 pub struct Block<'a> { ^^^^^^^^^^^^^^^^^^^^ note: Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\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 --> C:\Users....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 --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\display_screen.rs:125:34 125 self.name_area.set_block(Block::bordered().title(title_top)); --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected Block<'_>, found ratatui::widgets::Block<'_>
arguments to this method are incorrect
 = note: `ratatui::widgets::Block<'_>` and `Block<'_>` have similar names, but are actually distinct types
note: ratatui::widgets::Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.27.0\src\widgets\block.rs:67:1 67 pub struct Block<'a> { ^^^^^^^^^^^^^^^^^^^^ note: Block<'_> is defined in crate ratatui --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.28.0\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 --> C:\Users....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 + '_: ratatui::prelude::Widget is not satisfied --> C:\Users....cargo\registry\src\index.crates.io-6f17d22bba15001f\rucola-notes-0.3.6\src\ui\screen\display_screen.rs:243:32 243 Widget::render(name_input, center_area, buf); -------------- ^^^^^^^^^^ 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`:
          &W
          &str
          BarChart<'_>
          Canvas<'_, F>
          Chart<'_>
          Gauge<'_>
          LineGauge<'_>
          Sparkline<'_>
        and 10 others

Some errors have detailed explanations: E0277, E0308. For more information about an error, try rustc --explain E0277. error: could not compile rucola-notes (bin "rucola") due to 14 previous errors error: failed to compile rucola-notes v0.3.6, intermediate artifacts can be found at C:\Users\...\AppData\Local\Temp\cargo-installrXdKek. To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

IngoTB303 commented 2 months ago

Same errors under Linux Mint 21.3 x86_64.

Linus-Mussmaecher commented 2 months ago

Hi, this seems to be a problem with tui-textarea suddenly expecting stGructs from ratatui 0.28 while the project is still on version 0.27. This can be solved by installing with the --locked flag, i.e. cargo install --locked --path ., which is suggested for applications anyway. I'll update the instructions to mention that.

I hope this does not affect other installers - I will try to update to the latest versions of ratatui/tui-textarea soon and release a new version that makes sure all installs are handled with the --locked flag.