Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ macro_rules! tool_check_step {
const IS_HOST: bool = true;

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

fn is_default_step(_builder: &Builder<'_>) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3155,7 +3155,7 @@ impl Step for CrateRustdoc {
const IS_HOST: bool = true;

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

fn is_default_step(_builder: &Builder<'_>) -> bool {
Expand Down Expand Up @@ -3816,7 +3816,7 @@ impl Step for CodegenCranelift {
const IS_HOST: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.paths(&["compiler/rustc_codegen_cranelift"])
run.path("compiler/rustc_codegen_cranelift")
}

fn is_default_step(_builder: &Builder<'_>) -> bool {
Expand Down Expand Up @@ -3937,7 +3937,7 @@ impl Step for CodegenGCC {
const IS_HOST: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.paths(&["compiler/rustc_codegen_gcc"])
run.path("compiler/rustc_codegen_gcc")
}

fn is_default_step(_builder: &Builder<'_>) -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ expression: bench
- Set({bench::compiler/rustc_windows_rc})
[Bench] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({bench::src/librustdoc, bench::src/tools/rustdoc})
- Set({bench::src/librustdoc})
- Set({bench::src/tools/rustdoc})
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ expression: check
- Set({check::compiler/rustc_windows_rc})
[Check] check::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({check::src/librustdoc, check::src/tools/rustdoc})
- Set({check::src/librustdoc})
- Set({check::src/tools/rustdoc})
[Check] check::CraneliftCodegenBackend
targets: [x86_64-unknown-linux-gnu]
- Set({check::cg_clif})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ expression: check compiletest --include-default-paths
- Set({check::compiler/rustc_windows_rc})
[Check] check::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({check::src/librustdoc, check::src/tools/rustdoc})
- Set({check::src/librustdoc})
- Set({check::src/tools/rustdoc})
[Check] check::CraneliftCodegenBackend
targets: [x86_64-unknown-linux-gnu]
- Set({check::cg_clif})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ expression: fix
- Set({fix::compiler/rustc_windows_rc})
[Fix] check::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({fix::src/librustdoc, fix::src/tools/rustdoc})
- Set({fix::src/librustdoc})
- Set({fix::src/tools/rustdoc})
[Fix] check::CraneliftCodegenBackend
targets: [x86_64-unknown-linux-gnu]
- Set({fix::cg_clif})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ expression: test
- Set({test::compiler/rustc_windows_rc})
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
- Set({test::src/librustdoc})
- Set({test::src/tools/rustdoc})
[Test] test::CrateRustdocJsonTypes
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/rustdoc-json-types})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ expression: test librustdoc rustdoc
---
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
- Set({test::src/librustdoc})
- Set({test::src/tools/rustdoc})
[Test] test::RustdocBook
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/doc/rustdoc})
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ expression: test --skip=coverage
- Set({test::compiler/rustc_windows_rc})
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
- Set({test::src/librustdoc})
- Set({test::src/tools/rustdoc})
[Test] test::CrateRustdocJsonTypes
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/rustdoc-json-types})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ expression: test --skip=tests
- Set({test::compiler/rustc_windows_rc})
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
- Set({test::src/librustdoc})
- Set({test::src/tools/rustdoc})
[Test] test::CrateRustdocJsonTypes
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/rustdoc-json-types})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ expression: test --skip=tests --skip=coverage-map --skip=coverage-run --skip=lib
- Set({test::compiler/rustc_windows_rc})
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
- Set({test::src/librustdoc})
- Set({test::src/tools/rustdoc})
[Test] test::CrateRustdocJsonTypes
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/rustdoc-json-types})
Expand Down
39 changes: 10 additions & 29 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,38 +558,19 @@ impl<'a> ShouldRun<'a> {
/// single, non-aliased path
///
/// Must be an on-disk path; use `alias` for names that do not correspond to on-disk paths.
pub fn path(self, path: &str) -> Self {
self.paths(&[path])
}

/// Multiple aliases for the same job.
///
/// This differs from [`path`] in that multiple calls to path will end up calling `make_run`
/// multiple times, whereas a single call to `paths` will only ever generate a single call to
/// `make_run`.
///
/// This is analogous to `all_krates`, although `all_krates` is gone now. Prefer [`path`] where possible.
///
/// [`path`]: ShouldRun::path
pub fn paths(mut self, paths: &[&str]) -> Self {
pub fn path(mut self, path: &str) -> Self {
let submodules_paths = self.builder.submodule_paths();

self.paths.insert(PathSet::Set(
paths
.iter()
.map(|p| {
// assert only if `p` isn't submodule
if !submodules_paths.iter().any(|sm_p| p.contains(sm_p)) {
assert!(
self.builder.src.join(p).exists(),
"`should_run.paths` should correspond to real on-disk paths - use `alias` if there is no relevant path: {p}"
);
}
// assert only if `p` isn't submodule
if !submodules_paths.iter().any(|sm_p| path.contains(sm_p)) {
assert!(
self.builder.src.join(path).exists(),
"`should_run.path` should correspond to a real on-disk path - use `alias` if there is no relevant path: {path}"
);
}

TaskPath { path: p.into(), kind: Some(self.kind) }
})
.collect(),
));
let task = TaskPath { path: path.into(), kind: Some(self.kind) };
self.paths.insert(PathSet::Set(BTreeSet::from_iter([task])));
self
}

Expand Down
Loading