Repository navigation
Conversation
…ltering CargoBuildHandler uses text patterns (Compiling, error[, Finished) that don't match NDJSON lines, so build errors are invisible and the build is reported as compiled when --message-format=json is active. Detect --message-format=json (and json-diagnostic-rendered-ansi, json-render-diagnostics) in args and bypass text filtering for both cargo build and cargo check, preserving raw JSON output unchanged. Fixes rtk-ai#2419
Collaborator
|
Hi, thanks for your work. There’s already #2422, which is more complete since it doesn’t give up on reducing JSON output. It should definitely include your args detection too. Feel free to test it and share any feedback there |
Contributor
Author
|
Thanks for pointing out #2422 — happy to close this one in favor of the more complete approach there. Let me know if there's anything from my args detection logic worth cherry-picking into that PR. |
Contributor
Author
|
Superseded by #2422 which handles --message-format=json more completely. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CargoBuildHandleruses text patterns (Compiling,error[,Finished) that don't match NDJSON lines, so--message-format=jsonbuilds report "compiled" even on failure and hide all compiler errors--message-format=json(andjson-diagnostic-rendered-ansi,json-render-diagnostics) in args and bypass text filtering, passing raw JSON output unchangedcargo buildandcargo check(same handler)Fixes #2419
Test plan
has_json_message_formatdetection (inline=, space-separated, all JSON variants, negative cases)cargo test --allpasses (2244 pass, 2 pre-existing unrelated failures)--message-format=jsonnow shows error diagnostic JSON +"success":false+ exit 101--message-format=jsonshows artifact JSON +"success":true+ exit 0