Macchina-CLI / macchina

A system information frontend with an emphasis on performance.
https://crates.io/crates/macchina
MIT License
1.48k stars 51 forks source link

Build error with standard rust toolchain 1.81.0 #326

Closed naguam closed 2 months ago

naguam commented 2 months ago

Hi

Compiling on rust 1.81.0 (rustup) on Linux x86_64 (cargo install macchina)

error[E0308]: mismatched types
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macchina-6.2.0/src/theme/base.rs:14:24
   |
14 | #[derive(Debug, Clone, Serialize, Deserialize)]
   |                        ^^^^^^^^^
   |                        |
   |                        expected `Color`, found a different `Color`
   |                        arguments to this function are incorrect
   |
   = note: `Color` and `Color` have similar names, but are actually distinct types
note: `Color` is defined in crate `ratatui`
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style/color.rs:66:1
   |
66 | pub enum Color {
   | ^^^^^^^^^^^^^^
note: `Color` is defined in crate `ratatui`
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style/color.rs:66:1
   |
66 | pub enum Color {
   | ^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `ratatui` are being used?
note: function defined here
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/color-to-tui-0.3.0/src/lib.rs:7:8
   |
7  | pub fn serialize<S: Serializer>(color: &Color, serializer: S) -> Result<...
   |        ^^^^^^^^^
   = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: `?` operator has incompatible types
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macchina-6.2.0/src/theme/base.rs:14:35
   |
14 | #[derive(Debug, Clone, Serialize, Deserialize)]
   |                                   ^^^^^^^^^^^ expected `Color`, found a different `Color`
   |
   = note: `?` operator cannot convert from `ratatui::style::color::Color` to `ratatui::style::Color`
   = note: `Color` and `Color` have similar names, but are actually distinct types
note: `Color` is defined in crate `ratatui`
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style/color.rs:66:1
   |
66 | pub enum Color {
   | ^^^^^^^^^^^^^^
note: `Color` is defined in crate `ratatui`
  --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style/color.rs:66:1
   |
66 | pub enum Color {
   | ^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `ratatui` are being used?
   = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macchina-6.2.0/src/theme/components.rs:116:33
    |
116 | #[derive(Debug, Default, Clone, Serialize, Deserialize)]
    |                                 ^^^^^^^^^
    |                                 |
    |                                 expected `Color`, found a different `Color`
    |                                 arguments to this function are incorrect
    |
    = note: `Color` and `Color` have similar names, but are actually distinct types
note: `Color` is defined in crate `ratatui`
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style/color.rs:66:1
    |
66  | pub enum Color {
    | ^^^^^^^^^^^^^^
note: `Color` is defined in crate `ratatui`
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style/color.rs:66:1
    |
66  | pub enum Color {
    | ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
note: function defined here
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/color-to-tui-0.3.0/src/optional.rs:4:8
    |
4   | pub fn serialize<S: Serializer>(color: &Option<Color>, serializer: S) -...
    |        ^^^^^^^^^
    = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: `?` operator has incompatible types
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macchina-6.2.0/src/theme/components.rs:116:44
    |
116 | #[derive(Debug, Default, Clone, Serialize, Deserialize)]
    |                                            ^^^^^^^^^^^ expected `Color`, found a different `Color`
    |
    = note: `?` operator cannot convert from `std::option::Option<ratatui::style::color::Color>` to `std::option::Option<ratatui::style::Color>`
    = note: `Color` and `Color` have similar names, but are actually distinct types
note: `Color` is defined in crate `ratatui`
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style/color.rs:66:1
    |
66  | pub enum Color {
    | ^^^^^^^^^^^^^^
note: `Color` is defined in crate `ratatui`
   --> /opt/tools/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style/color.rs:66:1
    |
66  | pub enum Color {
    | ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0308`.
error: could not compile `macchina` (bin "macchina") due to 4 previous errors
error: failed to compile `macchina v6.2.0`, intermediate artifacts can be found at `/tmp/cargo-installMbH9Pr`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
grtcdr commented 2 months ago

The color-to-tui, ansi-to-tui saga never ends.

I think we should just vendor them at this point.

EDIT: It seems that ansi-to-tui has been officially adopted by ratatui, color-to-tui is still an independent project so this issue won't be totally solved after all.

grtcdr commented 2 months ago

This issue should be resolved now, I'll make a new patch release.

EDIT: Done, please try reinstallating macchina.