Skip to content

Commit

Permalink
[Backport release-24.11] Fail GHA eval on non-empty stderr (#382099)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangwalther authored Feb 14, 2025
2 parents 3b9b9ba + dccd2b7 commit 628d2d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ci/eval/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ let
export NIX_SHOW_STATS_PATH="$outputDir/stats/$myChunk"
echo "Chunk $myChunk on $system start"
set +e
command time -f "Chunk $myChunk on $system done [%MKB max resident, %Es elapsed] %C" \
command time -o "$outputDir/timestats/$myChunk" \
-f "Chunk $myChunk on $system done [%MKB max resident, %Es elapsed] %C" \
nix-env -f "${nixpkgs}/pkgs/top-level/release-attrpaths-parallel.nix" \
--eval-system "$system" \
--option restrict-eval true \
Expand All @@ -103,13 +104,19 @@ let
--arg includeBroken ${lib.boolToString includeBroken} \
-I ${nixpkgs} \
-I ${attrpathFile} \
> "$outputDir/result/$myChunk"
> "$outputDir/result/$myChunk" \
2> "$outputDir/stderr/$myChunk"
exitCode=$?
set -e
cat "$outputDir/stderr/$myChunk"
cat "$outputDir/timestats/$myChunk"
if (( exitCode != 0 )); then
echo "Evaluation failed with exit code $exitCode"
# This immediately halts all xargs processes
kill $PPID
elif [[ -s "$outputDir/stderr/$myChunk" ]]; then
echo "Nixpkgs on $system evaluated with warnings, aborting"
kill $PPID
fi
'';
in
Expand Down Expand Up @@ -165,7 +172,7 @@ let
''}
chunkOutputDir=$(mktemp -d)
mkdir "$chunkOutputDir"/{result,stats}
mkdir "$chunkOutputDir"/{result,stats,timestats,stderr}
seq -w 0 "$seq_end" |
command time -f "%e" -o "$out/total-time" \
Expand Down

0 comments on commit 628d2d6

Please sign in to comment.