File tree Expand file tree Collapse file tree
include/vix/cli/commands/run Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -293,12 +293,17 @@ namespace vix::commands::RunCommand::detail
293293 fs::path rootDir;
294294 fs::path binaryPath;
295295 fs::path metaFile;
296+ fs::path failureMetaFile;
296297 fs::path stdoutLogPath;
297298 fs::path stderrLogPath;
298299
299300 std::string cacheKey;
300301 std::string rebuildReason;
302+
303+ int cachedFailureExitCode = 0 ;
304+
301305 bool cacheHit = false ;
306+ bool cachedFailure = false ;
302307 bool needsRebuild = true ;
303308 };
304309
@@ -720,6 +725,16 @@ namespace vix::commands::RunCommand::detail
720725 */
721726 bool persist_direct_script_cache_metadata (const DirectScriptPlan &plan);
722727
728+ bool persist_direct_script_failure_cache (
729+ const DirectScriptPlan &plan,
730+ int exitCode,
731+ const std::string &stdoutText,
732+ const std::string &stderrText);
733+
734+ int replay_direct_script_cached_failure (
735+ const DirectScriptPlan &plan,
736+ const DirectScriptCacheState &cache);
737+
723738 // ===========================================================================
724739 // Script mode execution
725740 // ===========================================================================
Original file line number Diff line number Diff line change @@ -1520,6 +1520,13 @@ namespace vix::commands::RunCommand::detail
15201520
15211521 const DirectScriptCacheState cache = load_direct_script_cache_state (directPlan);
15221522
1523+ if (cache.cachedFailure )
1524+ {
1525+ return replay_direct_script_cached_failure (
1526+ directPlan,
1527+ cache);
1528+ }
1529+
15231530 if (cache.needsRebuild )
15241531 {
15251532 const LiveRunResult build = run_cmd_live_filtered_capture (
@@ -1532,6 +1539,16 @@ namespace vix::commands::RunCommand::detail
15321539
15331540 if (build.exitCode != 0 )
15341541 {
1542+ if (!persist_direct_script_failure_cache (
1543+ directPlan,
1544+ build.exitCode ,
1545+ build.stdoutText ,
1546+ build.stderrText ))
1547+ {
1548+ std::cerr
1549+ << " warning: unable to persist direct script failure cache\n " ;
1550+ }
1551+
15351552 bool handled = false ;
15361553
15371554 if (!build.stdoutText .empty () || !build.stderrText .empty ())
You can’t perform that action at this time.
0 commit comments