@@ -11,10 +11,6 @@ pub enum Error {
1111 Io ( #[ from] std:: io:: Error ) ,
1212 #[ error( "Failed get output from cargo-metadata: {0:?}" ) ]
1313 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 ,
1814 #[ error( "Bad path {0:?} whilst scraping files" ) ]
1915 Scraping ( PathBuf ) ,
2016}
@@ -43,25 +39,19 @@ pub struct PackageMetadata {
4339 pub is_in_libstd : Option < bool > ,
4440}
4541
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).
4744///
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.
5347pub fn get_metadata_and_notices (
5448 cargo : & Path ,
5549 vendor_path : & Path ,
5650 root_path : & Path ,
57- manifest_paths : & [ & Path ] ,
51+ manifest_paths : & [ PathBuf ] ,
5852) -> Result < BTreeMap < Package , PackageMetadata > , Error > {
5953 let mut output = get_metadata ( cargo, root_path, manifest_paths) ?;
6054
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-
6555 // Now for each dependency we found, go and grab any important looking files
6656 for ( package, metadata) in output. iter_mut ( ) {
6757 load_important_files ( package, metadata, & vendor_path) ?;
@@ -77,7 +67,7 @@ pub fn get_metadata_and_notices(
7767pub fn get_metadata (
7868 cargo : & Path ,
7969 root_path : & Path ,
80- manifest_paths : & [ & Path ] ,
70+ manifest_paths : & [ PathBuf ] ,
8171) -> Result < BTreeMap < Package , PackageMetadata > , Error > {
8272 let mut output = BTreeMap :: new ( ) ;
8373 // Look at the metadata for each manifest
@@ -113,28 +103,6 @@ pub fn get_metadata(
113103 Ok ( output)
114104}
115105
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-
138106/// Add important files off disk into this dependency.
139107///
140108/// Maybe one-day Cargo.toml will contain enough information that we don't need
0 commit comments