-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong PATH override on Windows #7475
Comments
It seems the bug is present since the latest update of cargo in the rustc repo: |
Is there some cargo test we can add to make sure this doesn't happen again? If so we can use it to bisec to find the what broke it. |
It's reproducible on Windows (both msvc and gnu) by running It's far from being minimal though. |
The issue is due to #7425, though I'm not yet sure I understand it fully. |
@alexcrichton I'm running out of energy for today, but I'll try to distill what is happening and see if you have some ideas. Problem: Due to #7425, on Windows, Cause: Previously, Possible solution? I was thinking maybe |
Workaround cargo issue on appveyor Use absolute paths for `cargo` and `rustfmt` to workaround rust-lang/cargo#7475. Appveyor passed on my fork: https://ci.appveyor.com/project/sinkuu/rust-clippy/builds/27870367
Workaround cargo issue on appveyor Use absolute paths for `cargo` and `rustfmt` to workaround rust-lang/cargo#7475. Appveyor passed on my fork: https://ci.appveyor.com/project/sinkuu/rust-clippy/builds/27870367 changelog: none
Fix wrong directories in PATH on Windows This fixes an accidental regression from #7425 where `PATH` was being augmented on Windows with the wrong search path for target/host libraries. This commit fixes the issue by simply always calculating the host/target library paths for `TargetInfo`, and then we explicitly use the same `TargetInfo` for filling out information in `Compilation`. Closes #7475
This fixes a regression from rust-lang#7475 where the sysroot_target_libdir leaks into the host libdir. This can cause problems when the dynamic linker does not ignore the target libraries but tries to load them instead. This happens for example when building on x86_64-musl for aarch64-musl.
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 plaincargo
binary fromnightly-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
andmaster
.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 inPATH
variable).Notes
Output of
cargo version
:cargo 1.40.0-nightly (8b0561d68 2019-09-30)
The text was updated successfully, but these errors were encountered: