Skip to content

Conversation

@weihanglo
Copy link
Member

@weihanglo weihanglo commented Dec 23, 2025

What does this PR try to resolve?

A new report command cargo report sessions is added.
The motivation of this is to provide an access to the build session ID,
so that user can retrieve reports for specific session.
For example, cargo report timings --id <my-older-build>.

The command name sessions was chosen because

  • It is a thing that Cargo "reports to user",
    feeling more reasonable than cargo report list-runs
    or cargo rebuild recent-builds.
  • Discussed with @Muscraft,
    and we feel SessionId will be a better term in RunId.
    While whether a cargo invocation is a session is debatable,
    sessions the term is widely used for logging and metrics.
  • This is unstable. We can always change its name later.

Part of #15844

Fixes #16401

How to test and review this PR?

See tests for the report output.
It is a simple text-based report. JSON schema is not included.

$ cargo report sessions -Zbuild-analysis
Session IDs for `/projects/cargo` (showing up to 3):

 - 20251218T220836847Z-0e981be2243ad433
 - 20251218T220801494Z-0e981be2243ad433
 - 20251218T220704295Z-0e981be2243ad433

@weihanglo weihanglo added Command-report Z-build-analysis Nightly: build-analysis labels Dec 23, 2025
@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 23, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

So that it can be used elsewhere we need to list log files.
A new report command `cargo report sessions` is added.
The motivation of this is to provide an access to the build session ID,
so that user can retrieve reports for specific session.
For example, `cargo report timings --id <my-older-build>`.

The command name `sessions` was chosen because

* It is a thing that Cargo "reports to user",
  feeling more reasonable than `cargo report list-runs`
  or `cargo rebuild recent-builds`.
* Discussed with `@Muscraft`,
  and we feel `SessionId` will be a better term in `RunId`.
  While whether a `cargo` invocation is a session is debatable,
  sessions the term is widely used for logging and metrics.
* This is unstable. We can always change its name later.

Part of rust-lang#15844
@weihanglo weihanglo changed the title refactor(report): make log file select more generic feat(report): new command cargo report sessions Dec 23, 2025
@weihanglo weihanglo changed the title feat(report): new command cargo report sessions feat(report): new command cargo report sessions Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: Command-line interface, option parsing, etc. Command-report S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. Z-build-analysis Nightly: build-analysis

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A cargo report list command to list available sessions to generate report from

3 participants