-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
model-checking/kani
#4201Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-metadataS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewT-cargoTeam: CargoTeam: Cargodisposition-mergeFCP with intent to mergeFCP with intent to mergefinished-final-comment-periodFCP completeFCP complete
Description
Describe the problem you are trying to solve
For a workspace, it is possible to specify default members through the workspace.default-members
key. It would be great to expose this information through cargo metadata
.
Describe the solution you'd like
The same format as workspace_members
in cargo metadata
-- a list of package IDs.
celinval and WorldSEnder
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-metadataS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewT-cargoTeam: CargoTeam: Cargodisposition-mergeFCP with intent to mergeFCP with intent to mergefinished-final-comment-periodFCP completeFCP complete
Activity
sunshowers commentedon Mar 24, 2020
cc @metajack
charles-r-earp commentedon Apr 15, 2023
I implemented this here https://github.com/charles-r-earp/cargo. I fixed one test "cargo_metadata_simple".
sunshowers commentedon Apr 15, 2023
@charles-r-earp that looks great! you can probably submit that as a PR to this repo.
workspace_default_members
#11978weihanglo commentedon Apr 26, 2023
Hello all. Thanks for the proposal and the pull request. I'd like to know more about why default members in
cargo metadata
output is useful. Could you share some details?Will do a simple FCP collecting options from the team then if it is reasonable.
(And sorry for the way too late reply 😅)
sunshowers commentedon Apr 26, 2023
A simple use case is writing a linter that triggers only on default workspace members. Without support for this, one has to manually scrape the root Cargo.toml.
charles-r-earp commentedon Apr 26, 2023
Cargo extensions and dev tools will want to emulate cargo, like having options like --manifest-path, --workspace, --package, etc. There are tools to do this like clap_cargo + cargo_metadata which makes use of cargo metadata. This allows cargo-foo bar to operate on all workspace default members just like cargo check / build / test / etc.
weihanglo commentedon Apr 26, 2023
Thank you all for sharing!
I propose adding workspace default member information to the output of
cargo metadata
, to make external plugins easier to align to Cargo's behavior.One concern is that the size of the output grows overtime.
@rfcbot fcp merge
We don't need to wait for 10 days after the poll btw.
rfcbot commentedon Apr 26, 2023
Team member @weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
rfcbot commentedon May 2, 2023
🔔 This is now entering its final comment period, as per the review above. 🔔
Auto merge of #11978 - charles-r-earp:metadata_workspace_default_memb…
workspace.default-members
key is missing from output oli-obk/cargo_metadata#215Implement support for Cargo.toml's default-members
Implement support for Cargo.toml's default-members (#4201)