EmbarkStudios / cargo-about

📜 Cargo plugin to generate list of all licenses for a crate 🦀
http://embark.rs
Apache License 2.0
545 stars 32 forks source link

Build error on 0.4.2 release #175

Closed senden9 closed 2 years ago

senden9 commented 2 years ago

Describe the bug The latest release (0.4.2) fails to build on my machine. Error:

error[E0599]: no method named `compat` found for struct `anyhow::Error` in the current scope
  --> /home/stefano/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-about-0.4.2/src/licenses.rs:21:24
   |
21 |         .map_err(|e| e.compat())
   |                        ^^^^^^ method not found in `anyhow::Error`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `cargo-about` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-about v0.4.2`, intermediate artifacts can be found at `/tmp/cargo-installGSR9B8`

To Reproduce Try to install the latest cargo-about release with cargo install --version "=0.4.2" cargo-about

Expected behavior cargo-about can be compiled successful.

Device:

Additional Infos: If I compile the latest version of this git repo (0c74659e7e24f3a894cdb3a6e7dacfd2ea8c6b48) cargo build as well as cargo build --release can compile. Maybe the version on crates.io is different :thinking: .

senden9 commented 2 years ago

Verbose build log created with cargo install --version "=0.4.2" --verbose cargo-about: cargo-about-build.txt

Jake-Shadle commented 2 years ago

No, it's just using a different version of anyhow, you can use --locked to use the exact Cargo.lock that was published (cargo install doesn't do this, which is a bit of a footgun). I will also publish a fix shortly.

Jake-Shadle commented 2 years ago

Sorry I lied, not anyhow, this was due to a bump in askalono which replaced failure with anyhow.

senden9 commented 2 years ago

Ah, I didn't know that cargo install did not use the lock-file by default. This explains why a local cargo build is just fine. Thank you for the explanation and the quick release of a "fixed" version @Jake-Shadle!