Skip to content

Commit 6f0fc2f

Browse files
committed
Symlink build/host -> build/x86_64-unknown-linux-gnu (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.
1 parent 2d76a9d commit 6f0fc2f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/bootstrap/lib.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ use std::collections::{HashMap, HashSet};
108108
use std::env;
109109
use std::fs::{self, File};
110110
use std::io;
111+
use std::io::ErrorKind;
111112
use std::path::{Path, PathBuf};
112113
use std::process::Command;
113114
use std::str;
@@ -119,7 +120,9 @@ use once_cell::sync::OnceCell;
119120

120121
use crate::builder::Kind;
121122
use crate::config::{LlvmLibunwind, TargetSelection};
122-
use crate::util::{exe, libdir, mtime, output, run, run_suppressed, try_run_suppressed, CiEnv};
123+
use crate::util::{
124+
exe, libdir, mtime, output, run, run_suppressed, symlink_dir, try_run_suppressed, CiEnv,
125+
};
123126

124127
mod bolt;
125128
mod builder;
@@ -586,6 +589,20 @@ impl Build {
586589
metadata::build(&mut build);
587590
}
588591

592+
// Make a symbolic link so we can use a consistent directory in the documentation.
593+
let build_triple = build.out.join(&build.build.triple);
594+
let host = build.out.join("host");
595+
if let Err(e) = symlink_dir(&build.config, &build_triple, &host) {
596+
if e.kind() != ErrorKind::AlreadyExists {
597+
panic!(
598+
"symlink_dir({} => {}) failed with {}",
599+
host.display(),
600+
build_triple.display(),
601+
e
602+
);
603+
}
604+
}
605+
589606
build
590607
}
591608

0 commit comments

Comments
 (0)