/// without any extra installed software (e.g., we bundle gcc, libraries, etc).
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let host = self.host;
- if !host.contains("pc-windows-gnu") {
+ if !host.ends_with("pc-windows-gnu") {
return None;
}
// anything requiring us to distribute a license, but it's likely the
// install will *also* include the rust-mingw package, which also needs
// licenses, so to be safe we just include it here in all MinGW packages.
- if host.contains("pc-windows-gnu") {
+ if host.ends_with("pc-windows-gnu") {
make_win_dist(tarball.image_dir(), &tmpdir(builder), host, builder);
tarball.add_dir(builder.src.join("src/etc/third-party"), "share/doc");
}
let gcc_lld_src_dir = src_dir.join("gcc-ld");
let gcc_lld_dst_dir = dst_dir.join("gcc-ld");
t!(fs::create_dir(&gcc_lld_dst_dir));
- for flavor in ["ld", "ld64"] {
- let exe_name = exe(flavor, compiler.host);
- builder
- .copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
- }
+ let exe_name = exe("ld", compiler.host);
+ builder.copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
}
// Man pages
"library/backtrace/crates",
// these are 30MB combined and aren't necessary for building
// the standard library.
- "library/stdarch/crates/Cargo.toml",
+ "library/stdarch/Cargo.toml",
"library/stdarch/crates/stdarch-verify",
"library/stdarch/crates/intrinsic-test",
],
// If we're building from git sources, we need to vendor a complete distribution.
if builder.rust_info.is_git() {
+ // Ensure we have the submodules checked out.
+ builder.update_submodule(Path::new("src/tools/rust-analyzer"));
+
// Vendor all Cargo dependencies
let mut cmd = Command::new(&builder.initial_cargo);
cmd.arg("vendor")
.arg(builder.src.join("./src/tools/rust-analyzer/Cargo.toml"))
.arg("--sync")
.arg(builder.src.join("./compiler/rustc_codegen_cranelift/Cargo.toml"))
+ .arg("--sync")
+ .arg(builder.src.join("./src/bootstrap/Cargo.toml"))
.current_dir(&plain_dst_src);
- builder.run(&mut cmd);
- }
-
- tarball.bare()
- }
-}
-// We have to run a few shell scripts, which choke quite a bit on both `\`
-// characters and on `C:\` paths, so normalize both of them away.
-pub fn sanitize_sh(path: &Path) -> String {
- let path = path.to_str().unwrap().replace("\\", "/");
- return change_drive(unc_to_lfs(&path)).unwrap_or(path);
-
- fn unc_to_lfs(s: &str) -> &str {
- s.strip_prefix("//?/").unwrap_or(s)
- }
+ let config = if !builder.config.dry_run {
+ t!(String::from_utf8(t!(cmd.output()).stdout))
+ } else {
+ String::new()
+ };
- fn change_drive(s: &str) -> Option<String> {
- let mut ch = s.chars();
- let drive = ch.next().unwrap_or('C');
- if ch.next() != Some(':') {
- return None;
+ let cargo_config_dir = plain_dst_src.join(".cargo");
+ builder.create_dir(&cargo_config_dir);
+ builder.create(&cargo_config_dir.join("config.toml"), &config);
}
- if ch.next() != Some('/') {
- return None;
- }
- Some(format!("/{}/{}", drive, &s[drive.len_utf8() + 2..]))
+
+ tarball.bare()
}
}
tarballs.push(builder.ensure(Rustc { compiler: builder.compiler(stage, target) }));
tarballs.push(builder.ensure(Std { compiler, target }).expect("missing std"));
- if target.contains("windows-gnu") {
+ if target.ends_with("windows-gnu") {
tarballs.push(builder.ensure(Mingw { host: target }).expect("missing mingw"));
}
prepare(tool);
}
}
- if target.contains("windows-gnu") {
+ if target.ends_with("windows-gnu") {
prepare("rust-mingw");
}
.arg("-t")
.arg(etc.join("msi/remove-duplicates.xsl")),
);
- if target.contains("windows-gnu") {
+ if target.ends_with("windows-gnu") {
builder.run(
Command::new(&heat)
.current_dir(&exe)
if built_tools.contains("miri") {
cmd.arg("-dMiriDir=miri");
}
- if target.contains("windows-gnu") {
+ if target.ends_with("windows-gnu") {
cmd.arg("-dGccDir=rust-mingw");
}
builder.run(&mut cmd);
}
candle("AnalysisGroup.wxs".as_ref());
- if target.contains("windows-gnu") {
+ if target.ends_with("windows-gnu") {
candle("GccGroup.wxs".as_ref());
}
cmd.arg("MiriGroup.wixobj");
}
- if target.contains("windows-gnu") {
+ if target.ends_with("windows-gnu") {
cmd.arg("GccGroup.wixobj");
}
// ICE57 wrongly complains about the shortcuts
.env("CFG_BUILD", target.triple)
.env("CFG_CHANNEL", &builder.config.channel);
- if target.contains("windows-gnu") {
+ if target.contains("windows-gnullvm") {
+ cmd.env("CFG_MINGW", "1").env("CFG_ABI", "LLVM");
+ } else if target.contains("windows-gnu") {
cmd.env("CFG_MINGW", "1").env("CFG_ABI", "GNU");
} else {
cmd.env("CFG_MINGW", "0").env("CFG_ABI", "MSVC");
tarball.set_overlay(OverlayKind::LLVM);
let src_bindir = builder.llvm_out(target).join("bin");
+ // If updating this list, you likely want to change
+ // src/bootstrap/download-ci-llvm-stamp as well, otherwise local users
+ // will not pick up the extra file until LLVM gets bumped.
for bin in &[
"llvm-config",
"llvm-ar",
"llvm-cov",
"llvm-dwp",
"llvm-nm",
+ "llvm-dwarfdump",
] {
tarball.add_file(src_bindir.join(exe(bin, target)), "bin", 0o755);
}