cargo/tests/testsuite
bors 2cc50bc0b6 Auto merge of #12515 - arlosi:high-pri-last, r=weihanglo
config: merge lists in precedence order

When merging configuration lists, the current order does not match the expected precedence. This makes merged lists follow precedence order, with higher precedence items merged later in lists.

When a list in configuration exists in multiple places, Cargo merges the lists together. The ordering of this merging is unexpected and does not follow the precedence rules that non-list configuration uses.

The current merging order appears to be:
* project-specific `config.toml`
* global `config.toml`
* command-line (`--config`)
* environment variable (`CARGO_*`)

This PR changes the order to follow the precedence rules with higher precedence configuration merging later in the lists.
* global `config.toml`
* project-specific `config.toml`
* environment variable (`CARGO_*`)
* command-line (`--config`)

This aligns with config such as `build.rustflags` where later flags take precedence over earlier ones.

Since `--config` is relatively new, it's unlikely to cause too much breakage by making it come after environment variables.

Switching global and project-specific ordering is more likely to cause breakage, since it's been around longer (reported as an issue in #8128). Projects relying on global configuration flags (in `$CARGO_HOME\config.toml` or in `.cargo/config.toml` further from the project) being merged first in lists will be broken.

For most uses of merged lists (such as `build.rustflags`), if the flags do not conflict with each other, there will be no impact.

Fixes #12506
Fixes #8128
2023-08-22 22:43:08 +00:00
..
cargo fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_add fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_bench test: move --keep-going suggestion match tests to UI tests 2023-08-22 19:21:09 +01:00
cargo_build fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_check fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_clean fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_config Merge higher precedence config lists later 2023-08-16 11:21:38 -05:00
cargo_doc fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_fetch fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_fix fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_generate_lockfile fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_git_checkout test(cli): Track --help output 2023-07-24 17:12:20 -05:00
cargo_help fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_init fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_install fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_locate_project fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_login fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_logout fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_metadata fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_new fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_owner fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_package fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_pkgid fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_publish fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_read_manifest fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_remove Auto merge of #12454 - alcolmenar:alcolmenar/fix-invalid-rm, r=epage 2023-08-10 18:00:32 +00:00
cargo_report fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_run fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_rustc fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_rustdoc fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_search fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_test test: move --keep-going suggestion match tests to UI tests 2023-08-22 19:21:09 +01:00
cargo_tree fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_uninstall fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_update fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_vendor fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_verify_project fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_version fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
cargo_yank fix(cli): Make --help easier to browse 2023-08-08 13:50:05 -05:00
mock-std fix: hack around libsysroot instead of libtest 2023-05-05 14:48:37 +01:00
advanced_env.rs Enable source_config_env test on Windows 2023-01-14 09:48:46 -08:00
alt_registry.rs Fix printing multiple warning messages for unused fields in [registries] table 2023-08-02 18:20:46 -05:00
artifact_dep.rs Include rust-version in publish request 2023-04-26 11:59:29 -07:00
bad_config.rs Auto merge of #12001 - hi-rustin:rustin-patch-dep-empty, r=weihanglo 2023-04-24 09:20:41 +00:00
bad_manifest_path.rs chore: update bad_manifest_path test to use check 2023-02-15 15:28:48 -06:00
bench.rs test: move --keep-going suggestion match tests to UI tests 2023-08-22 19:21:09 +01:00
binary_name.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
build.rs Support "default" option for build.jobs 2023-06-03 15:24:41 +03:00
build_plan.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
build_script.rs Bail out an error when using cargo:: in custom build script 2023-07-27 23:00:52 +08:00
build_script_env.rs #[allow(internal_features)] in RUSTC_BOOTSTRAP test 2023-08-01 18:18:29 +02:00
build_script_extra_link_arg.rs remove .masquerade_as_nightly_cargo() from build_script_extra_link_arg.rs 2022-07-14 15:05:33 -05:00
cache_messages.rs chore: update cache_messages test to use check 2023-02-20 12:20:26 -06:00
cargo_alias_config.rs chore: Update to toml v0.6, toml_edit v0.18 2023-01-19 15:26:28 -06:00
cargo_command.rs add unit test for config and integration test with cargo --list 2023-03-09 16:54:01 -07:00
cargo_env_config.rs Disallow RUSTUP_TOOLCHAIN in the [env] table. 2023-05-08 09:30:59 -07:00
cargo_features.rs Add allow(internal_features) 2023-08-05 12:11:07 -07:00
cargo_targets.rs Warn if an "all" target is specified, but we don't match anything 2021-06-09 19:29:24 +02:00
cfg.rs chore: update cfg tests to use check 2023-02-20 12:20:26 -06:00
check.rs Add rustc_shim_for_cargo_fix and wrapped_clippy_driver to reuse code 2023-04-14 11:23:41 +08:00
check_cfg.rs chore: update check_cfg tests to use check 2023-02-20 12:20:26 -06:00
clean.rs Run CI for macOS on nightly 2023-02-14 12:26:01 -08:00
collisions.rs Fix collision_doc_profile test error 2022-12-15 20:04:50 -08:00
concurrent.rs Re-enable killing_cargo_releases_the_lock on windows. 2022-08-02 12:30:42 -07:00
config.rs Merge higher precedence config lists later 2023-08-16 11:21:38 -05:00
config_cli.rs Merge higher precedence config lists later 2023-08-16 11:21:38 -05:00
config_include.rs test(config-include): assert config merged in DFS 2023-06-21 20:18:09 +01:00
corrupt_git.rs chore: update corrupt_git tests to use check 2023-02-20 12:20:46 -06:00
credential_process.rs Use thiserror for credential provider errors 2023-07-31 13:45:08 -05:00
cross_compile.rs refactor: only when -C debuginfo > 0 will spilt-debuginfo be passed 2023-05-31 20:43:57 +01:00
cross_publish.rs Reword published/completed to uploaded/published 2023-03-15 08:15:00 -07:00
custom_target.rs Add allow(internal_features) 2023-08-05 12:11:07 -07:00
death.rs chore: update death tests to use check 2023-02-20 12:21:15 -06:00
dep_info.rs chore: update dep_info tests to use check 2023-02-20 12:21:15 -06:00
direct_minimal_versions.rs feat(resolver): -Zdirect-minimal-versions 2023-02-14 15:44:30 -06:00
directory.rs Add additional info on a new line 2023-06-05 11:27:31 +02:00
doc.rs Add allow(internal_features) 2023-08-05 12:11:07 -07:00
docscrape.rs fix(docscrape): must fail with bad build script 2023-02-09 20:32:24 +00:00
edition.rs chore: update edition tests to use check 2023-02-20 12:21:15 -06:00
error.rs Rework internal errors. 2020-02-17 19:03:57 -08:00
features.rs Convert valid feature name warning to an error. 2023-06-20 12:39:27 -07:00
features2.rs Remove unnecessary warning line 2023-05-26 20:27:34 +02:00
features_namespaced.rs Fix dep/feat syntax with hidden implicit optional dependencies 2023-05-11 09:34:38 -07:00
fetch.rs Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
fix.rs Add rustc_shim_for_cargo_fix and wrapped_clippy_driver to reuse code 2023-04-14 11:23:41 +08:00
freshness.rs only skip mtime check on $CARGO_HOME/{git,registry} 2023-07-19 12:38:56 +02:00
future_incompat_report.rs test: bypass rustc --test impl details for -Zfuture-incompat-test 2023-08-14 13:40:47 +01:00
generate_lockfile.rs Improve error for missing crate in --offline mode for sparse index 2023-03-01 14:45:09 -06:00
git.rs fix: normalize relative git submodule urls with ssh:// 2023-07-30 10:04:32 -07:00
git_auth.rs Add delays to network retries. 2023-03-31 14:04:48 -07:00
git_gc.rs add -Zgitoxide=fetch feature toggle and implementation. 2023-03-02 12:35:50 +01:00
git_shallow.rs Move helper functions to the bottom for consistency; fix name 2023-05-02 18:57:42 +02:00
glob_targets.rs fix typos found by the typos-cli crate 2022-05-10 16:47:28 -05:00
help.rs fix panic if an alias is defined to "" 2021-12-12 13:30:31 -07:00
https.rs Fix self_signed_should_fail for macOS. 2023-05-06 12:41:34 -07:00
inheritable_workspace_fields.rs Include rust-version in publish request 2023-04-26 11:59:29 -07:00
install.rs test: relax assertions of panic handler message format 2023-07-29 17:12:46 +01:00
install_upgrade.rs chore: Update to toml v0.6, toml_edit v0.18 2023-01-19 15:26:28 -06:00
jobserver.rs chore: bump jobserver to respect --jobserver-auth=fifo:PATH' 2023-02-28 16:08:12 +00:00
lints.rs fix(lints): Doctest extraction should respect [lints] 2023-08-14 14:23:59 -05:00
list_availables.rs test: list availables for clean,tree,update 2020-10-28 02:46:20 +08:00
local_registry.rs chore: update local_registry tests to use check 2023-02-20 12:21:27 -06:00
locate_project.rs Remove the double-backslash escape for matching. 2021-06-16 09:44:29 -07:00
lockfile_compat.rs Auto merge of #12280 - weihanglo:git-ref-ambiguity, r=ehuss 2023-07-23 19:01:50 +00:00
login.rs Use thiserror for credential provider errors 2023-07-31 13:45:08 -05:00
logout.rs Stabilize cargo logout 2023-04-12 09:56:43 -07:00
lto.rs Disable test_profile test on windows-gnu 2023-03-30 19:18:10 -07:00
main.rs test(cli): Track --help output 2023-07-24 17:12:20 -05:00
member_discovery.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
member_errors.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
message_format.rs chore: update message_format tests to use check 2023-02-20 12:21:27 -06:00
messages.rs Fixing issue https://github.com/rust-lang/cargo/issues/10834: 2023-03-07 06:45:26 +01:00
metabuild.rs chore: update metabuild tests to use check 2023-02-20 12:21:27 -06:00
metadata.rs Added workspace_default_members to more tests. 2023-05-03 12:44:08 -07:00
minimal_versions.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
multitarget.rs Update tests to reflect -Zmultitarget stabilization 2022-07-17 11:02:01 +01:00
net_config.rs chore: update net_config tests to use check 2023-02-20 12:21:27 -06:00
new.rs fix(new): Don't ignore Cargo.lock for all package types 2023-07-19 11:56:40 -05:00
offline.rs Assure that git-dependencies will get the correct storage, without ever unshallowing them. 2023-04-27 18:49:59 +02:00
old_cargos.rs Add reasons to all ignored tests. 2022-08-02 12:24:00 -07:00
out_dir.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
owner.rs Credential provider implementation 2023-07-21 16:02:24 -05:00
package.rs fix(package): Avoid multiple package list entries 2023-07-26 11:02:47 -05:00
package_features.rs chore: update package_features tests to use check 2023-02-20 12:21:27 -06:00
patch.rs Enable shallow clones and fetches for registry and git dependencies. 2023-04-27 14:18:22 +02:00
path.rs chore: update path tests to use check 2023-02-20 12:21:27 -06:00
paths.rs chore: update paths tests to use check 2023-02-20 12:21:27 -06:00
pkgid.rs fix some typos 2022-05-08 01:07:28 +08:00
plugins.rs test: revive nightly plugin tests to work 2023-01-04 13:45:25 +00:00
proc_macro.rs chore: update proc_macro tests to use check 2023-02-20 12:21:35 -06:00
profile_config.rs refactor: only when -C debuginfo > 0 will spilt-debuginfo be passed 2023-05-31 20:43:57 +01:00
profile_custom.rs Add reasons to all ignored tests. 2022-08-02 12:24:00 -07:00
profile_overrides.rs chore: update profile_overrides tests to use check 2023-02-20 12:21:55 -06:00
profile_targets.rs Print environment variables for cargo test in extra verbose mode 2023-08-16 13:41:54 +02:00
profiles.rs refactor: only when -C debuginfo > 0 will spilt-debuginfo be passed 2023-05-31 20:43:57 +01:00
progress.rs chore: update progress tests to use check 2023-02-20 12:22:24 -06:00
pub_priv.rs chore: update pub_priv tests to use check 2023-02-20 12:22:24 -06:00
publish.rs Credential provider implementation 2023-07-21 16:02:24 -05:00
publish_lockfile.rs make test clearer 2022-12-19 10:50:55 -07:00
read_manifest.rs Add rust_metadata to SerializedPackage 2021-10-12 14:07:19 +02:00
registry.rs fix: clear cache for old .cargo-ok format 2023-08-03 13:42:54 +01:00
registry_auth.rs Credential provider implementation 2023-07-21 16:02:24 -05:00
rename_deps.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
replace.rs chore: update replace tests to use check 2023-02-20 12:22:29 -06:00
required_features.rs Add additional info on a new line 2023-06-05 11:27:31 +02:00
run.rs Print environment variables for cargo run in extra verbose mode 2023-08-15 13:45:42 +02:00
rust_version.rs chore: update rust_version tests to use check 2023-02-20 12:22:29 -06:00
rustc.rs refactor: only when -C debuginfo > 0 will spilt-debuginfo be passed 2023-05-31 20:43:57 +01:00
rustc_info_cache.rs Don't re-use rustc cache when RUSTC_WRAPPER changes 2021-04-16 20:08:11 +03:00
rustdoc.rs Update rustdoc tests with -Cmetadata flag 2021-10-12 19:33:23 -07:00
rustdoc_extern_html.rs Make sparse the default protocol for crates.io 2023-03-02 10:50:22 -06:00
rustdocflags.rs Gleaning rustdocflags from target.cfg(…) is not supported 2022-11-01 15:01:44 +00:00
rustflags.rs chore: update rustflags tests to use check 2023-02-20 12:22:29 -06:00
rustup.rs Add an optimization when running under rustup. 2023-05-03 13:45:54 -07:00
script.rs corrected unspecifiead to unspecified 2023-07-15 16:52:55 -07:00
search.rs Implement RFC 3139: alternative registry authentication support 2022-11-16 14:36:19 -06:00
shell_quoting.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
source_replacement.rs Remove "up to 60 seconds" from waiting message. 2023-03-15 08:15:00 -07:00
ssh.rs Update git2 2023-04-02 15:37:53 -07:00
standard_lib.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
test.rs test: move --keep-going suggestion match tests to UI tests 2023-08-22 19:21:09 +01:00
timings.rs Move timing reports to target/cargo-timings 2022-01-30 21:43:52 -08:00
tool_paths.rs Fix test 2022-08-10 23:19:35 +08:00
tree.rs cargo-tree: Handle -e no-proc-macro when building the graph 2023-04-27 10:54:51 -07:00
tree_graph_features.rs Do not ignore --features when --all-features is present 2022-01-28 02:49:42 +03:00
unit_graph.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
update.rs fix(update): Perform error check in clap 2023-07-31 21:18:31 -05:00
vendor.rs fix: respect umask when unpacking .crate files 2023-08-03 13:41:08 +01:00
verify_project.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
version.rs Re-enable version_works_without_rustc on windows. 2022-08-02 12:54:16 -07:00
warn_on_failure.rs Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
weak_dep_features.rs Include rust-version in publish request 2023-04-26 11:59:29 -07:00
workspaces.rs chore: update workspaces tests to use check 2023-02-20 12:22:29 -06:00
yank.rs Credential provider implementation 2023-07-21 16:02:24 -05:00