Closed JarredAllen closed 1 month ago
This applies to much more than build scripts but to all cargo warnings and errors. We have #8283 tracking that and I would be inclined to close this in favor of #8283.
What about verbose (-vv
) build script outputs? They are usually from an external build system and not possible to make it respect --message-format=json
?
We have #8283 tracking that and I would be inclined to close this in favor of #8283.
Agree.
Problem
When a build script prints
cargo::warning=msg
to stdout when running,cargo
displays it aswarning: <crate>: msg
. This is great for human output, but causes problems when run with--message-format=json
and passed to tooling that expects JSON data.Steps
build.rs
containing the line:println!("cargo::warning=msg");
cargo check --message-fmt=json
Possible Solution(s)
It'd be cool if cargo could convert it into a JSON object of a similar format to warnings that cargo/rustc directly emit.
Notes
No response
Version