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

Workspace inherited fields are not warned on stable #10586

Closed
ehuss opened this issue Apr 21, 2022 · 4 comments
Closed

Workspace inherited fields are not warned on stable #10586

ehuss opened this issue Apr 21, 2022 · 4 comments
Labels
A-workspace-inheritance Area: workspace inheritance RFC 2906 C-bug Category: bug

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 21, 2022

Problem

It looks like the inheritable fields as part of RFC 2906 (#8415) are no longer generating warnings. These warnings are important, as some users get confused and place the fields in the wrong section. If the warnings aren't displayed, then they won't have an indicator of what is wrong. This is particularly problematic for the edition field which quite a few people have tried to set in the workspace.

cc @Muscraft

Steps

Have a workspace such as:

[workspace]
edition = "2021"
[package]
name = "foo"
version = "0.1.0"

Possible Solution(s)

If cargo-features = ["workspace-inheritance"] is not included, then it should generate a warning perhaps similar to:

warning: /path/to/Cargo.toml: unused manifest key: workspace.edition

Notes

No response

Version

cargo 1.62.0-nightly (e2e2dddeb 2022-04-05)
release: 1.62.0-nightly
commit-hash: e2e2dddebe66dfc1403a312653557e332445308b
commit-date: 2022-04-05
host: x86_64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.51+curl-7.80.0 system ssl:(SecureTransport) LibreSSL/3.3.5)
os: Mac OS 12.3.1 [64-bit]
@ehuss ehuss added C-bug Category: bug A-workspace-inheritance Area: workspace inheritance RFC 2906 labels Apr 21, 2022
@Muscraft
Copy link
Member

Looks like it came from #10564. It switched the inheritance source from workspace to workspace.package. I'll write up tests for it and make the changes needed later tonight/early tomorrow.

@Muscraft
Copy link
Member

I'm not sure if this is an issue anymore. I was wrong before, #10564 fixes this. Can you try using anything after that PR?

Version

cargo 1.62.0 (1f1823c5e 2022-04-20)
release: 1.62.0
commit-hash: 1f1823c5e3c91fe382551a72b4463bafc5f50d5a
commit-date: 2022-04-20
host: aarch64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.82.0-DEV (sys:0.4.53+curl-7.82.0 vendored ssl:SecureTransport)
os: Mac OS 12.3.1 [64-bit]

I used the version above and running buildshows an error for an unused manifest key.

I think switching from workspace to workspace.package actually fixed it since TomlWorkspace no longer has a field for edition.

@ehuss
Copy link
Contributor Author

ehuss commented Apr 21, 2022

Oh, indeed it has. Sorry about that, I thought I was using the latest cargo. Thanks for taking a look!

@ehuss ehuss closed this as completed Apr 21, 2022
@Muscraft
Copy link
Member

It's all good, if you want I can add a test to check for this in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-workspace-inheritance Area: workspace inheritance RFC 2906 C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants