Skip to content

Commit

Permalink
Symlink build/host -> build/x86_64-unknown-linux-gnu (as appropri…
Browse files Browse the repository at this point in the history
…ate 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
jyn514 committed Dec 17, 2022
1 parent 2d76a9d commit 6f0fc2f
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 6f0fc2f

Please sign in to comment.