Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 00cd943

Browse files
committed
adapt bootstrap tests to the new path resolution logic
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent a8516c0 commit 00cd943

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl Step for Std {
9393
const DEFAULT: bool = true;
9494

9595
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
96-
run.crate_or_deps("sysroot").path("library")
96+
run.crate_or_deps("sysroot").path("library").alias("core")
9797
}
9898

9999
fn make_run(run: RunConfig<'_>) {

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,10 @@ impl Step for Std {
574574

575575
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
576576
let builder = run.builder;
577-
run.crate_or_deps("sysroot").path("library").default_condition(builder.config.docs)
577+
run.crate_or_deps("sysroot")
578+
.path("library")
579+
.alias("core")
580+
.default_condition(builder.config.docs)
578581
}
579582

580583
fn make_run(run: RunConfig<'_>) {

src/bootstrap/src/core/builder/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@ struct CLIStepPath {
367367
will_be_executed: bool,
368368
}
369369

370+
#[cfg(test)]
371+
impl CLIStepPath {
372+
fn will_be_executed(mut self, will_be_executed: bool) -> Self {
373+
self.will_be_executed = will_be_executed;
374+
self
375+
}
376+
}
377+
370378
impl Debug for CLIStepPath {
371379
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
372380
write!(f, "{}", self.path.display())

src/bootstrap/src/core/builder/tests.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,17 @@ fn test_intersection() {
108108
};
109109
let library_set = set(&["library/core", "library/alloc", "library/std"]);
110110
let mut command_paths = vec![
111-
PathBuf::from("library/core"),
112-
PathBuf::from("library/alloc"),
113-
PathBuf::from("library/stdarch"),
111+
CLIStepPath::from(PathBuf::from("library/core")),
112+
CLIStepPath::from(PathBuf::from("library/alloc")),
113+
CLIStepPath::from(PathBuf::from("library/stdarch")),
114114
];
115115
let subset = library_set.intersection_removing_matches(&mut command_paths, Kind::Build);
116116
assert_eq!(subset, set(&["library/core", "library/alloc"]),);
117-
assert_eq!(command_paths, vec![PathBuf::from("library/stdarch")]);
117+
assert_eq!(command_paths, vec![
118+
CLIStepPath::from(PathBuf::from("library/core")).will_be_executed(true),
119+
CLIStepPath::from(PathBuf::from("library/alloc")).will_be_executed(true),
120+
CLIStepPath::from(PathBuf::from("library/stdarch")).will_be_executed(false),
121+
]);
118122
}
119123

120124
#[test]

0 commit comments

Comments
 (0)