-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Associate --message-format=json with session ID from -Zbuild-analysis #16576
Copy link
Copy link
Open
Labels
A-json-outputArea: JSON message outputArea: JSON message outputC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-build-analysisNightly: build-analysisNightly: build-analysis
Metadata
Metadata
Assignees
Labels
A-json-outputArea: JSON message outputArea: JSON message outputC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-build-analysisNightly: build-analysisNightly: build-analysis
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Before
-Zbuild-analysis, if people wanted to analyzecargo buildinformation, they usually invoked Cargo with--message-format=json, captured stdout, and did live or post analysis.Now with
-Zbuild-analysis, the new structured logging system, Cargo has two similar systems emitting build information. While at the moment--message-format=jsonis closer to the actual compiler invocation, there are still overlaps between them. We plan to design around either unifying them, or having a clear principle for what message goes where. There was #16418, which did a dumb, simple pull request that redirected logs as stdout messages, and vice versa, without thinking more deeply about that question. The pull request was just speculation, and we didn't know if it was really useful, hence it was closed.However, on Zulip one user pointed out that the removal of
--timings=jsonwithout any alternative makes real-time timings analysis harder. There is no programmatic way to connect the build you just ran with a log file in~/.cargo/log.While the design space of log/message unification is much larger than this problem, we may want to provide a short-term solution that also gives us a better foundation to solicit feedback for different use cases
Proposed Solution
For a short term workaround to unblock people to do more experiments, we might want to
LogMessage::BuildStartedas a JSON message,Either way, that enables user to associate them.
Note that everything should behind
-Zbuild-analysis. If the nightly flag is not enabled, Cargo must not emit any new fields.Notes
No response