Add workaround for RUSTUP_WINDOWS_PATH_ADD_BIN.

On Windows, rustup has an issue with recursive cargo invocations. This
commit can be removed once
https://github.com/rust-lang/rustup/issues/3036 is resolved.
This commit is contained in:
Eric Huss 2024-02-20 13:24:50 -08:00
parent 9f71231391
commit ccaa118d27
2 changed files with 9 additions and 1 deletions

View file

@ -116,6 +116,8 @@ jobs:
CARGO_PROFILE_TEST_DEBUG: 1
CARGO_INCREMENTAL: 0
CARGO_PUBLIC_NETWORK_TESTS: 1
# Workaround for https://github.com/rust-lang/rustup/issues/3036
RUSTUP_WINDOWS_PATH_ADD_BIN: 0
strategy:
matrix:
include:
@ -170,7 +172,6 @@ jobs:
- name: Configure extra test environment
run: echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest'
- run: cargo test -p cargo
- name: Clear intermediate test output
run: ci/clean-test-output.sh

View file

@ -248,6 +248,13 @@ fn has_rustup_stable() -> bool {
// This cannot run on rust-lang/rust CI due to the lack of rustup.
return false;
}
if cfg!(windows) && !is_ci() && option_env!("RUSTUP_WINDOWS_PATH_ADD_BIN").is_none() {
// There is an issue with rustup that doesn't allow recursive cargo
// invocations. Disable this on developer machines if the environment
// variable is not enabled. This can be removed once
// https://github.com/rust-lang/rustup/issues/3036 is resolved.
return false;
}
check_command("cargo", &["+stable", "--version"])
}