-
Notifications
You must be signed in to change notification settings - Fork 104
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
cargo: unused manifest key; use package metadata? #273
Comments
wchargin
added a commit
to wchargin/cargo-raze
that referenced
this issue
Oct 31, 2020
Cargo sets aside the [`[package.metadata]`][md] namespace for use by third-party tools like `cargo-raze`. By specifying configuration under `[package.metadata.raze]` rather than `[raze]`, we avoid an “unused manifest key: raze” warning on every Cargo command. This patch teaches `cargo-raze` to accept either `[raze]` or the new `[package.metadata.raze]`. In case of conflict, it prints a warning and uses the value of `[package.metadata.raze]`. In the future, we can remove the `[raze]` key entirely if desired. Fixes google#273. Changes outside of `impl/` generated by: ``` git ls-files -z ':!impl' | xargs -0 sed -i 's/\[raze/[package.metadata.raze/' ``` [md]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table Test Plan: With this patch, running `./smoke-test.sh` passes both before and after updating all the examples with the above `sed` command. Before the `sed` update, the smoke test prints the deprecation warning, as desired. wchargin-branch: toml-package-metadata-raze wchargin-source: 4932fedcc808b17506aadf4b69f6aa78850fe5c6
acmcarther
pushed a commit
that referenced
this issue
Nov 4, 2020
* Accept `[package.metadata.raze]`, superseding `[raze]` Cargo sets aside the [`[package.metadata]`][md] namespace for use by third-party tools like `cargo-raze`. By specifying configuration under `[package.metadata.raze]` rather than `[raze]`, we avoid an “unused manifest key: raze” warning on every Cargo command. This patch teaches `cargo-raze` to accept either `[raze]` or the new `[package.metadata.raze]`. In case of conflict, it prints a warning and uses the value of `[package.metadata.raze]`. In the future, we can remove the `[raze]` key entirely if desired. Fixes #273. Changes outside of `impl/` generated by: ``` git ls-files -z ':!impl' | xargs -0 sed -i 's/\[raze/[package.metadata.raze/' ``` [md]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table Test Plan: With this patch, running `./smoke-test.sh` passes both before and after updating all the examples with the above `sed` command. Before the `sed` update, the smoke test prints the deprecation warning, as desired. wchargin-branch: toml-package-metadata-raze wchargin-source: 4932fedcc808b17506aadf4b69f6aa78850fe5c6 * [update patch] wchargin-branch: toml-package-metadata-raze wchargin-source: f2b7fb6fb07bd1f478aa1e8c14f7d623f86f69b3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I extend my
Cargo.toml
withper the documentation,
cargo raze
works great! But allcargo
commands also now print a warning about the
raze
key:The Cargo docs mention that “tools which would like to store package
configuration in
Cargo.toml
” can use thepackage.metadata
table toignore that warning. I think that this would just amount to changing
the table from
[raze]
to[package.metadata.raze]
:When I do so, Cargo indeed no longer complains, but now
cargo-raze
can’t find my configuration:
Perhaps
cargo-raze
could be modified to acceptpackage.metadata.raze
as well as
raze
, and then maybe to drop support for bareraze
atsuch a time when that breaking change would be considered acceptable?
The text was updated successfully, but these errors were encountered: