Commit dd68d0b 1 parent f7801d6 commit dd68d0b Copy full SHA for dd68d0b
File tree 1 file changed +19
-0
lines changed
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 {
1040
1040
builder. copy ( & builder. src . join ( file) , & dst_src. join ( file) ) ;
1041
1041
}
1042
1042
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
+
1043
1062
// Create source tarball in rust-installer format
1044
1063
let mut cmd = rust_installer ( builder) ;
1045
1064
cmd. arg ( "generate" )
You can’t perform that action at this time.
0 commit comments