authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-09-24 11:26:06-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-09-26 19:08:50-04:00
log146d0529ca5c0f0044ea28c0450250273862df2a
tree487cf022bad7a7e2da07f9f03f11e1e186793136
parentb6f68ca4ba477213ea89bc0ac6c9422f78116692

Maker.Step.Run: watch even in the face of skip/failure


1 files changed, 25 insertions(+), 5 deletions(-)

lib/compiler/Maker/Step/Run.zig+25-5
......@@ -571,8 +571,18 @@ pub fn make(
571571 .args = protocol_args.items,
572572 } },
573573 });
574 try runCommand(arena, run, run_index, maker, progress_node, argv_list.items, &.{}, &.{}, &.{}, &.{}, null, has_side_effects, output_dir_path, null);
575 if (!has_side_effects) try step.finalizeManifestAndWatch(maker, &man);
574 runCommand(arena, run, run_index, maker, progress_node, argv_list.items, &.{}, &.{}, &.{}, &.{}, null, has_side_effects, output_dir_path, null) catch |err| switch (err) {
575 else => |e| return e,
576 error.MakeFailed, error.MakeSkipped => |e| {
577 try step.setWatchInputsFromManifest(maker, &man);
578 return e;
579 },
580 };
581 if (has_side_effects) {
582 try step.setWatchInputsFromManifest(maker, &man);
583 } else {
584 try step.finalizeManifestAndWatch(maker, &man);
585 }
576586 return;
577587 }
578588
......@@ -591,7 +601,7 @@ pub fn make(
591601 .args = protocol_args.items,
592602 } },
593603 });
594 try runCommand(
604 runCommand(
595605 arena,
596606 run,
597607 run_index,
......@@ -606,7 +616,13 @@ pub fn make(
606616 has_side_effects,
607617 tmp_dir_path,
608618 null,
609 );
619 ) catch |err| switch (err) {
620 else => |e| return e,
621 error.MakeFailed, error.MakeSkipped => |e| {
622 try step.setWatchInputsFromManifest(maker, &man);
623 return e;
624 },
625 };
610626
611627 for (output_placeholders.items) |placeholder| {
612628 const arg = placeholder.arg_index.get(conf);
......@@ -681,7 +697,11 @@ pub fn make(
681697 };
682698 }
683699
684 if (!has_side_effects) try step.finalizeManifestAndWatch(maker, &man);
700 if (has_side_effects) {
701 try step.setWatchInputsFromManifest(maker, &man);
702 } else {
703 try step.finalizeManifestAndWatch(maker, &man);
704 }
685705
686706 try populateGeneratedStdIo(maker, &conf_run, &digest);
687707 try populateGeneratedPaths(maker, output_placeholders.items, &digest);