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
// 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")
}
}
-// 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)
- }
-
- 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;
- }
- if ch.next() != Some('/') {
- return None;
- }
- Some(format!("/{}/{}", drive, &s[drive.len_utf8() + 2..]))
- }
-}
-
#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Cargo {
pub compiler: Compiler,