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

BUG: Installation Failure; error: failed to compile macchina v6.2.1; [E0308]: mismatched types, expected type did not match the received type. #332

Closed
NeilPandya opened this issue Oct 21, 2024 · 4 comments
Labels
type/build-error Won't build or is panicking.

Comments

@NeilPandya
Copy link

Describe the bug
Tried to install via sudo apt install wmctrl -y && cargo install macchina. Encountering the following error:

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

error[E0308]: mismatched types
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/macchina-6.2.1/src/theme/components.rs:116:33
    |
116 | #[derive(Debug, Default, Clone, Serialize, Deserialize)]
    |                                 ^^^^^^^^^
    |                                 |
    |                                 expected `ratatui::style::color::Color`, found `ratatui::prelude::Color`
    |                                 arguments to this function are incorrect
    |
    = note: `ratatui::prelude::Color` and `ratatui::style::color::Color` have similar names, but are actually distinct types
note: `ratatui::prelude::Color` is defined in crate `ratatui`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/style/color.rs:66:1
    |
66  | pub enum Color {
    | ^^^^^^^^^^^^^^
note: `ratatui::style::color::Color` is defined in crate `ratatui`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.29.0/src/style/color.rs:68:1
    |
68  | pub enum Color {
    | ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
note: function defined here
   --> /usr/local/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) -> 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]: `?` operator has incompatible types
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/macchina-6.2.1/src/theme/components.rs:116:44
    |
116 | #[derive(Debug, Default, Clone, Serialize, Deserialize)]
    |                                            ^^^^^^^^^^^ expected `ratatui::prelude::Color`, found `ratatui::style::color::Color`
    |
    = note: `?` operator cannot convert from `std::option::Option<ratatui::style::color::Color>` to `std::option::Option<ratatui::prelude::Color>`
    = note: `ratatui::style::color::Color` and `ratatui::prelude::Color` have similar names, but are actually distinct types
note: `ratatui::style::color::Color` is defined in crate `ratatui`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.29.0/src/style/color.rs:68:1
    |
68  | pub enum Color {
    | ^^^^^^^^^^^^^^
note: `ratatui::prelude::Color` is defined in crate `ratatui`
   --> /usr/local/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: 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.1`, intermediate artifacts can be found at `/tmp/cargo-installvnBrkn`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

To Reproduce
Steps to reproduce the behavior:

  1. Install rust for linux amd64 platform via:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. If, after installation, running rustc --version in the console fails, the modifications to PATH may not take effect until the console is restarted, or the user is logged out; thus, reboot, if necessary.
  2. Install via:
sudo apt install wmctrl -y && cargo install macchina

Expected behavior
Successful installation of macchina v6.2.1.

Screenshots
NA

macchina --doctor output
NA, macchina fails to install.

System Information

neil@FractalNorth:~$ rustc -V && cargo -V
rustc 1.81.0 (eeb90cda1 2024-09-04)
cargo 1.81.0 (2dbb1af80 2024-08-20)
                                           neil@FractalNorth 
           `.:/ossyyyysso/:.               ----------------- 
        .:oyyyyyyyyyyyyyyyyyyo:`           OS: Kubuntu trixie/sid (noble) x86_64 
      -oyyyyyyyodMMyyyyyyyysyyyyo-         Kernel: 6.8.0-47-generic 
    -syyyyyyyyyydMMyoyyyydmMMyyyyys-       Uptime: 5 hours, 53 mins 
   oyyysdMysyyyydMMMMMMMMMMMMMyyyyyyyo     Packages: 2432 (dpkg), 19 (flatpak-system) 
 `oyyyydMMMMysyysoooooodMMMMyyyyyyyyyo`    Shell: bash 5.2.21 
 oyyyyyydMMMMyyyyyyyyyyyysdMMysssssyyyo    Resolution: 1920x1080 @ 164.92Hz 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   DE: Plasma 5.27.11 [KF5 5.115.0] [Qt 5.15.13] (x11) 
oyyyysoodMyyyyyyyyyyyyyyyyyyydMMMMysyyyo   WM: KWin 
yyysdMMMMMyyyyyyyyyyyyyyyyyyysosyyyyyyyy   Theme: klassy [KDE/Qt], Breeze [GTK2/3] 
yyysdMMMMMyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   Icons: BeautySolar [KDE/Qt/GTK2/3] 
oyyyyysosdyyyyyyyyyyyyyyyyyyydMMMMysyyyo   Cursor: Breeze_Snow [KDE/GTK2/3] 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Terminal: konsole 
 oyyyyyydMMMysyyyyyyyyyyysdMMyoyyyoyyyo    Terminal Font: Noto Mono 14 
 `oyyyydMMMysyyyoooooodMMMMyoyyyyyyyyo     CPU: AMD Ryzen 9 5950X (32) @ 3.4GHz 
   oyyysyyoyyyysdMMMMMMMMMMMyyyyyyyyo      GPU: NVIDIA GeForce RTX 3090 
    -syyyyyyyyydMMMysyyydMMMysyyyys-       Memory: 8.29 GiB / 31.24 GiB (26%) 
      -oyyyyyyydMMyyyyyyysosyyyyo-         Network: Wifi 
        ./oyyyyyyyyyyyyyyyyyyo/.           Bluetooth: Intel Corp. AX200 
           `.:/oosyyyysso/:.`              BIOS: American Megatrends Inc. 5.17 (03/18/2024) 

@mert-kurttutan
Copy link

Experienced the same issue on windows and latest version

@blackerby
Copy link

Same issue on Fedora.

@grtcdr grtcdr added the type/build-error Won't build or is panicking. label Oct 29, 2024
@grtcdr
Copy link
Member

grtcdr commented Oct 29, 2024

This should be fixed in b9ea773, I'll make a new release soon enough that fixes this problem once and for all.

@grtcdr grtcdr closed this as completed Oct 29, 2024
@grtcdr
Copy link
Member

grtcdr commented Oct 29, 2024

This issue should no longer affect future commits or source releases.

I am forced to discontinue publishing macchina on crates.io (for the time being) seeing as cargo and by extension crates.io do not the vendoring model adopted in commit b9ea773, this model is very simple for me to support as a package maintainer, but has been, much to my surprise, unsupported by cargo for the past 9 years (see rust-lang/cargo#1565 and rust-lang/cargo#14005).

So for now, if you'd like to install macchina, use your distribution's package manager or the binaries we distribute with every release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/build-error Won't build or is panicking.
Development

No branches or pull requests

4 participants