Closed jszwedko closed 2 months ago
The toolchain is installed, though, and I'm able to run it directly via cargo +bisector-ci-801821d1560f84e4716fcbd9244ec959320a13d5-x86_64-pc-windows-msvc version
.
My guess would be that there is an issue with the PATH environment variable. cargo-bisect-rustc
just executes the command "cargo" from your PATH (although the lookup rules on windows is complicated), it doesn't use the one from the downloaded toolchains.
I'd verify that ~/.cargo/bin
is first in your PATH. It might also help to report which version of cargo-bisect-rustc you are using, and which version of Rust you used to build it.
I just tested on my machine and have the same problem.
cargo bisect-rustc -- version
checking the start range to find a passing nightly
installing nightly-2023-01-22
rust-std-nightly-x86_64-pc-windows-msvc: 27.22 MB / 27.22 MB testing...
RESULT: nightly-2023-01-22, ===> Yes
uninstalling nightly-2023-01-22
checking the start range to find a passing nightly
installing nightly-2023-01-20
rust-std-nightly-x86_64-pc-windows-msvc: 27.18 MB / 27.18 MB esting...
RESULT: nightly-2023-01-20, ===> Yes
uninstalling nightly-2023-01-20
checking the start range to find a passing nightly
installing nightly-2023-01-18
rust-std-nightly-x86_64-pc-windows-msvc: 27.14 MB / 27.14 MB testing...
RESULT: nightly-2023-01-18, ===> Yes
uninstalling nightly-2023-01-18
where cargo
executed cmd returns C:\Users\user\.cargo\bin\cargo.exe
but Command::new() returns
C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe
C:\Users\user\.cargo\bin\cargo.exe
Running cargo-bisect-rustc -vv -- verison
instead of cargo bisect-rustc -vv -- verison
fixes the issue. Apparently if command is run through cargo some additional paths are prepended to path: C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin;
Can you show which version of rustup you have and what your PATH looks like? I suspect it is https://github.com/rust-lang/rustup/issues/3036, and it may be an issue with PATH.
rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.66.0 (69f9c33d7 2022-12-12)`
My path is:
C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Eclipse Adoptium\jre-8.0.332.9-hotspot\bin;C:\Program Files\Eclipse Adoptium\jre-17.0.3.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jre-11.0.15.10-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.332.9-hotspot\bin;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\FirefoxPWA\;c:\page;C:\Users\user\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Streamlink\bin;C:\Program Files (x86)\Calibre2\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Users\user\.cargo\bin;C:\Users\user\AppData\Local\Microsoft\WindowsApps;C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\user\ffmpeg\bin;C:\Users\user\AppData\Roaming\Python\Python310\Scripts;C:\Users\user\AppData\Roaming\nvm;C:\Program Files\nodejs
and when running cargo run on my test program:
fn main() {
println!("{}", std::env::var("PATH").unwrap());
let mut cmd = std::process::Command::new("cmd");
cmd.arg("/C");
cmd.arg("where");
cmd.arg("cargo");
cmd.status().unwrap();
}
those paths gets prepended: C:\Users\user\tester\target\debug\deps;C:\Users\user\tester\target\debug;C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin;
program outputs these line for where cargo
:
C:\Users\user\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe
C:\Users\user\.cargo\bin\cargo.exe
but only C:\Users\user\.cargo\bin\cargo.exe
when not run via cargo.
Yea, the issue is https://github.com/rust-lang/rustup/issues/3036. I have posted a fix there for it.
The fix for here would be to use rustup run {toolchain} cargo {subcommand}
. I have done it on each of my windows machines, and it works correctly.
Update on this: This can be fixed by setting the environment variable RUSTUP_WINDOWS_PATH_ADD_BIN=0
. We hope to change the default option for that in rustup in the future.
This should now be fixed by default with rustup 1.27.1 released today.
Hey all,
Just trying out
cargo-bisect-rustc
today. When I try to run:(I was trying an actual build command but simplifying the failure to running
version
)It seems to have trouble running
cargo
with the newly added toolchain: