Skip to content

Commit ab94645

Browse files
committed
Get rid of paths function
Some history about `paths()`. The original intent @Mark-Simulacrum had when he introduced PathSet, to my knowledge, was that multiple paths could be aliases for the same step. That's what rustdoc is doing; both paths for rustdoc run exactly the same Step, regardless of whether one or both are present. That never really caught on. To my knowledge, rustdoc is the only usage of paths() there's ever been. Later, in #95503, I repurposed PathSet to mean "each crate in this set should be passed to Step::make_run in RunConfig". That was not the previous meaning. Rustdoc never looks at run.paths in make_run, so it's safe to just treat it as an alias, like elsewhere in bootstrap. Same for all the other tool steps.
1 parent a7f8b2f commit ab94645

12 files changed

Lines changed: 30 additions & 40 deletions

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ macro_rules! tool_check_step {
706706
const IS_HOST: bool = true;
707707

708708
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
709-
run.paths(&[ $path, $( $alt_path ),* ])
709+
run.path($path) $( .path( $alt_path ) )*
710710
}
711711

712712
fn is_default_step(_builder: &Builder<'_>) -> bool {

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3155,7 +3155,7 @@ impl Step for CrateRustdoc {
31553155
const IS_HOST: bool = true;
31563156

31573157
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
3158-
run.paths(&["src/librustdoc", "src/tools/rustdoc"])
3158+
run.path("src/librustdoc").path("src/tools/rustdoc")
31593159
}
31603160

31613161
fn is_default_step(_builder: &Builder<'_>) -> bool {

src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,5 @@ expression: bench
9898
- Set({bench::compiler/rustc_windows_rc})
9999
[Bench] test::CrateRustdoc
100100
targets: [x86_64-unknown-linux-gnu]
101-
- Set({bench::src/librustdoc, bench::src/tools/rustdoc})
101+
- Set({bench::src/librustdoc})
102+
- Set({bench::src/tools/rustdoc})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ expression: check
8282
- Set({check::compiler/rustc_windows_rc})
8383
[Check] check::Rustdoc
8484
targets: [x86_64-unknown-linux-gnu]
85-
- Set({check::src/librustdoc, check::src/tools/rustdoc})
85+
- Set({check::src/librustdoc})
86+
- Set({check::src/tools/rustdoc})
8687
[Check] check::CraneliftCodegenBackend
8788
targets: [x86_64-unknown-linux-gnu]
8889
- Set({check::cg_clif})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ expression: check compiletest --include-default-paths
8282
- Set({check::compiler/rustc_windows_rc})
8383
[Check] check::Rustdoc
8484
targets: [x86_64-unknown-linux-gnu]
85-
- Set({check::src/librustdoc, check::src/tools/rustdoc})
85+
- Set({check::src/librustdoc})
86+
- Set({check::src/tools/rustdoc})
8687
[Check] check::CraneliftCodegenBackend
8788
targets: [x86_64-unknown-linux-gnu]
8889
- Set({check::cg_clif})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ expression: fix
8282
- Set({fix::compiler/rustc_windows_rc})
8383
[Fix] check::Rustdoc
8484
targets: [x86_64-unknown-linux-gnu]
85-
- Set({fix::src/librustdoc, fix::src/tools/rustdoc})
85+
- Set({fix::src/librustdoc})
86+
- Set({fix::src/tools/rustdoc})
8687
[Fix] check::CraneliftCodegenBackend
8788
targets: [x86_64-unknown-linux-gnu]
8889
- Set({fix::cg_clif})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ expression: test
148148
- Set({test::compiler/rustc_windows_rc})
149149
[Test] test::CrateRustdoc
150150
targets: [x86_64-unknown-linux-gnu]
151-
- Set({test::src/librustdoc, test::src/tools/rustdoc})
151+
- Set({test::src/librustdoc})
152+
- Set({test::src/tools/rustdoc})
152153
[Test] test::CrateRustdocJsonTypes
153154
targets: [x86_64-unknown-linux-gnu]
154155
- Set({test::src/rustdoc-json-types})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ expression: test librustdoc rustdoc
44
---
55
[Test] test::CrateRustdoc
66
targets: [x86_64-unknown-linux-gnu]
7-
- Set({test::src/librustdoc, test::src/tools/rustdoc})
7+
- Set({test::src/librustdoc})
8+
- Set({test::src/tools/rustdoc})
89
[Test] test::RustdocBook
910
targets: [x86_64-unknown-linux-gnu]
1011
- Set({test::src/doc/rustdoc})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ expression: test --skip=coverage
147147
- Set({test::compiler/rustc_windows_rc})
148148
[Test] test::CrateRustdoc
149149
targets: [x86_64-unknown-linux-gnu]
150-
- Set({test::src/librustdoc, test::src/tools/rustdoc})
150+
- Set({test::src/librustdoc})
151+
- Set({test::src/tools/rustdoc})
151152
[Test] test::CrateRustdocJsonTypes
152153
targets: [x86_64-unknown-linux-gnu]
153154
- Set({test::src/rustdoc-json-types})

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ expression: test --skip=tests
112112
- Set({test::compiler/rustc_windows_rc})
113113
[Test] test::CrateRustdoc
114114
targets: [x86_64-unknown-linux-gnu]
115-
- Set({test::src/librustdoc, test::src/tools/rustdoc})
115+
- Set({test::src/librustdoc})
116+
- Set({test::src/tools/rustdoc})
116117
[Test] test::CrateRustdocJsonTypes
117118
targets: [x86_64-unknown-linux-gnu]
118119
- Set({test::src/rustdoc-json-types})

0 commit comments

Comments
 (0)