Skip to content

refactor(context): Split config keys in code, not at runtime - #17490

Merged
weihanglo merged 1 commit into
rust-lang:masterfrom
epage:path
Sep 20, 2026
Merged

weihanglo merged 1 commit into
rust-lang:masterfrom
epage:path

Conversation

@epage

@epage epage commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

This avoids

  • problems with proper splitting
  • reduces work (even if its minor)

This may address #15901 but haven't looked into how to test it. Unsure if it helped with environment variables.

This does not help with cargo config get: ConfigKey::from_str should be switched to using a TOML key parser.

How to test and review this PR?

This avoids
- problems with proper splitting
- reduces work (even if its minor)

This may have fixed rust-lang#15901 but haven't looked into how to test it.
Unsure if it helped with environment variables.

This does not help with `cargo config get`: `ConfigKey::from_str`
should be switched to using a TOML key parser.
@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

r? @Muscraft

rustbot has assigned @Muscraft.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from Muscraft, weihanglo

@rustbot rustbot added A-cfg-expr Area: Platform cfg expressions A-cli Area: Command-line interface, option parsing, etc. A-configuration Area: cargo config files and env vars A-dependency-resolution Area: dependency resolution and the resolver A-interacts-with-crates.io Area: interaction with registries A-manifest Area: Cargo.toml issues A-profiles Area: profiles A-registry-authentication Area: registry authentication and authorization (authn authz) A-workspaces Area: workspaces Command-new Command-publish Command-update S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 19, 2026

@weihanglo weihanglo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

keyword triggered

View changes since this review

Comment thread src/bin/cargo/main.rs
@@ -136,7 +136,7 @@ fn builtin_aliases_execs(cmd: &str) -> Option<&(&str, &str, &str)> {
/// 3. If still cannot find any, finds one insides [`BUILTIN_ALIASES`].
fn aliased_command(gctx: &GlobalContext, command: &str) -> CargoResult<Option<Vec<String>>> {
let alias_name = format!("alias.{}", command);

@weihanglo weihanglo Sep 20, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we move this format! to the use site later?

View changes since the review

@weihanglo
weihanglo added this pull request to the merge queue Sep 20, 2026
Merged via the queue into rust-lang:master with commit 14a4cea Sep 20, 2026
81 of 85 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2026
@epage
epage deleted the path branch September 21, 2026 15:18
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 22, 2026
Update cargo submodule

10 commits in 495c385d0875c4ba51eb72ea0448a2d4c018b8d4..98a09e7e7d62850f14e5b6132101fc1edd19a16f
2026-09-16 12:48:58 +0000 to 2026-09-21 19:03:16 +0000
- feat(build-rs): trim-paths inputs  (rust-lang/cargo#17491)
- Remove README CI badge (rust-lang/cargo#17495)
- feat(builtin-deps): Add unstable `builtin-dependencies` feature (rust-lang/cargo#17497)
- test(prerelease): concurrent downloads snapshots be unordered (rust-lang/cargo#17492)
- Account for (uplift) hardlinks when calculating clean file size (rust-lang/cargo#17485)
- feat(hints): extract mostly-unused diagnostics  (rust-lang/cargo#17457)
- fix(build-rs): make `unstable` compile  (rust-lang/cargo#17489)
- refactor(context): Split config keys in code, not at runtime (rust-lang/cargo#17490)
- fix(prerelease): preserve locked prerelease deps (rust-lang/cargo#17464)
- Remove -Zasymmetric-token / cargo:paseto (rust-lang/cargo#17486)

r? ghost
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 23, 2026
Update cargo submodule

10 commits in 495c385d0875c4ba51eb72ea0448a2d4c018b8d4..98a09e7e7d62850f14e5b6132101fc1edd19a16f
2026-09-16 12:48:58 +0000 to 2026-09-21 19:03:16 +0000
- feat(build-rs): trim-paths inputs  (rust-lang/cargo#17491)
- Remove README CI badge (rust-lang/cargo#17495)
- feat(builtin-deps): Add unstable `builtin-dependencies` feature (rust-lang/cargo#17497)
- test(prerelease): concurrent downloads snapshots be unordered (rust-lang/cargo#17492)
- Account for (uplift) hardlinks when calculating clean file size (rust-lang/cargo#17485)
- feat(hints): extract mostly-unused diagnostics  (rust-lang/cargo#17457)
- fix(build-rs): make `unstable` compile  (rust-lang/cargo#17489)
- refactor(context): Split config keys in code, not at runtime (rust-lang/cargo#17490)
- fix(prerelease): preserve locked prerelease deps (rust-lang/cargo#17464)
- Remove -Zasymmetric-token / cargo:paseto (rust-lang/cargo#17486)

r? ghost
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 23, 2026
Update cargo submodule

10 commits in 495c385d0875c4ba51eb72ea0448a2d4c018b8d4..98a09e7e7d62850f14e5b6132101fc1edd19a16f
2026-09-16 12:48:58 +0000 to 2026-09-21 19:03:16 +0000
- feat(build-rs): trim-paths inputs  (rust-lang/cargo#17491)
- Remove README CI badge (rust-lang/cargo#17495)
- feat(builtin-deps): Add unstable `builtin-dependencies` feature (rust-lang/cargo#17497)
- test(prerelease): concurrent downloads snapshots be unordered (rust-lang/cargo#17492)
- Account for (uplift) hardlinks when calculating clean file size (rust-lang/cargo#17485)
- feat(hints): extract mostly-unused diagnostics  (rust-lang/cargo#17457)
- fix(build-rs): make `unstable` compile  (rust-lang/cargo#17489)
- refactor(context): Split config keys in code, not at runtime (rust-lang/cargo#17490)
- fix(prerelease): preserve locked prerelease deps (rust-lang/cargo#17464)
- Remove -Zasymmetric-token / cargo:paseto (rust-lang/cargo#17486)

r? ghost
@rustbot rustbot added this to the 1.100.0 milestone Sep 23, 2026
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 24, 2026
Update cargo submodule

10 commits in 495c385d0875c4ba51eb72ea0448a2d4c018b8d4..98a09e7e7d62850f14e5b6132101fc1edd19a16f
2026-09-16 12:48:58 +0000 to 2026-09-21 19:03:16 +0000
- feat(build-rs): trim-paths inputs  (rust-lang/cargo#17491)
- Remove README CI badge (rust-lang/cargo#17495)
- feat(builtin-deps): Add unstable `builtin-dependencies` feature (rust-lang/cargo#17497)
- test(prerelease): concurrent downloads snapshots be unordered (rust-lang/cargo#17492)
- Account for (uplift) hardlinks when calculating clean file size (rust-lang/cargo#17485)
- feat(hints): extract mostly-unused diagnostics  (rust-lang/cargo#17457)
- fix(build-rs): make `unstable` compile  (rust-lang/cargo#17489)
- refactor(context): Split config keys in code, not at runtime (rust-lang/cargo#17490)
- fix(prerelease): preserve locked prerelease deps (rust-lang/cargo#17464)
- Remove -Zasymmetric-token / cargo:paseto (rust-lang/cargo#17486)

r? ghost
epage added a commit to epage/cargo that referenced this pull request Sep 29, 2026
epage added a commit to epage/cargo that referenced this pull request Sep 29, 2026
epage added a commit to epage/cargo that referenced this pull request Sep 29, 2026
epage added a commit to epage/cargo that referenced this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cfg-expr Area: Platform cfg expressions A-cli Area: Command-line interface, option parsing, etc. A-configuration Area: cargo config files and env vars A-dependency-resolution Area: dependency resolution and the resolver A-interacts-with-crates.io Area: interaction with registries A-manifest Area: Cargo.toml issues A-profiles Area: profiles A-registry-authentication Area: registry authentication and authorization (authn authz) A-workspaces Area: workspaces Command-new Command-publish Command-update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants