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

Allow using 'config.toml' instead of just 'config' files. #7295

Merged
merged 3 commits into from
Sep 3, 2019

Conversation

zachlute
Copy link
Contributor

Fixes #7273

Note that this change only makes 'config.toml' optional to use instead of 'config'. If both exist, we will print a warning and prefer 'config', since that would be the existing behavior if both existed today.

We should also consider a separate change to make config.toml the default and update docs, etc.

Note that this change only makes 'config.toml' optional to use instead of 'config'. If both exist, we will print a warning and prefer 'config', since that would be the existing behavior if both existed.

We should also consider a separate change to make config.toml the default and update docs, etc.
@rust-highfive
Copy link

r? @Eh2406

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2019
@Eh2406
Copy link
Contributor

Eh2406 commented Aug 25, 2019

I personally like this idea, but it needs sine off from the team. I put it on the agenda for the team meeting.

@joshtriplett
Copy link
Member

Could we change .cargo/credentials as well, please?

@joshtriplett
Copy link
Member

joshtriplett commented Aug 28, 2019

We discussed this in the Cargo team meeting:

  • We'd like to see this change made.
  • We'd like the same change for .cargo/credentials.
  • We'd like to wait to document it until it's available in stable Rust.
  • We'd like to wait to warn about it for around 6 months, because people may need to care about compatibility with stable-1 or stable-2.
  • We'd like to not warn if you make .cargo/config a symlink to .cargo/config.toml, so that you can keep that for compatibility with old Cargo without a warning. And we should document that.

@alexcrichton
Copy link
Member

To clarify, the warnings here we talked about in the meeting were a hypothetical warning saying "please use config.toml instead of config". The implemented warning here of "don't use both" is good to have and keep, modulo the "ignore if it's just a symlink" mode

@zachlute
Copy link
Contributor Author

I will look into making those updates. Thanks!

This matches a similar change to config[.toml].

Note that this change only makes 'credentials.toml' optional to use instead of 'credentials'. If both exist, we will print a warning and prefer 'credentials', since that would be the existing behavior if both existed.
Also true cor symlinking 'credentials.toml' to 'credentials'.

This will allow users to run multiple versions of Cargo without generating a warning if they want to use the .toml versions.

Note that Windows symlinks require special permission, so in the case the user doesn't have that permission, we don't run the symlink tests. This matches behavior in Rust libstd.
@zachlute
Copy link
Contributor Author

Okay, I believe those two changes should hit the bulk of the requested change here. Let me know what I've missed or if you'd like further changes!

@alexcrichton
Copy link
Member

@bors: r+

Looks fantastic to me, thanks @zachlute!

@zachlute mind opening a follow-up issue to switch the defaults in documentation at some point in the future?

@bors
Copy link
Collaborator

bors commented Sep 3, 2019

📌 Commit 7119683 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 3, 2019
@bors
Copy link
Collaborator

bors commented Sep 3, 2019

⌛ Testing commit 7119683 with merge 5da11a5...

bors added a commit that referenced this pull request Sep 3, 2019
Allow using 'config.toml' instead of just 'config' files.

Fixes #7273

Note that this change only makes 'config.toml' optional to use instead of 'config'. If both exist, we will print a warning and prefer 'config', since that would be the existing behavior if both existed today.

We should also consider a separate change to make config.toml the default and update docs, etc.
@bors
Copy link
Collaborator

bors commented Sep 3, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing 5da11a5 to master...

@bors bors merged commit 7119683 into rust-lang:master Sep 3, 2019
@zachlute
Copy link
Contributor Author

zachlute commented Sep 3, 2019

@alexcrichton Done! #7323

bors added a commit to rust-lang/rust that referenced this pull request Sep 4, 2019
Update cargo, books

## cargo

8 commits in 22f7dd0495cd72ce2082d318d5a9b4dccb9c5b8c..fe0e5a48b75da2b405c8ce1ba2674e174ae11d5d
2019-08-27 16:10:51 +0000 to 2019-09-04 00:51:27 +0000
- Rename `--all` to `--workspace` (rust-lang/cargo#7241)
- Basic standard library support. (rust-lang/cargo#7216)
- Allow using 'config.toml' instead of just 'config' files. (rust-lang/cargo#7295)
- Retry on SSL Connect Error. (rust-lang/cargo#7318)
- minimal-copy `deserialize` for `InternedString` (rust-lang/cargo#7310)
- Fix typo in cargo vendor examples (rust-lang/cargo#7320)
- Fixes around multiple `[patch]` per crate (rust-lang/cargo#7303)
- Improve error messages on mkdir failure (rust-lang/cargo#7306)

## reference

7 commits in d191a0c..090c015
2019-08-15 08:42:23 +0200 to 2019-09-03 13:59:28 -0700
- Fix rust-lang/reference#664: Review Oxford comma usage. (rust-lang/reference#668)
- Fix some links. (rust-lang/reference#667)
- Remove trait object warning. (rust-lang/reference#666)
- Specify pattern types in `let` statements and `for` expressions (rust-lang/reference#663)
- Fix loop expression link. (rust-lang/reference#662)
- async-await initial reference material (rust-lang/reference#635)
- Correct errors in the reference of extern functions definitions and declarations (rust-lang/reference#652)

## rust-by-example

1 commits in 580839d90aacd537f0293697096fa8355bc4e673..e76be6b2dc84c6a992e186157efe29d625e29b94
2019-08-17 23:17:50 -0300 to 2019-09-03 07:42:26 -0300
- Change link to russian translation repository (rust-lang/rust-by-example#1245)

## embedded-book

1 commits in 432ca26686c11d396eed6a59499f93ce1bf2433c..5ca585c4a7552efb546e7681c3de0712f4ae4fdc
2019-08-09 23:20:22 +0000 to 2019-08-27 13:39:14 +0000
- Fixup book CI  (rust-embedded/book#205)
@zachlute zachlute deleted the config-toml-extension branch October 5, 2019 14:52
@ehuss ehuss added this to the 1.39.0 milestone Feb 6, 2022
epage added a commit to epage/cargo that referenced this pull request Jan 26, 2024
In rust-lang#7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

 This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
epage added a commit to epage/cargo that referenced this pull request Jan 26, 2024
In rust-lang#7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

 This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
bors added a commit that referenced this pull request Jan 26, 2024
fix(config): Deprecate non-extension files

### What does this PR try to resolve?

In #7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/

### How should we test and review this PR?

It'll be important to look at the individual commits as one updates tests from using `.cargo/config` to `.cargo/config.toml` which touches a lot of code.

I added a test for `.cargo/config` in a separate commit so you can see how the output changes.

### Additional information

Discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Deprecating.20credential.20provider.20default.3F)
stupendoussuperpowers pushed a commit to stupendoussuperpowers/cargo that referenced this pull request Feb 28, 2024
In rust-lang#7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

 This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support .toml file extension on .cargo/config
7 participants