@@ -283,10 +283,14 @@ fn filter_clippy_warnings(line: &str) -> bool {
283
283
284
284
/// Builds clippy inside the repo to make sure we have a clippy executable we can use.
285
285
fn build_clippy ( ) {
286
- Command :: new ( "cargo" )
286
+ let output = Command :: new ( "cargo" )
287
287
. arg ( "build" )
288
288
. output ( )
289
289
. expect ( "Failed to build clippy!" ) ;
290
+ if !output. status . success ( ) {
291
+ eprintln ! ( "Failed to compile Clippy" ) ;
292
+ eprintln ! ( "stderr: {}" , String :: from_utf8_lossy( & output. stderr) )
293
+ }
290
294
}
291
295
292
296
/// Read a `toml` file and return a list of `CrateSources` that we want to check with clippy
@@ -402,12 +406,14 @@ fn gather_stats(clippy_warnings: &[ClippyWarning]) -> String {
402
406
403
407
/// lintchecks `main()` function
404
408
pub fn run ( clap_config : & ArgMatches ) {
405
- let cargo_clippy_path: PathBuf = PathBuf :: from ( "target/debug/cargo-clippy" ) ;
406
-
407
409
println ! ( "Compiling clippy..." ) ;
408
410
build_clippy ( ) ;
409
411
println ! ( "Done compiling" ) ;
410
412
413
+ let cargo_clippy_path: PathBuf = PathBuf :: from ( "target/debug/cargo-clippy" )
414
+ . canonicalize ( )
415
+ . expect ( "failed to canonicalize path to clippy binary" ) ;
416
+
411
417
// assert that clippy is found
412
418
assert ! (
413
419
cargo_clippy_path. is_file( ) ,
@@ -484,5 +490,6 @@ pub fn run(clap_config: &ArgMatches) {
484
490
. for_each ( |( cratename, msg) | text. push_str ( & format ! ( "{}: '{}'" , cratename, msg) ) ) ;
485
491
486
492
let file = format ! ( "lintcheck-logs/{}_logs.txt" , filename) ;
493
+ println ! ( "Writing logs to {}" , file) ;
487
494
write ( file, text) . unwrap ( ) ;
488
495
}
0 commit comments