create a message format targeted at ci / build pipelines #14709
Labels
A-json-output
Area: JSON message output
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-build
S-triage
Status: This issue is waiting on initial triage.
Uh oh!
There was an error while loading. Please reload this page.
Problem
Currently, it's surprisingly difficult to get the artifact built by
cargo-build
. (Prior discussion: #3757)I have a custom build pipeline where it's helpful to both show human ANSI colored diagnostics (so if something goes wrong, I can see it easily in the logs), but also necessary to print the artifact path to stdout for the build pipeline to manage.
I built a very small wrapper tool (https://github.com/kurtbuilds/cargo_build_artifact) that runs cargo in json-diagnostic-rendered-ansi, and depending on the message that's output, sends diagnostics and errors to stderr, swallows other diagnostics, and emits a single line - the path of the built artifact - to stdout.
Curious if
cargo
team would support a PR to merge that functionality in under a newmessage-format
- (maybe calledhuman-with-build-artifacts
to build on naming conventions already used?)Proposed Solution
Create a new message-format (tentatively called
human-with-build-artifacts
) that outputs colored warnings and errors to stderr, and prints build artifact paths, one per line, to stdout.The text was updated successfully, but these errors were encountered: