macchina: Compile error, possibly two tui versions?

Describe the bug When compiling Macchina v6.1.1, I receive the error: expected enum `tui::style::Color`, found a different enum `tui::style::Color` arguments to this function are incorrect. I am compiling with cargo install macchina on Arch Linux using Rust v1.63

To Reproduce Steps to reproduce the behavior:

  1. Type cargo install macchina
  2. Wait for compile (all depends compile).

I have cleared ~/.cargo/registry/cache, ~/.cargo/registry/index and ~/.cargo/registry/src but results in the same error.

Expected behavior Cargo to finish compiling and install macchina binary.

Screenshots Full error:

   Compiling libmacchina v6.2.0
   Compiling macchina v6.1.1
error[E0308]: mismatched types
  --> /home/carneeki/.cargo/registry/src/github.com-1ecc6299db9ec823/macchina-6.1.1/src/theme/base.rs:14:24
   |
14 | #[derive(Debug, Clone, Serialize, Deserialize)]
   |                        ^^^^^^^^^
   |                        |
   |                        expected enum `tui::style::Color`, found a different enum `tui::style::Color`
   |                        arguments to this function are incorrect
   |
   = note: expected reference `&tui::style::Color`
              found reference `&'__a tui::style::Color`
   = note: perhaps two different versions of crate `tui` are being used?
note: function defined here
  --> /home/carneeki/.cargo/registry/src/github.com-1ecc6299db9ec823/color-to-tui-0.2.0/src/lib.rs:7:8
   |
7  | pub fn serialize<S: Serializer>(color: &Color, serializer: S) -> Result<S::Ok, S::Error> {
   |        ^^^^^^^^^
   = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> /home/carneeki/.cargo/registry/src/github.com-1ecc6299db9ec823/macchina-6.1.1/src/theme/base.rs:14:35
   |
14 | #[derive(Debug, Clone, Serialize, Deserialize)]
   |                                   ^^^^^^^^^^^ expected enum `tui::style::Color`, found a different enum `tui::style::Color`
   |
   = note: perhaps two different versions of crate `tui` are being used?
   = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
   --> /home/carneeki/.cargo/registry/src/github.com-1ecc6299db9ec823/macchina-6.1.1/src/theme/components.rs:106:33
    |
106 | #[derive(Debug, Default, Clone, Serialize, Deserialize)]
    |                                 ^^^^^^^^^
    |                                 |
    |                                 expected enum `tui::style::Color`, found a different enum `tui::style::Color`
    |                                 arguments to this function are incorrect
    |
    = note: expected reference `&std::option::Option<tui::style::Color>`
               found reference `&'__a std::option::Option<tui::style::Color>`
    = note: perhaps two different versions of crate `tui` are being used?
note: function defined here
   --> /home/carneeki/.cargo/registry/src/github.com-1ecc6299db9ec823/color-to-tui-0.2.0/src/optional.rs:4:8
    |
4   | pub fn serialize<S: Serializer>(color: &Option<Color>, serializer: S) -> Result<S::Ok, S::Error> {
    |        ^^^^^^^^^
    = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
   --> /home/carneeki/.cargo/registry/src/github.com-1ecc6299db9ec823/macchina-6.1.1/src/theme/components.rs:106:44
    |
106 | #[derive(Debug, Default, Clone, Serialize, Deserialize)]
    |                                            ^^^^^^^^^^^ expected enum `tui::style::Color`, found a different enum `tui::style::Color`
    |
    = note: expected enum `std::option::Option<tui::style::Color>` (enum `tui::style::Color`)
               found enum `std::option::Option<tui::style::Color>` (enum `tui::style::Color`)
    = note: perhaps two different versions of crate `tui` are being used?
    = note: this error originates in the macro `try` (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` due to 8 previous errors
error: failed to compile `macchina v6.1.1`, intermediate artifacts can be found at `/tmp/cargo-installoD2ntw`

System Information

  • Distribution: Arch Linux
  • Desktop Environment: Gnome w/Wayland
  • Operating System: Arch Linux
  • Terminal: Wezterm
  • Macchina’s version: v6.1.1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 34 (22 by maintainers)

Most upvoted comments

The issue should be resolved now with v6.1.4.

Thank you all, you’ve been super helpful - I would not have done it without you!

I also have only one tui version,

CARGO_CRATE_DEPENDS+=	toml-0.5.9
CARGO_CRATE_DEPENDS+=	tui-0.18.0
CARGO_CRATE_DEPENDS+=	unicode-bidi-0.3.7

I updated the dependency of ansi-to-tui on tui to 0.* so hopefully it should work now

I get the same error installing macchina through cargo. Marking this as a bug, will inspect real soon!

EDIT 1: Building from source works fine, this is weird. Our CI also hasn’t failed.

EDIT 2: This shouldn’t be happening, macchina, color-to-tui and ansi-to-tui are all using the same tui version. @uttarayan21 Am I missing something here?