-
Notifications
You must be signed in to change notification settings - Fork 19
dynamic librustc_driver path is not set by charon #588
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
Comments
This is a bug that should be fixed. On Linux and Mac, |
I use |
Also, have you encountered this bug on Linux? I would like to know what your setup is because that's also a bug that should be fixed. |
Based on the de91049 , I still got the dll loading error with Sorry, it's Chinese; it basically says rustc_driver dll is not found. The solution I can confirm is
Oh, it works on Linux! I mean
I didn't realize |
It's weird.
But Update: I think there is a bug from fn main() {
let args: Vec<_> = std::env::args().collect();
dbg!(&args);
let output = std::process::Command::new("rustc")
.args(args)
.output()
.unwrap();
let stdout = std::str::from_utf8(&output.stdout).unwrap();
let stderr = std::str::from_utf8(&output.stderr).unwrap();
println!("stdout = {stdout}\ntderr = {stderr}");
}
$ rustup run nightly-2024-10-23 target\debug\test-rustup.exe -vV
[src\main.rs:3:5] &args = [
"target\\debug\\test-rustup.exe",
"-vV",
]
stdout = rustc 1.84.0-nightly (86d69c705 2024-10-22)
binary: rustc
commit-hash: 86d69c705a552236a622eee3fdea94bf13c5f102
commit-date: 2024-10-22
host: x86_64-pc-windows-msvc
release: 1.84.0-nightly
LLVM version: 19.1.1
tderr = |
This comment has been minimized.
This comment has been minimized.
So far this is consistent with my understanding: the issue is that It seems that It seems that rustup doesn't even try to set up the right loader paths on windows: https://github.com/rust-lang/rustup/blob/895a43a3e2d942c5bb93b7b1c77c0ad9a0df95d6/src/toolchain.rs#L178 |
I'll open a rustup issue. I don't have a Windows machine: could you confirm that the same problem happens if instead of #![feature(rustc_private)]
extern crate rustc_driver;
fn main() {
println!("Hello, World!");
} ? |
Nice, I've opened an issue: rust-lang/rustup#4246. |
Personally speaking, the dynamic linked librustc_driver path should be always set before calling charon, otherwise there will be a loading problem.
I didn't find any issue reporting this. So this is a record for anyone who comes across the problem the first time.
On Linux,
LD_LIBRARY_PATH
should be set to the specified toolchain lib path:On Windows, you'll get a windows popup saying dll is not found or something, or get a painic error from CLI indicating stdout and stderr are empty strings:
So the solution is adding the toolchain path, e.g.
C:\Users\Administrator\.rustup\toolchains\nightly-2024-10-23-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib
, to system environment variablePATH
, and restart the terminal to make it work.The text was updated successfully, but these errors were encountered: