File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,7 @@ impl Step for Tidy {
528
528
println ! ( "tidy check ({})" , host) ;
529
529
let mut cmd = builder. tool_cmd ( Tool :: Tidy ) ;
530
530
cmd. arg ( build. src . join ( "src" ) ) ;
531
+ cmd. arg ( & build. initial_cargo ) ;
531
532
if !build. config . vendor {
532
533
cmd. arg ( "--no-vendor" ) ;
533
534
}
Original file line number Diff line number Diff line change @@ -426,9 +426,9 @@ pub fn check(path: &Path, bad: &mut bool) {
426
426
/// Checks the dependency at the given path. Changes `bad` to `true` if a check failed.
427
427
///
428
428
/// Specifically, this checks that the dependencies are on the whitelist.
429
- pub fn check_whitelist ( path : & Path , bad : & mut bool ) {
429
+ pub fn check_whitelist ( path : & Path , cargo : & Path , bad : & mut bool ) {
430
430
// Check dependencies
431
- let deps: HashSet < _ > = get_deps ( & path)
431
+ let deps: HashSet < _ > = get_deps ( & path, & cargo )
432
432
. into_iter ( )
433
433
. map ( |Package { name, version, .. } | ( name, version) )
434
434
. collect ( ) ;
@@ -492,10 +492,9 @@ fn extract_license(line: &str) -> String {
492
492
}
493
493
494
494
/// Get the dependencies of the crate at the given path using `cargo metadata`.
495
- fn get_deps ( path : & Path ) -> Vec < Package > {
495
+ fn get_deps ( path : & Path , cargo : & Path ) -> Vec < Package > {
496
496
// Run `cargo metadata` to get the set of dependencies
497
- println ! ( "Getting metadata from {:?}" , path. join( "Cargo.toml" ) ) ;
498
- let output = Command :: new ( "cargo" )
497
+ let output = Command :: new ( cargo)
499
498
. arg ( "metadata" )
500
499
. arg ( "--format-version" )
501
500
. arg ( "1" )
Original file line number Diff line number Diff line change @@ -24,9 +24,12 @@ use std::path::PathBuf;
24
24
use std:: env;
25
25
26
26
fn main ( ) {
27
- let path = env:: args_os ( ) . skip ( 1 ) . next ( ) . expect ( "need an argument " ) ;
27
+ let path = env:: args_os ( ) . skip ( 1 ) . next ( ) . expect ( "need path to src " ) ;
28
28
let path = PathBuf :: from ( path) ;
29
29
30
+ let cargo = env:: args_os ( ) . skip ( 2 ) . next ( ) . expect ( "need path to cargo" ) ;
31
+ let cargo = PathBuf :: from ( cargo) ;
32
+
30
33
let args: Vec < String > = env:: args ( ) . skip ( 1 ) . collect ( ) ;
31
34
32
35
let mut bad = false ;
@@ -41,7 +44,7 @@ fn main() {
41
44
if !args. iter ( ) . any ( |s| * s == "--no-vendor" ) {
42
45
deps:: check ( & path, & mut bad) ;
43
46
}
44
- deps:: check_whitelist ( & path, & mut bad) ;
47
+ deps:: check_whitelist ( & path, & cargo , & mut bad) ;
45
48
46
49
if bad {
47
50
eprintln ! ( "some tidy checks failed" ) ;
You can’t perform that action at this time.
0 commit comments