-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-json-outputArea: JSON message outputArea: JSON message outputC-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
When a build script prints cargo::warning=msg to stdout when running, cargo displays it as warning: <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
- Make a crate with a
build.rscontaining the line:println!("cargo::warning=msg"); - Run
cargo check --message-fmt=json - Observe the line of non-JSON in the middle of your 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
cargo 1.79.0 (ffa9cf99a 2024-06-03)
release: 1.79.0
commit-hash: ffa9cf99a594e59032757403d4c780b46dc2c43a
commit-date: 2024-06-03
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Ubuntu 22.4.0 (jammy) [64-bit]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-json-outputArea: JSON message outputArea: JSON message outputC-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.