Skip to content

Commit

Permalink
docs: tools should only interpret a line starting with { as JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Oct 11, 2024
1 parent e8adba9 commit 402cb17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/doc/src/reference/external-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ The `package_id` field is a unique identifier for referring to the package, and
as the `--package` argument to many commands. The syntax grammar can be found in
chapter [Package ID Specifications].

> **Note:** `--message-format=json` only controls Cargo and Rustc's output.
> This cannot control the output of other tools,
> e.g. `cargo run --message-format=json`,
> or arbitrary output from procedural macros.
> A possible workaround in these situations is to only interpret a line as JSON if it starts with `{`.
The `--message-format` option can also take additional formatting values which
alter the way the JSON messages are computed and rendered. See the description
of the `--message-format` option in the [build command documentation] for more
Expand Down

0 comments on commit 402cb17

Please sign in to comment.