blacknon / hwatch

A modern alternative to the watch command, records the differences in execution results and can check this differences at after.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot compile 0.3.13

im-n1 opened this issue · comments

I try to install latest version but it cannot compile (on Rust 1.78.0)

error[E0308]: mismatched types
   --> /home/n1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hwatch-0.3.13/src/ansi.rs:159:56
    |
159 |     let ansi_reset_seq = AnsiSequence::SetGraphicsMode(ansi_reset_vec);
    |                          ----------------------------- ^^^^^^^^^^^^^^ expected `Vec<u8, 5>`, found `Vec<u8, UInt<UInt<..., ...>, ...>>`
    |                          |
    |                          arguments to this enum variant are incorrect
    |
    = note: `Vec<u8, UInt<UInt<..., ...>, ...>>` and `heapless::vec::Vec<u8, 5>` have similar names, but are actually distinct types
note: `Vec<u8, UInt<UInt<..., ...>, ...>>` is defined in crate `heapless`
   --> /home/n1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/heapless-0.6.1/src/vec.rs:165:1
    |
165 | pub struct Vec<T, N>(#[doc(hidden)] pub crate::i::Vec<GenericArray<T, N>>)
    | ^^^^^^^^^^^^^^^^^^^^
note: `heapless::vec::Vec<u8, 5>` is defined in crate `heapless`
   --> /home/n1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/heapless-0.8.0/src/vec.rs:32:1
    |
32  | pub struct Vec<T, const N: usize> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `heapless` are being used?
note: tuple variant defined here
   --> /home/n1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ansi-parser-0.9.1/src/enums.rs:19:5
    |
19  |     SetGraphicsMode(Vec<u8, 5>),
    |     ^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `hwatch` (bin "hwatch") due to 1 previous error
error: failed to compile `hwatch v0.3.13`, intermediate artifacts can be found at `/tmp/cargo-installHfwi52`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Hmm...I wonder why...
When I tried cargo build with Rust 1.78.0 in my environment (M1 Mac), it compiled without any problems.

Just a guess, but you could try cargo install --locked vs cargo install. You can also try cloning, then cargo update, then cargo install ..

Building the project with --locked solved the issue. How's that possible?

@im-n1

How's that possible?

This likely means that you used a newer version of some dependency than @blacknon and the official binaries are using. --locked ensures you use the same version (using the Cargo.lock lockfile). A new version of a dependency must have broken something.

@blacknon seems to be on top of fixing the problem for the long-term judging by the commit that's newly referencing this issue. He would have noticed the issue when he updated the lock file, but your report sped things up.

Sorry, I hadn't noticed this behavior.

Fixed in Version 0.3.14.
Thanks for letting me know!

Just tried to compile without --locked and it's compiled! Closing ;)