-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-config-cliArea: --config CLI optionArea: --config CLI optionA-configurationArea: cargo config files and env varsArea: cargo config files and env varsC-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
From my observation, this only happens to nested non-mergeable list like registries.*.credential-provider. It doesn't happen to doc.browser (see #16208).
Reproducible example
#[cargo_test]
fn nonmergeable_lists() {
let cli_arg = "registries.example.credential-provider=['cli', 'cli-arg']";
let gctx = GlobalContextBuilder::new()
.config_arg(cli_arg)
.cwd("foo")
.build();
let provider = gctx
.get::<Option<RegistryConfig>>("registries.example")
.unwrap()
.unwrap()
.credential_provider
.unwrap();
assert_eq!(provider.path.raw_value(), "cli");
assert_eq!(provider.args, ["cli-arg"]);
// Now create a file-based config
write_config_at(
&paths::root().join("foo/.cargo/config.toml"),
"\
[registries.example]
credential-provider = ['c', 'd']
",
);
let gctx = GlobalContextBuilder::new()
.config_arg(cli_arg)
.cwd("foo")
.build();
let provider = gctx
.get::<Option<RegistryConfig>>("registries.example")
.unwrap()
.unwrap()
.credential_provider
.unwrap();
// This seems wrong and shouldn't merge
assert_eq!(provider.path.raw_value(), "c");
assert_eq!(provider.args, ["d", "cli", "cli-arg"]);
}Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
latest master: 0f14d9d
I haven't checked if it was buggy since #15066 or it is a recent regression.
Metadata
Metadata
Assignees
Labels
A-config-cliArea: --config CLI optionArea: --config CLI optionA-configurationArea: cargo config files and env varsArea: cargo config files and env varsC-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.