Skip to content

Commit

Permalink
Rollup merge of #104854 - jyn514:sysroot-symlink, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Symlink `build/host` -> `build/$HOST_TRIPLE`

(as appropriate per target)

This allows us to use a consistent path in the documentation, without having to worry about which platform people are using.
  • Loading branch information
matthiaskrgr authored Dec 17, 2022
2 parents 2d76a9d + 6f0fc2f commit 5dc0b6f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ use std::collections::{HashMap, HashSet};
use std::env;
use std::fs::{self, File};
use std::io;
use std::io::ErrorKind;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::str;
Expand All @@ -119,7 +120,9 @@ use once_cell::sync::OnceCell;

use crate::builder::Kind;
use crate::config::{LlvmLibunwind, TargetSelection};
use crate::util::{exe, libdir, mtime, output, run, run_suppressed, try_run_suppressed, CiEnv};
use crate::util::{
exe, libdir, mtime, output, run, run_suppressed, symlink_dir, try_run_suppressed, CiEnv,
};

mod bolt;
mod builder;
Expand Down Expand Up @@ -586,6 +589,20 @@ impl Build {
metadata::build(&mut build);
}

// Make a symbolic link so we can use a consistent directory in the documentation.
let build_triple = build.out.join(&build.build.triple);
let host = build.out.join("host");
if let Err(e) = symlink_dir(&build.config, &build_triple, &host) {
if e.kind() != ErrorKind::AlreadyExists {
panic!(
"symlink_dir({} => {}) failed with {}",
host.display(),
build_triple.display(),
e
);
}
}

build
}

Expand Down

0 comments on commit 5dc0b6f

Please sign in to comment.