facebookexperimental / MIRAI

Rust mid-level IR Abstract Interpreter
MIT License
1k stars 86 forks source link

mirai: error while loading shared libraries: librustc_driver-0c79f0a768565e4a.so: cannot open shared object file: No such file or directory #1270

Open VorpalBlade opened 4 months ago

VorpalBlade commented 4 months ago

Issue

I tried to run mirai on one of my projects (a simple no-std library for parsing INI files) and got a very strange error.

Steps to Reproduce

$ git clone https://github.com/VorpalBlade/ini-roundtrip
$ cd ini-roundtrip
$ git checkout 9d2589f4d5a845a9a19249e5b3bfe6b49c893c85
$ cargo mirai
    Checking cfg-if v1.0.0
    Checking ini-roundtrip v0.1.3 (/home/arvid/src/chmm/ini-roundtrip)
/home/arvid/.cargo/bin/mirai: error while loading shared libraries: librustc_driver-0c79f0a768565e4a.so: cannot open shared object file: No such file or directory
error: could not compile `ini-roundtrip` (lib)

Expected Behavior

Not give a strange error aout a rustc driver .so file?

Actual Results

/home/arvid/.cargo/bin/mirai: error while loading shared libraries: librustc_driver-0c79f0a768565e4a.so: cannot open shared object file: No such file or directory

Environment

Rust version (rustc --version): rustc 1.79.0 (129f3b996 2024-06-10) Mirai commit: 6a91ee00efcd5eb0b8eab51fa51ab00f0f22eb13 OS: Arch Linux (rolling release) Rust is installed via rustup

VorpalBlade commented 4 months ago

Update: This seems to happen on any project I try. Even a simple hello world one.

heisen-li commented 4 months ago

It happened to me too.

VorpalBlade commented 4 months ago

LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-2023-12-07-x86_64-unknown-linux-gnu/lib/ cargo mirai works as a workaround for me. This suggests somehow the linking is screwed up, perhaps it should use rpath?

hermanventer commented 4 months ago

It seems that something has changed in cargo that breaks plugins like MIRAI. I'll try to look into it, but it is going to take a while before I can get to it.