File tree 3 files changed +38
-10
lines changed
3 files changed +38
-10
lines changed Original file line number Diff line number Diff line change @@ -83,15 +83,18 @@ impl Combiner {
83
83
bail ! ( "incorrect installer version in {}" , input_tarball) ;
84
84
}
85
85
86
- // Move components to the new combined installer
86
+ // Copy components to the new combined installer
87
87
let mut pkg_components = String :: new ( ) ;
88
88
open_file ( pkg_dir. join ( "components" ) )
89
89
. and_then ( |mut file| file. read_to_string ( & mut pkg_components) . map_err ( Error :: from) )
90
90
. chain_err ( || format ! ( "failed to read components in '{}'" , input_tarball) ) ?;
91
91
for component in pkg_components. split_whitespace ( ) {
92
- // All we need to do is move the component directory
92
+ // All we need to do is copy the component directory. We could
93
+ // move it, but rustbuild wants to reuse the unpacked package
94
+ // dir for OS-specific installers on macOS and Windows.
93
95
let component_dir = package_dir. join ( & component) ;
94
- rename ( & pkg_dir. join ( & component) , component_dir) ?;
96
+ create_dir ( & component_dir) ?;
97
+ copy_recursive ( & pkg_dir. join ( & component) , & component_dir) ?;
95
98
96
99
// Merge the component name
97
100
writeln ! ( & components, "{}" , component)
Original file line number Diff line number Diff line change @@ -79,13 +79,6 @@ pub fn remove_file<P: AsRef<Path>>(path: P) -> Result<()> {
79
79
. chain_err ( || format ! ( "failed to remove file '{}'" , path. as_ref( ) . display( ) ) )
80
80
}
81
81
82
- /// Wrap `fs::rename` with a nicer error message
83
- pub fn rename < P : AsRef < Path > , Q : AsRef < Path > > ( from : P , to : Q ) -> Result < ( ) > {
84
- fs:: rename ( & from, & to)
85
- . chain_err ( || format ! ( "failed to rename '{}' to '{}'" ,
86
- from. as_ref( ) . display( ) , to. as_ref( ) . display( ) ) )
87
- }
88
-
89
82
/// Copies the `src` directory recursively to `dst`. Both are assumed to exist
90
83
/// when this function is called.
91
84
pub fn copy_recursive ( src : & Path , dst : & Path ) -> Result < ( ) > {
Original file line number Diff line number Diff line change @@ -946,6 +946,38 @@ list_components() {
946
946
}
947
947
runtest list_components
948
948
949
+ combined_remains () {
950
+ try sh " $S /gen-installer.sh" \
951
+ --image-dir=" $TEST_DIR /image1" \
952
+ --work-dir=" $WORK_DIR " \
953
+ --output-dir=" $OUT_DIR " \
954
+ --package-name=rustc \
955
+ --component-name=rustc
956
+ try sh " $S /gen-installer.sh" \
957
+ --image-dir=" $TEST_DIR /image3" \
958
+ --work-dir=" $WORK_DIR " \
959
+ --output-dir=" $OUT_DIR " \
960
+ --package-name=cargo \
961
+ --component-name=cargo
962
+ try sh " $S /gen-installer.sh" \
963
+ --image-dir=" $TEST_DIR /image4" \
964
+ --work-dir=" $WORK_DIR " \
965
+ --output-dir=" $OUT_DIR " \
966
+ --package-name=rust-docs \
967
+ --component-name=rust-docs
968
+ try sh " $S /combine-installers.sh" \
969
+ --work-dir=" $WORK_DIR " \
970
+ --output-dir=" $OUT_DIR " \
971
+ --package-name=rust \
972
+ --input-tarballs=" $OUT_DIR /rustc.tar.gz,$OUT_DIR /cargo.tar.gz,$OUT_DIR /rust-docs.tar.gz"
973
+ for component in rustc cargo rust-docs; do
974
+ # rustbuild wants the original extracted package intact too
975
+ try test -d " $WORK_DIR /$component /$component "
976
+ try test -d " $WORK_DIR /rust/$component "
977
+ done
978
+ }
979
+ runtest combined_remains
980
+
949
981
# Upgrade tests
950
982
951
983
upgrade_from_v1 () {
You can’t perform that action at this time.
0 commit comments