Skip to content

Commit 5ce62da

Browse files
authored
Rollup merge of #80082 - ehuss:revert-rust-src-vendor, r=Mark-Simulacrum
Revert #78790 - rust-src vendoring This reverts the rust-src vendor changes from #78790. There were a few issues (see #79218, rust-lang/cargo#8962, rust-lang/cargo#8963), that I don't think will get fixed in the next few days before the beta branch. Fixes #79218
2 parents 0b1e718 + 6893206 commit 5ce62da

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
@@ -1043,30 +1043,6 @@ impl Step for Src {
10431043
builder.copy(&builder.src.join(file), &dst_src.join(file));
10441044
}
10451045

1046-
// libtest includes std and everything else, so vendoring it
1047-
// creates exactly what's needed for `cargo -Zbuild-std` or any
1048-
// other analysis of the stdlib's source. Cargo also needs help
1049-
// finding the lock, so we copy it to libtest temporarily.
1050-
//
1051-
// Note that this requires std to only have one version of each
1052-
// crate. e.g. two versions of getopts won't be patchable.
1053-
let dst_libtest = dst_src.join("library/test");
1054-
let dst_vendor = dst_src.join("vendor");
1055-
let root_lock = dst_src.join("Cargo.lock");
1056-
let temp_lock = dst_libtest.join("Cargo.lock");
1057-
1058-
// `cargo vendor` will delete everything from the lockfile that
1059-
// isn't used by libtest, so we need to not use any links!
1060-
builder.really_copy(&root_lock, &temp_lock);
1061-
1062-
let mut cmd = Command::new(&builder.initial_cargo);
1063-
cmd.arg("vendor").arg(dst_vendor).current_dir(&dst_libtest);
1064-
builder.info("Dist src");
1065-
let _time = timeit(builder);
1066-
builder.run(&mut cmd);
1067-
1068-
builder.remove(&temp_lock);
1069-
10701046
// Create source tarball in rust-installer format
10711047
let mut cmd = rust_installer(builder);
10721048
cmd.arg("generate")
@@ -1083,6 +1059,8 @@ impl Step for Src {
10831059
.arg("--component-name=rust-src")
10841060
.arg("--legacy-manifest-dirs=rustlib,cargo");
10851061

1062+
builder.info("Dist src");
1063+
let _time = timeit(builder);
10861064
builder.run(&mut cmd);
10871065

10881066
builder.remove_dir(&image);

src/bootstrap/lib.rs

-21
Original file line numberDiff line numberDiff line change
@@ -1182,27 +1182,6 @@ impl Build {
11821182
paths
11831183
}
11841184

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

0 commit comments

Comments
 (0)