endorlabs / MIRAI

MIT License
41 stars 7 forks source link

Error on macOS #2

Open Edivad99 opened 4 weeks ago

Edivad99 commented 4 weeks ago

Issue

When I run cargo mirai I get this error:

davide@MBP-di-Davide hello-rust % cargo mirai
    Checking hello-rust v0.1.0 (/Users/davide/Sviluppo/Rust/hello-rust)
dyld[48165]: Library not loaded: @rpath/librustc_driver-5e4bb888e3e572f4.dylib
  Referenced from: <2A8CD396-59E0-3EC6-9DED-EFE5E73E446E> /Users/davide/.cargo/bin/mirai
  Reason: tried: '/Users/davide/Sviluppo/Rust/hello-rust/target/debug/deps/librustc_driver-5e4bb888e3e572f4.dylib' (no such file), '/Users/davide/.rustup/toolchains/stable-aarch64-apple-darwin/lib/librustc_driver-5e4bb888e3e572f4.dylib' (no such file), '/Users/davide/lib/librustc_driver-5e4bb888e3e572f4.dylib' (no such file), '/usr/local/lib/librustc_driver-5e4bb888e3e572f4.dylib' (no such file), '/usr/lib/librustc_driver-5e4bb888e3e572f4.dylib' (no such file, not in dyld cache)
error: could not compile `hello-rust` (bin "hello-rust")

Caused by:
  process didn't exit successfully: `/Users/davide/.cargo/bin/cargo-mirai /Users/davide/.rustup/toolchains/nightly-2023-12-30-aarch64-apple-darwin/bin/rustc --crate-name hello_rust --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=130 --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C metadata=064f3c2b5f4833d2 -C extra-filename=-064f3c2b5f4833d2 --out-dir /Users/davide/Sviluppo/Rust/hello-rust/target/debug/deps -C incremental=/Users/davide/Sviluppo/Rust/hello-rust/target/debug/incremental -L dependency=/Users/davide/Sviluppo/Rust/hello-rust/target/debug/deps --cfg mirai -Z always_encode_mir` (exit status: 255)

Steps to Reproduce

git clone https://github.com/facebookexperimental/MIRAI.git
cd MIRAI
cargo install --locked --path ./checker
cd ..
cargo new hello_world
cd hello_world
cargo mirai

Expected Behavior

Not to crash

Environment

Rust version (rustc --version) rustc 1.81.0 (eeb90cda1 2024-09-04)

linchengLi-l commented 22 hours ago

Hi. Have you solved the problem? I did not get results after running cargo mirai in the root directory of a project.

Edivad99 commented 22 hours ago

@linchengLi-l nope

hermanventer commented 16 hours ago

I have had other reports of this as well. Sadly, I can't reproduce it locally. I've been told that, for Linux, setting the LD_LIBRARY_PATH variable does the trick. For your case, DYLD_LIBRARY_PATH=/Users/davide/.rustup/toolchains/nightly-2023-12-30-aarch64-apple-darwin/lib might do the trick.

This is a change in behavior in the Rust runtime that happened somewhere in the last year. If anyone has any pointers to what is really going on here, I'd very happy to hear from you.

hermanventer commented 16 hours ago

It is conceivable that the problem David Tolnay kindly fixed in https://github.com/endorlabs/MIRAI/pull/4, is related to this. If syncing up to the latest version of MIRAI makes the problem go away for you, I'd very much appreciate hearing from you.