Skip to content

Commit 0090c3c

Browse files
authored
Unrolled build for rust-lang#133898
Rollup merge of rust-lang#133898 - onur-ozkan:ignore-git-hook-on-dist-sources, r=jieyouxu skip `setup::Hook` on non-git sources Running `setup::Hook` (with `x setup`) leads tarball sources to panic and this PR resolves that problem by skipping `Hook` step on non-git sources.
2 parents 0e98766 + 34d6a26 commit 0090c3c

File tree

1 file changed

+6
-4
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+6
-4
lines changed

src/bootstrap/src/core/build_steps/setup.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -452,24 +452,26 @@ pub struct Hook;
452452
impl Step for Hook {
453453
type Output = ();
454454
const DEFAULT: bool = true;
455+
455456
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
456457
run.alias("hook")
457458
}
459+
458460
fn make_run(run: RunConfig<'_>) {
459-
if run.builder.config.dry_run() {
460-
return;
461-
}
462461
if let [cmd] = &run.paths[..] {
463462
if cmd.assert_single_path().path.as_path().as_os_str() == "hook" {
464463
run.builder.ensure(Hook);
465464
}
466465
}
467466
}
467+
468468
fn run(self, builder: &Builder<'_>) -> Self::Output {
469469
let config = &builder.config;
470-
if config.dry_run() {
470+
471+
if config.dry_run() || !config.rust_info.is_managed_git_subrepository() {
471472
return;
472473
}
474+
473475
t!(install_git_hook_maybe(builder, config));
474476
}
475477
}

0 commit comments

Comments
 (0)