Nemo157 / cargo-lichking

Automated license checking for rust. cargo lichking is a Cargo subcommand that checks licensing information for dependencies.
Other
127 stars 16 forks source link

Update cargo dependency #43

Closed kraai closed 5 years ago

kraai commented 5 years ago

Would you please update the dependency on cargo to the latest version, 0.31? I'd like to package cargo-lichking for Debian and build it against cargo 0.31 so that we don't have to package an old version of cargo.

Nemo157 commented 5 years ago

I can probably find time to do that sometime in the next week, as long as the APIs haven't changed too much. If anyone else feels like submitting a PR for it I'd be very happy to merge it.

kraai commented 5 years ago

I've posted my work in progress branch at https://github.com/kraai/cargo-lichking/tree/update-cargo. There's one more error to resolve:

   Compiling cargo-lichking v0.6.0 (/home/kraai/src/cargo-lichking)                                                                                   
error[E0277]: `cargo::CliError` doesn't implement `std::fmt::Display`                                                                                 
  --> src/main.rs:31:24                                                                                                                               
   |                                                                                                                                                  
31 |         config.shell().error(err).expect("Can't do much");                                                                                       
   |                        ^^^^^ `cargo::CliError` cannot be formatted with the default formatter                                                    
   |                                                                                                                                                  
   = help: the trait `std::fmt::Display` is not implemented for `cargo::CliError`                                                                     
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead                                                        

error: aborting due to previous error                                                                                                                 

For more information about this error, try `rustc --explain E0277`.                                                                                   
error: Could not compile `cargo-lichking`.                                                                                                            

To learn more, run the command again with --verbose.
Nemo157 commented 5 years ago

I think the best thing there would be to check if there's a CargoError on err.error and print that, otherwise just a generic "something went wrong" message.

EDIT: Also, should probably use the specified exit code from the error instead of just 1.