Move ci_rustc_dir
to Config and use it consistently
This commit is contained in:
parent
baae59eea3
commit
934e7e6c26
4 changed files with 9 additions and 8 deletions
|
@ -645,8 +645,8 @@ fn cp_rustc_component_to_ci_sysroot(
|
||||||
contents: Vec<String>,
|
contents: Vec<String>,
|
||||||
) {
|
) {
|
||||||
let sysroot = builder.ensure(Sysroot { compiler, force_recompile: false });
|
let sysroot = builder.ensure(Sysroot { compiler, force_recompile: false });
|
||||||
|
let ci_rustc_dir = builder.config.ci_rustc_dir();
|
||||||
|
|
||||||
let ci_rustc_dir = builder.out.join(&*builder.build.build.triple).join("ci-rustc");
|
|
||||||
for file in contents {
|
for file in contents {
|
||||||
let src = ci_rustc_dir.join(&file);
|
let src = ci_rustc_dir.join(&file);
|
||||||
let dst = sysroot.join(file);
|
let dst = sysroot.join(file);
|
||||||
|
@ -1381,7 +1381,7 @@ impl Step for Sysroot {
|
||||||
// FIXME: this is wrong when compiler.host != build, but we don't support that today
|
// FIXME: this is wrong when compiler.host != build, but we don't support that today
|
||||||
OsStr::new(std::env::consts::DLL_EXTENSION),
|
OsStr::new(std::env::consts::DLL_EXTENSION),
|
||||||
];
|
];
|
||||||
let ci_rustc_dir = builder.ci_rustc_dir(builder.config.build);
|
let ci_rustc_dir = builder.config.ci_rustc_dir();
|
||||||
builder.cp_filtered(&ci_rustc_dir, &sysroot, &|path| {
|
builder.cp_filtered(&ci_rustc_dir, &sysroot, &|path| {
|
||||||
if path.extension().map_or(true, |ext| !filtered_extensions.contains(&ext)) {
|
if path.extension().map_or(true, |ext| !filtered_extensions.contains(&ext)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1800,6 +1800,12 @@ impl Config {
|
||||||
self.out.join(&*self.build.triple).join("ci-llvm")
|
self.out.join(&*self.build.triple).join("ci-llvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Directory where the extracted `rustc-dev` component is stored.
|
||||||
|
pub(crate) fn ci_rustc_dir(&self) -> PathBuf {
|
||||||
|
assert!(self.download_rustc());
|
||||||
|
self.out.join(self.build.triple).join("ci-rustc")
|
||||||
|
}
|
||||||
|
|
||||||
/// Determine whether llvm should be linked dynamically.
|
/// Determine whether llvm should be linked dynamically.
|
||||||
///
|
///
|
||||||
/// If `false`, llvm should be linked statically.
|
/// If `false`, llvm should be linked statically.
|
||||||
|
|
|
@ -406,7 +406,7 @@ impl Config {
|
||||||
return vec![];
|
return vec![];
|
||||||
}
|
}
|
||||||
|
|
||||||
let ci_rustc_dir = self.out.join(&*self.build.triple).join("ci-rustc");
|
let ci_rustc_dir = self.ci_rustc_dir();
|
||||||
let stamp_file = ci_rustc_dir.join(stamp_file);
|
let stamp_file = ci_rustc_dir.join(stamp_file);
|
||||||
let contents_file = t!(File::open(&stamp_file), stamp_file.display().to_string());
|
let contents_file = t!(File::open(&stamp_file), stamp_file.display().to_string());
|
||||||
t!(BufReader::new(contents_file).lines().collect())
|
t!(BufReader::new(contents_file).lines().collect())
|
||||||
|
|
|
@ -819,11 +819,6 @@ impl Build {
|
||||||
self.stage_out(compiler, mode).join(&*target.triple).join(self.cargo_dir())
|
self.stage_out(compiler, mode).join(&*target.triple).join(self.cargo_dir())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Directory where the extracted `rustc-dev` component is stored.
|
|
||||||
fn ci_rustc_dir(&self, target: TargetSelection) -> PathBuf {
|
|
||||||
self.out.join(&*target.triple).join("ci-rustc")
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Root output directory for LLVM compiled for `target`
|
/// Root output directory for LLVM compiled for `target`
|
||||||
///
|
///
|
||||||
/// Note that if LLVM is configured externally then the directory returned
|
/// Note that if LLVM is configured externally then the directory returned
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue