Skip to content

Print each failed grammar's full error in the build summary - #29

Merged
appellation merged 1 commit into
mainfrom
diagnose-luau-ci-failure-pr-28
Nov 13, 2026
Merged

appellation merged 1 commit into
mainfrom
diagnose-luau-ci-failure-pr-28

Conversation

@appellation

Copy link
Copy Markdown
Contributor

Problem

build wasm grammars builds grammars in parallel, so their streamed output interleaves. When one fails, the final error only names it:

Error: 1 of 12 grammar(s) failed: luau

The reason is buried mid-log. In the #28 CI run it was an emcc: error: undefined exported symbol: "_tree_sitter_luau_external_scanner_create" line surrounded by other grammars' output.

Change

  • cli/src/lib/util.ts: run/runCapture now reject with a CommandError carrying the child's full stderr. The error message includes the last 20 lines, so the per-step ✖ … [FAILED: …] lines show the reason without getting long.
  • cli/src/commands/build/wasm/grammars.ts: the end-of-run summary lists each failed grammar's failing step, command, and complete stderr:
    1 of 12 grammar(s) failed: luau
    
    --- luau ---
    linking grammars into wasm: emcc -O2 … exited with code 1
    emcc: error: undefined exported symbol: "_tree_sitter_luau_external_scanner_create" [-Wundefined] [-Werror]
    
  • collectErrors moves to the root list. Nested listr2 lists share the root's errors array, which is null unless the root collects, so the per-grammar list's own collectErrors: true never did anything. Adding the options argument made Biome re-indent buildAll, so the diff looks bigger than it is.

Testing

  • tsc --noEmit and Biome pass for the CLI.
  • I couldn't run a real grammar build locally (no submodules in this checkout). Instead a small script reproduced the same four levels of nested lists, used the real run() and the failureReason source, and had one grammar's step write 30 lines of stderr and exit 1. Its step lines showed lines 11–30, and the final summary showed all 30.
  • This PR's own CI only exercises the success path, since every grammar builds on main.

🤖 Generated with Claude Code

`build wasm grammars` builds grammars in parallel, so their streamed
output interleaves and the final error only named the failed grammars
("1 of 12 grammar(s) failed: luau"). The actual reason was buried
mid-log.

- `run`/`runCapture` now reject with a `CommandError` carrying the
  child's full stderr. Its message includes the last 20 lines, so the
  per-step `[FAILED: ...]` lines show the reason without getting long.
- The end-of-run summary lists each failed grammar's failing step,
  command, and complete stderr.
- `collectErrors` moves to the root list. Nested listr2 lists share the
  root's `errors` array, which is null unless the root collects, so the
  per-grammar list's own `collectErrors: true` was a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@appellation
appellation merged commit a2f699d into main Nov 13, 2026
32 checks passed
@appellation
appellation deleted the diagnose-luau-ci-failure-pr-28 branch November 13, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant