For Windows targets, Rust now uses a custom resolver to find `process::Command` programs. This has caused some error messages to change.
To allow it to be merged, some tests have been adjusted to match any error.
Include the linker in the fingerprint.
This adds the linker from the `[target]` config table to the fingerprint. Previously, changing the value would not trigger a rebuild.
Fix bug with PathAndArg config values
This fixes an issue I noticed when trying to specify a target runner via the [`CARGO_TARGET_{triplet}_RUNNER`](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner) environment variable, expecting it to override the value in our `.cargo/config.toml` file, which was giving quite strange errors until I figured out that cargo was actually merging the config file's values with the environment's values.
This change adds a small hack to use and `UnmergedStringList` from `PathAndArgs` instead of just plain `StringList`, which uses the type in the deserializer to determine if `Config::get_list_or_string` should merge the values from the config file(s) with the environment as it was doing before, or else only use the environment to the exclusion of the config file(s) if the key was set in the environment.
I also added a test for this to confirm both the bug and the fix.
`cfg` can be used to reduce the number of `runner`s one needs to type in
`.cargo/config`. So instead of writing this:
``` toml
[target.thumbv6m-none-eabi]
runner = "arm-none-eabi-gdb"
[target.thumbv7m-none-eabi]
runner = "arm-none-eabi-gdb"
[target.thumbv7em-none-eabi]
runner = "arm-none-eabi-gdb"
[target.thumbv7em-none-eabihf]
runner = "arm-none-eabi-gdb"
```
one can write:
``` toml
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "arm-none-eabi-gdb"
```
Handling of edge cases:
- When `target.$triple.runner` matches it will be chosen regardless of the
existence of others `target.'cfg(..)'.runner`s.
- If more than one `target.'cfg(..)'.runner` matches the target the command will
fail.
closes#5946
This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.
To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.
The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.