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

Advice on symlinking config to config.toml leads to a different warning #13803

Closed
chris-morgan opened this issue Apr 25, 2024 · 2 comments
Closed
Labels
A-configuration Area: cargo config files and env vars A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug

Comments

@chris-morgan
Copy link
Member

Problem

If you have a ~/.cargo/config file, running Cargo commands gives this:

warning: `/home/chris/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`

But if you follow this advice, you get a warning:

warning: both `/home/chris/.cargo/config` and `/home/chris/.cargo/config.toml` exist. Using `/home/chris/.cargo/config`

Well, actually everything produces these warnings and infos twice, so it’s even a little worse.

A suggested course of action shouldn’t lead to a different warning. Currently, I can’t escape having a warning if I want to support cargo 1.38 or earlier.

Steps

No response

Possible Solution(s)

Suppress the new warning if config and config.toml have the same contents. (This is more general than just checking if one symlinks the other.)

Notes

No response

Version

warning: both `/home/chris/.cargo/config` and `/home/chris/.cargo/config.toml` exist. Using `/home/chris/.cargo/config`
warning: both `/home/chris/.cargo/config` and `/home/chris/.cargo/config.toml` exist. Using `/home/chris/.cargo/config`
cargo 1.79.0-nightly (c93926759 2024-04-23)
release: 1.79.0-nightly
commit-hash: c9392675917adc2edab269eea27c222b5359c637
commit-date: 2024-04-23
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Arch Linux [64-bit]
@chris-morgan chris-morgan added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Apr 25, 2024
@weihanglo
Copy link
Member

Thanks for the report. This should already be resolved by #13793, which only warns when each file handle points to a different file.

@chris-morgan
Copy link
Member Author

Thanks! I didn’t find #13667 in my searches due to the words employed, and I missed #13793 due to not searching PRs (I normally remove is:issue from my searches, but didn’t this time for some reason).

@weihanglo weihanglo added A-configuration Area: cargo config files and env vars A-diagnostics Area: Error and warning messages generated by Cargo itself. and removed S-triage Status: This issue is waiting on initial triage. labels Apr 25, 2024
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-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants