From 146d0529ca5c0f0044ea28c0450250273862df2a Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Thu, 24 Sep 2026 11:26:06 -0400 Subject: [PATCH] Maker.Step.Run: watch even in the face of skip/failure --- lib/compiler/Maker/Step/Run.zig | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/compiler/Maker/Step/Run.zig b/lib/compiler/Maker/Step/Run.zig index c33cdeb2936e18c0e0031a2d78da9634e6f0a81e..58bf2c7b8818fec5f1473a648b92c5b2af2a656f 100644 --- a/lib/compiler/Maker/Step/Run.zig +++ b/lib/compiler/Maker/Step/Run.zig @@ -571,8 +571,18 @@ pub fn make( .args = protocol_args.items, } }, }); - try runCommand(arena, run, run_index, maker, progress_node, argv_list.items, &.{}, &.{}, &.{}, &.{}, null, has_side_effects, output_dir_path, null); - if (!has_side_effects) try step.finalizeManifestAndWatch(maker, &man); + runCommand(arena, run, run_index, maker, progress_node, argv_list.items, &.{}, &.{}, &.{}, &.{}, null, has_side_effects, output_dir_path, null) catch |err| switch (err) { + else => |e| return e, + error.MakeFailed, error.MakeSkipped => |e| { + try step.setWatchInputsFromManifest(maker, &man); + return e; + }, + }; + if (has_side_effects) { + try step.setWatchInputsFromManifest(maker, &man); + } else { + try step.finalizeManifestAndWatch(maker, &man); + } return; } @@ -591,7 +601,7 @@ pub fn make( .args = protocol_args.items, } }, }); - try runCommand( + runCommand( arena, run, run_index, @@ -606,7 +616,13 @@ pub fn make( has_side_effects, tmp_dir_path, null, - ); + ) catch |err| switch (err) { + else => |e| return e, + error.MakeFailed, error.MakeSkipped => |e| { + try step.setWatchInputsFromManifest(maker, &man); + return e; + }, + }; for (output_placeholders.items) |placeholder| { const arg = placeholder.arg_index.get(conf); @@ -681,7 +697,11 @@ pub fn make( }; } - if (!has_side_effects) try step.finalizeManifestAndWatch(maker, &man); + if (has_side_effects) { + try step.setWatchInputsFromManifest(maker, &man); + } else { + try step.finalizeManifestAndWatch(maker, &man); + } try populateGeneratedStdIo(maker, &conf_run, &digest); try populateGeneratedPaths(maker, output_placeholders.items, &digest); -- 2.54.0