File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1040,6 +1040,25 @@ impl Step for Src {
10401040 builder. copy ( & builder. src . join ( file) , & dst_src. join ( file) ) ;
10411041 }
10421042
1043+ // libtest includes std and everything else, so vendoring it
1044+ // creates exactly what's needed for `cargo -Zbuild-std` or any
1045+ // other analysis of the stdlib's source. Cargo also needs help
1046+ // finding the lock, so we copy it to libtest temporarily.
1047+ //
1048+ // Note that this requires std to only have one version of each
1049+ // crate. e.g. two versions of getopts won't be patchable.
1050+ let dst_libtest = dst_src. join ( "library/test" ) ;
1051+ let dst_vendor = dst_src. join ( "vendor" ) ;
1052+ let root_lock = dst_src. join ( "Cargo.lock" ) ;
1053+ let temp_lock = dst_libtest. join ( "Cargo.lock" ) ;
1054+ builder. copy ( & root_lock, & temp_lock) ;
1055+
1056+ let mut cmd = Command :: new ( & builder. initial_cargo ) ;
1057+ cmd. arg ( "vendor" ) . arg ( dst_vendor) . current_dir ( & dst_libtest) ;
1058+ builder. run ( & mut cmd) ;
1059+
1060+ builder. remove ( & temp_lock) ;
1061+
10431062 // Create source tarball in rust-installer format
10441063 let mut cmd = rust_installer ( builder) ;
10451064 cmd. arg ( "generate" )
You can’t perform that action at this time.
0 commit comments