Skip to content

Commit 934e7e6

Browse files
committed
Move ci_rustc_dir to Config and use it consistently
1 parent baae59e commit 934e7e6

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/bootstrap/compile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ fn cp_rustc_component_to_ci_sysroot(
645645
contents: Vec<String>,
646646
) {
647647
let sysroot = builder.ensure(Sysroot { compiler, force_recompile: false });
648+
let ci_rustc_dir = builder.config.ci_rustc_dir();
648649

649-
let ci_rustc_dir = builder.out.join(&*builder.build.build.triple).join("ci-rustc");
650650
for file in contents {
651651
let src = ci_rustc_dir.join(&file);
652652
let dst = sysroot.join(file);
@@ -1381,7 +1381,7 @@ impl Step for Sysroot {
13811381
// FIXME: this is wrong when compiler.host != build, but we don't support that today
13821382
OsStr::new(std::env::consts::DLL_EXTENSION),
13831383
];
1384-
let ci_rustc_dir = builder.ci_rustc_dir(builder.config.build);
1384+
let ci_rustc_dir = builder.config.ci_rustc_dir();
13851385
builder.cp_filtered(&ci_rustc_dir, &sysroot, &|path| {
13861386
if path.extension().map_or(true, |ext| !filtered_extensions.contains(&ext)) {
13871387
return true;

src/bootstrap/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,12 @@ impl Config {
18001800
self.out.join(&*self.build.triple).join("ci-llvm")
18011801
}
18021802

1803+
/// Directory where the extracted `rustc-dev` component is stored.
1804+
pub(crate) fn ci_rustc_dir(&self) -> PathBuf {
1805+
assert!(self.download_rustc());
1806+
self.out.join(self.build.triple).join("ci-rustc")
1807+
}
1808+
18031809
/// Determine whether llvm should be linked dynamically.
18041810
///
18051811
/// If `false`, llvm should be linked statically.

src/bootstrap/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ impl Config {
406406
return vec![];
407407
}
408408

409-
let ci_rustc_dir = self.out.join(&*self.build.triple).join("ci-rustc");
409+
let ci_rustc_dir = self.ci_rustc_dir();
410410
let stamp_file = ci_rustc_dir.join(stamp_file);
411411
let contents_file = t!(File::open(&stamp_file), stamp_file.display().to_string());
412412
t!(BufReader::new(contents_file).lines().collect())

src/bootstrap/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -819,11 +819,6 @@ impl Build {
819819
self.stage_out(compiler, mode).join(&*target.triple).join(self.cargo_dir())
820820
}
821821

822-
/// Directory where the extracted `rustc-dev` component is stored.
823-
fn ci_rustc_dir(&self, target: TargetSelection) -> PathBuf {
824-
self.out.join(&*target.triple).join("ci-rustc")
825-
}
826-
827822
/// Root output directory for LLVM compiled for `target`
828823
///
829824
/// Note that if LLVM is configured externally then the directory returned

0 commit comments

Comments
 (0)