Skip to content

vendor: add summary output for crates vendored#16646

Open
raushan728 wants to merge 3 commits intorust-lang:masterfrom
raushan728:feature/vendor-summary-output
Open

vendor: add summary output for crates vendored#16646
raushan728 wants to merge 3 commits intorust-lang:masterfrom
raushan728:feature/vendor-summary-output

Conversation

@raushan728
Copy link
Contributor

Adds a final status message to 'cargo vendor' showing the count of crates vendored and the destination directory. This improves consistency with other commands like 'cargo install'

@rustbot rustbot added Command-vendor S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 15, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 15, 2026

r? @weihanglo

rustbot has assigned @weihanglo.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this change might be simple and straightforwards, our contributing guideline encourages starting from an issue and discussion first before posting a pull request: https://doc.crates.io/contrib/process/working-on-cargo.html#before-hacking-on-cargo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that i am still learning the workflow here. I'll make sure to start with an issue next time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a final status message to 'cargo vendor' showing the count of crates vendored and the destination directory. This improves consistency with other commands like 'cargo install'

I personally don't immediately see the value of consistency here. Other maintainers may have different opinions though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, count of binaries installed via cargo install is essentially as we might not want to accidentally install extra bins. But do people really know about how many dependencies they vendor? What is the actual summary people want to know when vendoring. This might be worthy some level of discussions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought a final confirmation would be helpful for large workspaces, but I'm open to suggestions if you think the summary should be different or is unnecessary

Package::new("bar", "0.1.0").publish();

p.cargo("vendor --respect-source-config")
.with_stderr_contains("[..]Vendored 1 crates into [..]vendor")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recommend snapshot testing with with_stderr_data method as the primary way to assert snapshot. See https://doc.crates.io/contrib/tests/writing.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip I've updated the test to use with_stderr_data and snapshot matching

@raushan728
Copy link
Contributor Author

hi @weihanglo fixed the tests and logic. also, sorry for skipping the issue process—i am still learning the workflow. plz take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Command-vendor S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants