Skip to content

compiletest: Printing process output panics if the output contains unknown JSON-like text #126373

Closed
@Zalathar

Description

@Zalathar

When a process unexpectedly fails/succeeds, compiletest will often print a full dump of its stdout and stderr for diagnostic purposes.

When this happens, ProcRes::print_info calls into extract_rendered, which has special handling for lines starting with {. It tries to parse the line as JSON in one of a few known compiler-specific formats, in order to replace it with a more human-friendly message.

If the line doesn't match any of those formats (or isn't valid JSON), the extractor code will panic, instead of just printing the line as-is. This is awkward in cases where we actually wanted to print the line as-is anyway, because now the error messages are less helpful.

@rustbot label +A-compiletest

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions