Skip to content

Commit 00de0a8

Browse files
committed
[beta] revert rust-lang#78790, vendor libtest for rustc-src
1 parent bd26e4e commit 00de0a8

File tree

2 files changed

+2
-45
lines changed

2 files changed

+2
-45
lines changed

src/bootstrap/dist.rs

+2-24
Original file line numberDiff line numberDiff line change
@@ -1040,30 +1040,6 @@ 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-
1055-
// `cargo vendor` will delete everything from the lockfile that
1056-
// isn't used by libtest, so we need to not use any links!
1057-
builder.really_copy(&root_lock, &temp_lock);
1058-
1059-
let mut cmd = Command::new(&builder.initial_cargo);
1060-
cmd.arg("vendor").arg(dst_vendor).current_dir(&dst_libtest);
1061-
builder.info("Dist src");
1062-
let _time = timeit(builder);
1063-
builder.run(&mut cmd);
1064-
1065-
builder.remove(&temp_lock);
1066-
10671043
// Create source tarball in rust-installer format
10681044
let mut cmd = rust_installer(builder);
10691045
cmd.arg("generate")
@@ -1080,6 +1056,8 @@ impl Step for Src {
10801056
.arg("--component-name=rust-src")
10811057
.arg("--legacy-manifest-dirs=rustlib,cargo");
10821058

1059+
builder.info("Dist src");
1060+
let _time = timeit(builder);
10831061
builder.run(&mut cmd);
10841062

10851063
builder.remove_dir(&image);

src/bootstrap/lib.rs

-21
Original file line numberDiff line numberDiff line change
@@ -1175,27 +1175,6 @@ impl Build {
11751175
paths
11761176
}
11771177

1178-
/// Copies a file from `src` to `dst` and doesn't use links, so
1179-
/// that the copy can be modified without affecting the original.
1180-
pub fn really_copy(&self, src: &Path, dst: &Path) {
1181-
if self.config.dry_run {
1182-
return;
1183-
}
1184-
self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst));
1185-
if src == dst {
1186-
return;
1187-
}
1188-
let _ = fs::remove_file(&dst);
1189-
let metadata = t!(src.symlink_metadata());
1190-
if let Err(e) = fs::copy(src, dst) {
1191-
panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)
1192-
}
1193-
t!(fs::set_permissions(dst, metadata.permissions()));
1194-
let atime = FileTime::from_last_access_time(&metadata);
1195-
let mtime = FileTime::from_last_modification_time(&metadata);
1196-
t!(filetime::set_file_times(dst, atime, mtime));
1197-
}
1198-
11991178
/// Copies a file from `src` to `dst`
12001179
pub fn copy(&self, src: &Path, dst: &Path) {
12011180
if self.config.dry_run {

0 commit comments

Comments
 (0)