Skip to content

Commit 1789cba

Browse files
committed
fix runtime diagnostics for script sanitizer runs
1 parent 1a7f9aa commit 1789cba

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

src/commands/run/RunScript.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -959,14 +959,14 @@ namespace vix::commands::RunCommand::detail
959959
error("Failed to write generated CMakeLists.txt.");
960960
return 1;
961961
}
962+
962963
out << cmakeText;
963-
}
964964

965-
if (!state.configSignature.empty())
966-
{
967-
std::ofstream sig(state.sigFile, std::ios::trunc);
968-
if (sig)
969-
sig << state.configSignature;
965+
if (!out)
966+
{
967+
error("Failed to write generated CMakeLists.txt completely.");
968+
return 1;
969+
}
970970
}
971971

972972
return 0;

src/commands/run/detail/DirectScriptRunner.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <vix/cli/commands/run/RunScriptHelpers.hpp>
1818
#include <vix/cli/commands/replay/ReplayCapture.hpp>
1919
#include <vix/cli/commands/replay/ReplayRecorder.hpp>
20+
#include <vix/cli/errors/RawLogDetectors.hpp>
2021
#include <vix/cli/ErrorHandler.hpp>
2122
#include <vix/cli/Style.hpp>
2223
#include <vix/utils/Env.hpp>
@@ -833,7 +834,23 @@ namespace vix::commands::RunCommand::detail
833834
return 0;
834835
}
835836

836-
handle_runtime_exit_code(run.exitCode, "run", run.failureHandled);
837+
bool handled = run.failureHandled;
838+
839+
if (!handled && run.exitCode != 0)
840+
{
841+
std::string runtimeLog = run.stderrText;
842+
runtimeLog += run.stdoutText;
843+
844+
if (!runtimeLog.empty())
845+
{
846+
handled = vix::cli::errors::RawLogDetectors::handleRuntimeCrash(
847+
runtimeLog,
848+
plan.scriptPath,
849+
"run");
850+
}
851+
}
852+
853+
handle_runtime_exit_code(run.exitCode, "run", handled);
837854
return run.exitCode;
838855
}
839856

0 commit comments

Comments
 (0)