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) runs tests/fmt.rs integration test.
tests/fmt.rs invokes cargo +nightly run on clippy_dev. This succeeds because master does not have cargo. Now we are in nightly environment.
clippy_dev invokes cargo +nightly fmt. This fails because nightly has cargo.
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)
EDIT: See #7475 (comment) for better description. Thank you @ehuss!
Problem
This is a regression introduced in the recent cargo update in
rustrepo.On windows, within test processes run by
cargo test,PATHvariable 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\binis now preferred than.cargo\bin.In
clippyCI,cargo +nightly fmtis invoked during integration test. This have been worked until the recent update. Today, the plaincargobinary fromnightly-x86_64-pc-windows-msvc\binis run instead of the rustup's one in.cargo\binthat supports+toolchain_nameargument.Steps
See recent failed builds in https://ci.appveyor.com/project/rust-lang-libs/rust-clippy
Clippy's CI involves two versions of toolchains:
nightlyandmaster.cargo test(master) runstests/fmt.rsintegration test.tests/fmt.rsinvokescargo +nightly runonclippy_dev. This succeeds becausemasterdoes not havecargo. Now we are innightlyenvironment.clippy_devinvokescargo +nightly fmt. This fails becausenightlyhascargo.Possible Solution(s)
.cargo\binshould always be preferred (come first inPATHvariable).Notes
Output of
cargo version:cargo 1.40.0-nightly (8b0561d68 2019-09-30)