Skip to content

Commit

Permalink
Auto merge of #96905 - jyn514:revert-96803-faster-assemble, r=Mark-Si…
Browse files Browse the repository at this point in the history
…mulacrum

Revert "Make "Assemble stage1 compiler" orders of magnitude faster"

Reverts #96803. This caused `llvm-tools-nightly` to fail when installing with `rustup-toolchain-install-master` because of the presence of symlinks. I'm not sure how the symlinks got in there, but revert the PR for now while I figure it out.

r? `@Mark-Simulacrum` cc `@RalfJung`
  • Loading branch information
bors committed May 10, 2022
2 parents d4c3643 + 89e0c29 commit fee75fb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1497,14 +1497,20 @@ impl Build {
let dst = dstdir.join(src.file_name().unwrap());
self.verbose_than(1, &format!("Install {:?} to {:?}", src, dst));
t!(fs::create_dir_all(dstdir));
drop(fs::remove_file(&dst));
{
if !src.exists() {
panic!("Error: File \"{}\" not found!", src.display());
}
self.copy(src, &dst);
let metadata = t!(src.symlink_metadata());
if let Err(e) = fs::copy(&src, &dst) {
panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)
}
t!(fs::set_permissions(&dst, metadata.permissions()));
let atime = FileTime::from_last_access_time(&metadata);
let mtime = FileTime::from_last_modification_time(&metadata);
t!(filetime::set_file_times(&dst, atime, mtime));
}
// NOTE: when using hard-links, this will also update the permissions on the original file.
// We never use permissions that are more restrictive than the original, so this shouldn't cause any issues.
chmod(&dst, perms);
}

Expand Down

0 comments on commit fee75fb

Please sign in to comment.