Skip to content

Difficult to know when to stop parsing JSON messages. #7978

Description

@ehuss

Describe the problem you are trying to solve
It is currently difficult when parsing JSON messages to know when Cargo is finished. With cargo test or cargo run, additional things will be printed to stdout. Tools should scan for lines that start with { to detect JSON, but that doesn't help if the subsequent process also emits {.

Describe the solution you'd like
I think Cargo should emit some JSON message to indicate that it is finished. Tools can use this to know when to stop parsing. Or perhaps the message should be structured to indicate that Cargo is running an external process (with the path to the process). This may be complicated with tests since multiple tests will run (and would be good to have a story for how JSON test output works).

Either way, tools need some way to know when Cargo stops, and something else begins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-json-outputArea: JSON message outputC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions