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

Fix deserialization of check-cfg in config.toml #10799

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Jun 29, 2022

When improving the check-cfg implementation in #10566 I changed the internal representation of check_cfg from multiple bool options to one Option<(bool, bool, bool, bool)> but I didn't realize until rust-lang/rust#82450 (comment) that the internal representation is actually somewhat public as it's used in the [unstable] in .cargo/config.toml.

And because TOML cannot represent tuples there is no way to set it from the [unstable] section. This PR fix this oversight by using a custom deserializer method similar to what was already done for build-std.

@rust-highfive
Copy link

r? @ehuss

(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 Jun 29, 2022
@ehuss
Copy link
Contributor

ehuss commented Jun 29, 2022

Thanks!

And because TOML cannot represent tuples there is no way to set it from the [unstable] section.

TOML can support tuples. I think the underlying issue is that the Config deserializer doesn't support tuples with anything except strings (particularly to handle environment variables), and we just have never encountered a situation where anything else was needed.

This looks good, though. Setting it with booleans would be kinda strange.

@bors r+

@ehuss
Copy link
Contributor

ehuss commented Jun 29, 2022

@bors ping

@bors
Copy link
Collaborator

bors commented Jun 29, 2022

😪 I'm awake I'm awake

@ehuss
Copy link
Contributor

ehuss commented Jun 29, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 29, 2022

📌 Commit 23f59d4 has been approved by ehuss

@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 Jun 29, 2022
@bors
Copy link
Collaborator

bors commented Jun 29, 2022

⌛ Testing commit 23f59d4 with merge 4231106...

@bors
Copy link
Collaborator

bors commented Jun 29, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 4231106 to master...

@bors bors merged commit 4231106 into rust-lang:master Jun 29, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 5, 2022
Update cargo

9 commits in dbff32b27893b899ae2397f3d56d1be111041d56..c0bbd42ce5e83fe2a93e817c3f9b955492d3130a
2022-06-24 19:25:13 +0000 to 2022-07-03 13:41:11 +0000
- fix typo (rust-lang/cargo#10818)
- fix(add): Don't panic with `--offline` (rust-lang/cargo#10817)
- chore: Set permissions for GitHub actions (rust-lang/cargo#10816)
- Bump to 0.65.0, update changelog (rust-lang/cargo#10812)
- Fix zsh completions for add and locate-project (rust-lang/cargo#10810)
- Bump cargo-util version. (rust-lang/cargo#10804)
- Update os_info (rust-lang/cargo#10802)
- Fix deserialization of check-cfg in config.toml (rust-lang/cargo#10799)
- fix: bash complete `install --path` with dirs (rust-lang/cargo#10798)
@ehuss ehuss added this to the 1.64.0 milestone Jul 20, 2022
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.

4 participants