Skip to content

Commit 96c2e2b

Browse files
committed
Move ci_rustc_dir to Config and use it consistently
1 parent 7f27750 commit 96c2e2b

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/bootstrap/compile.rs

+2-2
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

+7
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,13 @@ 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_commit.is_some());
1806+
assert!(self.download_rustc());
1807+
self.out.join(self.build.triple).join("ci-rustc")
1808+
}
1809+
18031810
/// Determine whether llvm should be linked dynamically.
18041811
///
18051812
/// If `false`, llvm should be linked statically.

src/bootstrap/download.rs

+1-1
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

-5
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,6 @@ impl Build {
822822
self.stage_out(compiler, mode).join(&*target.triple).join(self.cargo_dir())
823823
}
824824

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

0 commit comments

Comments
 (0)