Skip to content

Commit ccaa118

Browse files
committed
Add workaround for RUSTUP_WINDOWS_PATH_ADD_BIN.
On Windows, rustup has an issue with recursive cargo invocations. This commit can be removed once rust-lang/rustup#3036 is resolved.
1 parent 9f71231 commit ccaa118

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ jobs:
116116
CARGO_PROFILE_TEST_DEBUG: 1
117117
CARGO_INCREMENTAL: 0
118118
CARGO_PUBLIC_NETWORK_TESTS: 1
119+
# Workaround for https://github.com/rust-lang/rustup/issues/3036
120+
RUSTUP_WINDOWS_PATH_ADD_BIN: 0
119121
strategy:
120122
matrix:
121123
include:
@@ -170,7 +172,6 @@ jobs:
170172
- name: Configure extra test environment
171173
run: echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV
172174
if: matrix.os == 'ubuntu-latest'
173-
174175
- run: cargo test -p cargo
175176
- name: Clear intermediate test output
176177
run: ci/clean-test-output.sh

crates/cargo-test-macro/src/lib.rs

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

0 commit comments

Comments
 (0)