becheran/mlc

Installation failed

QingyaoLin opened this issue · 2 comments

Describe the bug
Use the command cargo install mlc to install failed

Expected behavior
Successful installation.

Desktop (please complete the following information):

  • OS: windows
  • Version 11

Additional context
The error log:

error: cannot find derive macro `Deserialize` in this scope
 --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\logger.rs:6:30
  |
6 | #[derive(Debug, Clone, Copy, Deserialize)]
  |                              ^^^^^^^^^^^
  |
  = note: consider importing this derive macro:
          serde_derive::Deserialize
note: `Deserialize` is imported here, but it is only a trait, without a derive macro
 --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\logger.rs:3:5
  |
3 | use serde::Deserialize;
  |     ^^^^^^^^^^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:36:26
   |
36 | #[derive(Default, Debug, Deserialize)]
   |                          ^^^^^^^^^^^
   |
   = note: consider importing this derive macro:
           serde_derive::Deserialize
note: `Deserialize` is imported here, but it is only a trait, without a derive macro
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:13:5
   |
13 | use serde::Deserialize;
   |     ^^^^^^^^^^^^^^^^^^

error: cannot find attribute `serde` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:39:7
   |
39 |     #[serde(rename(deserialize = "markup-types"))]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute

error: cannot find attribute `serde` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:42:7
   |
42 |     #[serde(rename(deserialize = "match-file-extension"))]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute

error: cannot find attribute `serde` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:44:7
   |
44 |     #[serde(rename(deserialize = "ignore-links"))]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute

error: cannot find attribute `serde` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:46:7
   |
46 |     #[serde(rename(deserialize = "ignore-path"))]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute

error: cannot find attribute `serde` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:48:7
   |
48 |     #[serde(rename(deserialize = "root-dir"))]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute

error: cannot find derive macro `Deserialize` in this scope
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:53:26
   |
53 | #[derive(Default, Debug, Deserialize)]
   |                          ^^^^^^^^^^^
   |
   = note: consider importing this derive macro:
           serde_derive::Deserialize
note: `Deserialize` is imported here, but it is only a trait, without a derive macro
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\lib.rs:13:5
   |
13 | use serde::Deserialize;
   |     ^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `OptionalConfig: Deserialize<'_>` is not satisfied
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\mlc-0.16.0\src\cli.rs:15:30
   |
15 |         Ok(content) => match toml::from_str(&content) {
   |                              ^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `OptionalConfig`
   |
   = help: the following other types implement trait `Deserialize<'de>`:
             &'a [u8]
             &'a std::path::Path
             &'a str
             ()
             (T0, T1)
             (T0, T1, T2)
             (T0, T1, T2, T3)
             (T0, T1, T2, T3, T4)
           and 130 others
note: required by a bound in `toml::from_str`
  --> C:\Users\\.cargo\registry\src\github.com-1ecc6299db9ec823\toml-0.5.10\src\de.rs:75:8
   |
75 |     T: de::Deserialize<'de>,
   |        ^^^^^^^^^^^^^^^^^^^^ required by this bound in `toml::from_str`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `mlc` due to 9 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mlc v0.16.0`, intermediate artifacts can be found at `C:\Users\\AppData\Local\Temp\cargo-installR5kWcz`

Thanks for reporting. This is bad. I could reproduce it on my windows machine. Never had it before that I am able to build the binary but not install it via cargo install. Never thought that there would be a difference...

I will try to resolve this. Interestingly the compiled binaries from the release work on my machine:

https://github.com/becheran/mlc/releases

Still a bit unclear to me why building the binary did work, but not the installation. But, I found a fix and released version 0.16.1.