@@ -11,10 +11,6 @@ pub enum Error {
11
11
Io ( #[ from] std:: io:: Error ) ,
12
12
#[ error( "Failed get output from cargo-metadata: {0:?}" ) ]
13
13
GettingMetadata ( #[ from] cargo_metadata:: Error ) ,
14
- #[ error( "Failed to run cargo vendor: {0:?}" ) ]
15
- LaunchingVendor ( std:: io:: Error ) ,
16
- #[ error( "Failed to complete cargo vendor" ) ]
17
- RunningVendor ,
18
14
#[ error( "Bad path {0:?} whilst scraping files" ) ]
19
15
Scraping ( PathBuf ) ,
20
16
}
@@ -43,25 +39,19 @@ pub struct PackageMetadata {
43
39
pub is_in_libstd : Option < bool > ,
44
40
}
45
41
46
- /// Use `cargo metadata` and `cargo vendor` to get a list of dependencies and their license data.
42
+ /// Use `cargo metadata` to get a list of dependencies and their license data. License files will
43
+ /// also be pulled from the vendor path (generated by bootstrap).
47
44
///
48
- /// This will involve running `cargo vendor` into `vendor_path` so we can
49
- /// grab the license files.
50
- ///
51
- /// Any dependency with a path beginning with `root_path` is ignored, as we
52
- /// assume `reuse` has covered it already.
45
+ /// Any dependency with a path beginning with `root_path` is ignored, as we assume `reuse` has
46
+ /// covered it already.
53
47
pub fn get_metadata_and_notices (
54
48
cargo : & Path ,
55
49
vendor_path : & Path ,
56
50
root_path : & Path ,
57
- manifest_paths : & [ & Path ] ,
51
+ manifest_paths : & [ PathBuf ] ,
58
52
) -> Result < BTreeMap < Package , PackageMetadata > , Error > {
59
53
let mut output = get_metadata ( cargo, root_path, manifest_paths) ?;
60
54
61
- // Now do a cargo-vendor and grab everything
62
- println ! ( "Vendoring deps into {}..." , vendor_path. display( ) ) ;
63
- run_cargo_vendor ( cargo, & vendor_path, manifest_paths) ?;
64
-
65
55
// Now for each dependency we found, go and grab any important looking files
66
56
for ( package, metadata) in output. iter_mut ( ) {
67
57
load_important_files ( package, metadata, & vendor_path) ?;
@@ -77,7 +67,7 @@ pub fn get_metadata_and_notices(
77
67
pub fn get_metadata (
78
68
cargo : & Path ,
79
69
root_path : & Path ,
80
- manifest_paths : & [ & Path ] ,
70
+ manifest_paths : & [ PathBuf ] ,
81
71
) -> Result < BTreeMap < Package , PackageMetadata > , Error > {
82
72
let mut output = BTreeMap :: new ( ) ;
83
73
// Look at the metadata for each manifest
@@ -113,28 +103,6 @@ pub fn get_metadata(
113
103
Ok ( output)
114
104
}
115
105
116
- /// Run cargo-vendor, fetching into the given dir
117
- fn run_cargo_vendor ( cargo : & Path , dest : & Path , manifest_paths : & [ & Path ] ) -> Result < ( ) , Error > {
118
- let mut vendor_command = std:: process:: Command :: new ( cargo) ;
119
- vendor_command. env ( "RUSTC_BOOTSTRAP" , "1" ) ;
120
- vendor_command. arg ( "vendor" ) ;
121
- vendor_command. arg ( "--quiet" ) ;
122
- vendor_command. arg ( "--versioned-dirs" ) ;
123
- for manifest_path in manifest_paths {
124
- vendor_command. arg ( "-s" ) ;
125
- vendor_command. arg ( manifest_path) ;
126
- }
127
- vendor_command. arg ( dest) ;
128
-
129
- let vendor_status = vendor_command. status ( ) . map_err ( Error :: LaunchingVendor ) ?;
130
-
131
- if !vendor_status. success ( ) {
132
- return Err ( Error :: RunningVendor ) ;
133
- }
134
-
135
- Ok ( ( ) )
136
- }
137
-
138
106
/// Add important files off disk into this dependency.
139
107
///
140
108
/// Maybe one-day Cargo.toml will contain enough information that we don't need
0 commit comments