Skip to content

Provide a way to specify session for cargo report commands #16472

@weihanglo

Description

@weihanglo

Problem

In #15844 We have introduce two new unstable commands

  • cargo report timings
  • cargo report rebuilds

to report information for the latest build session.

However, people might want to look at arbitrary previous builds. but there is no way to specify session in other report command.

Proposed Solution

Introduce a way to inspect a specific session for cargo report timings and cargo report rebuilds. An --id flag might be a good starting point.

We already have cargo report sessions command that lists all previous sessions like this:

$ cargo +nightly report sessions -Zbuild-analysis
Session IDs for `/project/foo` (most recent first):

 - 20260101T212605604Z-0e981be2243ad433
 - 20260101T212542189Z-0e981be2243ad433
 - 20260101T211942857Z-0e981be2243ad433
 - 20251231T223721728Z-0e981be2243ad433
 - 20251231T223705871Z-0e981be2243ad433
 - 20251231T223625197Z-0e981be2243ad433
 - 20251231T223604944Z-0e981be2243ad433
 - 20251231T222913805Z-0e981be2243ad433
 - 20251231T222817405Z-0e981be2243ad433
 - 20251231T222718409Z-0e981be2243ad433

... and more (use --limit N to see more)

People can copy those ID and pass to --id.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewZ-build-analysisNightly: build-analysis

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions