Skip to content

Commit

Permalink
Auto merge of #10092 - ChrisDenton:tmp-match-err, r=alexcrichton
Browse files Browse the repository at this point in the history
Match any error when failing to find executables

For Windows targets, Rust now uses [a custom resolver](rust-lang/rust#87704) to find `process::Command` programs. This has caused some error messages to change.

To allow the PR to be merged, some tests have been adjusted to match any error.

cc `@ehuss`
  • Loading branch information
bors committed Nov 17, 2021
2 parents aed9723 + 93bcd97 commit d2d4b06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions tests/testsuite/credential_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,16 @@ fn libexec_path() {
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr(
// FIXME: Update "Caused by" error message once rust/pull/87704 is merged.
// On Windows, changing to a custom executable resolver has changed the
// error messages.
&format!("\
[UPDATING] [..]
[ERROR] failed to execute `[..]libexec/cargo-credential-doesnotexist[EXE]` to store authentication token for registry `crates-io`
Caused by:
{}
", cargo_test_support::no_such_file_err_msg()),
[..]
"),
)
.run();
}
Expand Down
12 changes: 6 additions & 6 deletions tests/testsuite/tool_paths.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! Tests for configuration values that point to programs.
use cargo_test_support::{
basic_lib_manifest, no_such_file_err_msg, project, rustc_host, rustc_host_env,
};
use cargo_test_support::{basic_lib_manifest, project, rustc_host, rustc_host_env};

#[cargo_test]
fn pathless_tools() {
Expand Down Expand Up @@ -271,6 +269,9 @@ fn custom_runner_env() {
p.cargo("run")
.env(&key, "nonexistent-runner --foo")
.with_status(101)
// FIXME: Update "Caused by" error message once rust/pull/87704 is merged.
// On Windows, changing to a custom executable resolver has changed the
// error messages.
.with_stderr(&format!(
"\
[COMPILING] foo [..]
Expand All @@ -279,9 +280,8 @@ fn custom_runner_env() {
[ERROR] could not execute process `nonexistent-runner --foo target/debug/foo[EXE]` (never executed)
Caused by:
{}
",
no_such_file_err_msg()
[..]
"
))
.run();
}
Expand Down

0 comments on commit d2d4b06

Please sign in to comment.