Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the workspace.metadata key in Cargo.toml files #8309

Closed
naerbnic opened this issue Jun 2, 2020 · 0 comments
Closed

Add support for the workspace.metadata key in Cargo.toml files #8309

naerbnic opened this issue Jun 2, 2020 · 0 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@naerbnic
Copy link
Contributor

naerbnic commented Jun 2, 2020

Describe the problem you are trying to solve
External tools that work with Rust repositories often need metadata in order to apply user-configurable settings to different parts of that repository. For packages, the Cargo.toml key package.metadata has already been set aside for this purpose. The cargo project has promised to not use its contents to make any decisions for the base cargo tool, and has ensured that the tool will not report a warning for an unknown key for it.

When the Cargo.toml file in question is used to define a package, this is sufficient. However, in the case that the Cargo.toml file is used as a workspace root, there is no equivalent key. It is common for a Rust repository to have a single Cargo.toml file at its root that does not itself declare a package. Thus external tools that operate on a workspace as a whole do not have any specified location to place their configuration data within this Cargo.toml file.

Describe the solution you'd like
We should support the workspace.metadata Cargo.toml key that mirrors the existing package.metadata key. To my understanding, this means the following must hold.

  • The cargo tool must not use the workspace.metadata key in any semantically meaningful way.
  • The cargo tool must not impose any kind of explicit schema on the contents of that key.
  • The cargo tool should not warn about the existence of that key.
@naerbnic naerbnic added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jun 2, 2020
bors added a commit that referenced this issue Jun 23, 2020
…ichton

Add support for `workspace.metadata` table

Implements feature request #8309

Additionally includes the information in the output of "cargo metadata" through a new top-level field `metadata`, similar to the per-package `metadata` field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

1 participant