Skip to content

Allow to specify the output file for --timings #12898

@glandium

Description

@glandium

Problem

Using cargo build --timings creates a target/cargo-timings/cargo-timing-YYYYMMDDTHHMMSSZ.html file as well as a symbolic link target/cargo-timings/cargo-timing.html. The only way to reliably know the exact file that a specific invocation of cargo has created is to parse its output and look for "Timing report saved to" (relying on the symbolic link is not time-resistant).

Proposed Solution

It would be useful to allow e.g. cargo build --timings=/path/to/my-report.html that would make cargo create said file instead of target/cargo-timings/cargo-timing-YYYYMMDDTHHMMSSZ.html. Whether it should skip creating a symbolic link or not is an open question.

--timings=html and timings=json would still have their current meaning, and the extension of the file would determine the format (i.e. --timings=/path/to/report.json would create a file with the json format)

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-timingsArea: timingsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions