Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ impl Step for StartupObjects {
t!(fs::create_dir_all(dst_dir));

for file in &["rsbegin", "rsend"] {
let src_file = &src_dir.join(file.to_string() + ".rs");
let dst_file = &dst_dir.join(file.to_string() + ".o");
let src_file = &src_dir.join(file).with_extension("rs");
let dst_file = &dst_dir.join(file).with_extension("o");
if !up_to_date(src_file, dst_file) {
let mut cmd = Command::new(&builder.initial_rustc);
builder.run(cmd.env("RUSTC_BOOTSTRAP", "1")
Expand All @@ -317,7 +317,7 @@ impl Step for StartupObjects {
.arg(src_file));
}

builder.copy(dst_file, &sysroot_dir.join(file.to_string() + ".o"));
builder.copy(dst_file, &sysroot_dir.join(file).with_extension("o"));
}

for obj in ["crt2.o", "dllcrt2.o"].iter() {
Expand Down Expand Up @@ -1141,8 +1141,7 @@ pub fn run_cargo(builder: &Builder, cargo: &mut Command, stamp: &Path, is_check:
None => panic!("no output generated for {:?} {:?}", prefix, extension),
};
if is_dylib(path_to_add) {
let candidate = format!("{}.lib", path_to_add);
let candidate = PathBuf::from(candidate);
let candidate = PathBuf::from(path_to_add).with_extension("lib");
if candidate.exists() {
deps.push(candidate);
}
Expand Down
9 changes: 4 additions & 5 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ impl Step for Src {
builder.run(&mut cmd);

builder.remove_dir(&image);
distdir(builder).join(&format!("{}.tar.gz", name))
distdir(builder).join(PathBuf::from(name).with_extension("tar.gz"))
}
}

Expand Down Expand Up @@ -992,9 +992,8 @@ impl Step for PlainSourceTarball {

// Create plain source tarball
let plain_name = format!("rustc-{}-src", builder.rust_package_vers());
let mut tarball = distdir(builder).join(&format!("{}.tar.gz", plain_name));
tarball.set_extension(""); // strip .gz
tarball.set_extension(""); // strip .tar
let tarball_name = PathBuf::from(&plain_name).with_extension("tar.gz");
let tarball = distdir(builder).join(&plain_name);
if let Some(dir) = tarball.parent() {
builder.create_dir(&dir);
}
Expand All @@ -1006,7 +1005,7 @@ impl Step for PlainSourceTarball {
.arg("--work-dir=.")
.current_dir(tmpdir(builder));
builder.run(&mut cmd);
distdir(builder).join(&format!("{}.tar.gz", plain_name))
distdir(builder).join(&tarball_name)
}
}

Expand Down