Skip to content

Commit

Permalink
fix(mcl): Fail job on nix-eval-jobs failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Xearty committed Oct 23, 2024
1 parent 35d4f75 commit e903cec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/mcl/src/src/mcl/commands/ci_matrix.d
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t
errorf("Command `%s` failed with error:\n---\n%s\n---", commandString, errorMsg);
}

bool jobFailed = false;

foreach (line; pipes.stdout.byLine)
{
if (line.indexOf("{") == -1)
Expand All @@ -347,6 +349,7 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t
if (auto err = "error" in json)
{
logError((*err).str);
jobFailed = true;
continue; // drain the output
}

Expand Down Expand Up @@ -380,7 +383,8 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t
logWarning(stderrLogs);

int status = wait(pipes.pid);
enforce(status == 0, "Command `%s` failed with status %s".fmt(args, status));
jobFailed = jobFailed || status != 0;
enforce(!jobFailed, "Command `%s` failed with status %s".fmt(commandString, status));

return result;
}
Expand Down

0 comments on commit e903cec

Please sign in to comment.