Description
EDIT: See #7475 (comment) for better description. Thank you @ehuss!
Problem
This is a regression introduced in the recent cargo update in rust
repo.
On windows, within test processes run by cargo test
, PATH
variable now looks like:
C:\projects\rust-clippy\clippy_dev\target\debug\deps;C:\projects\rust-clippy\clippy_dev\target\debug;C:\Users\appveyor\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin;C:\Users\appveyor\.cargo\bin;C:\Users\appveyor\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin;.....
The first three paths are added by cargo. Note that nightly-x86_64-pc-windows-msvc\bin
is now preferred than .cargo\bin
.
In clippy
CI, cargo +nightly fmt
is invoked during integration test. This have been worked until the recent update. Today, the plain cargo
binary from nightly-x86_64-pc-windows-msvc\bin
is run instead of the rustup's one in .cargo\bin
that supports +toolchain_name
argument.
Steps
See recent failed builds in https://ci.appveyor.com/project/rust-lang-libs/rust-clippy
Clippy's CI involves two versions of toolchains: nightly
and master
.
cargo test
(master) runstests/fmt.rs
integration test.tests/fmt.rs
invokescargo +nightly run
onclippy_dev
. This succeeds becausemaster
does not havecargo
. Now we are innightly
environment.clippy_dev
invokescargo +nightly fmt
. This fails becausenightly
hascargo
.
Possible Solution(s)
.cargo\bin
should always be preferred (come first in PATH
variable).
Notes
Output of cargo version
:
cargo 1.40.0-nightly (8b0561d68 2019-09-30)