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

Cargo will silently ignore invalid .cargo/config options #5890

Open
expenses opened this issue Aug 14, 2018 · 2 comments
Open

Cargo will silently ignore invalid .cargo/config options #5890

expenses opened this issue Aug 14, 2018 · 2 comments
Labels
A-configuration Area: cargo config files and env vars A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@expenses
Copy link

For example, cargo will silently ignore

rustflags = [...]

where it should be under a build subheading like:

[build]
rustflags = [...]

This is related to #4377, so perhaps it could be done at the same time?

@alexcrichton alexcrichton added A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Aug 14, 2018
@ehuss ehuss added the A-configuration Area: cargo config files and env vars label Feb 16, 2020
@weihanglo
Copy link
Member

Cargo configuration is considered as a kind of environment for Cargo. That said, usually a CLI won't complain to the existence of unrecognized environment variables. However, Cargo could possibly do a bit better — collect unrecognized configs and put a warning there

13 cargo configuration values cannot be recognized.
Run `cargo config get --unrecognized` to reveal.

This does need more discussions and designs. Maybe use --verbose or cargo report instead of unstable cargo config, though starting as an unstable flag is more likely to be accepted.

@weihanglo weihanglo added the S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. label May 14, 2023
@epage
Copy link
Contributor

epage commented Oct 23, 2023

A linter or cargo config would be a good home for something like this. See also #12235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

5 participants