Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

ci(nix): report both streams before deciding the outcome

EtienneLescota6c1c9cea9a7
diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml
index f4ac6d9c8..5d3e04535 100644
--- a/.github/workflows/nix-build.yml
+++ b/.github/workflows/nix-build.yml
@@ -126,18 +126,22 @@ jobs:
echo "--- openscreen sources --json ---"
RC=0
run_cli $SANDBOX sources --json >/tmp/sources.json 2>/tmp/sources.err || RC=$?
- if [ "$RC" -eq 124 ] || [ "$RC" -eq 137 ]; then
- echo "::error::openscreen sources --json did not return within 120s. A CLI that hangs on a headless host cannot be scripted, and headless is what --json is for."
- echo "--- stderr, last 20 lines before the timeout ---"
- tail -20 /tmp/sources.err || true
- exit 1
- fi
+ # Both streams get reported before anything decides the outcome. The
+ # previous shape returned early on a timeout and threw away the very
+ # thing the run was for: a hang left stdout unseen, so a run that cost
+ # a runner slot said nothing about whether the logging fix had worked.
+ # Whatever the process wrote before it was killed is still on disk.
echo "--- stdout, first 400 bytes ---"
head -c 400 /tmp/sources.json; echo
echo "--- stderr, first 3 lines ---"
head -3 /tmp/sources.err || true
+ if [ "$RC" -eq 124 ] || [ "$RC" -eq 137 ]; then
+ echo "::error::openscreen sources --json did not return within 120s. A CLI that hangs on a headless host cannot be scripted, and headless is what --json is for."
+ exit 1
+ fi
+
python3 <<'PY'
import json
raw = open("/tmp/sources.json").read().strip()