-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Running a binary built by cargo fails due to missing libraries; but cargo run
ning it works
#47931
Comments
I can replicate the problem on OSX on nightly [rustc 1.25.0-nightly (90eb44a 2018-01-29)]. |
This is a general issue with any crate that depends on internal rustc crates. One way to solve this is with my ideal solution, which is to trash the whole dylib plugin infrastructure and instead have all the rustc internal libraries be normal rlibs with procedural macros being cdylibs (or separate binaries entirely with IPC). |
Is there any workaround yet? EDIT: For people coming from google, run this:
|
/cc @dtolnay - retep998's comment above makes it sound like |
If #48217 gets merged then fixing this should be as easy as setting rpath=true in the Cargo.toml of the app (e.g. |
This reverts commit 6899c27. The `proc_macro2` crate depends on rustc internal crates, which means that `bindgen` would need to be run under `rustup`. We can follow rust-lang/rust#47931 to get updates on when this issue might be resolved and we can update `quote` again. Fixes rust-lang#1248
It would only "fix" it on platforms that have rpath. Windows users would be left out in the cold. |
Triage: the sysroot system hasn't changed at all. |
It works fine on Linux nightly. Steps for verification:
|
There are three options here: Setting |
The proc_macro crate is now only available as rlib and not as dylib. The only time this issue can show up now is if you link against the unstable rustc_driver crate or if you use |
STR (using latest stable rust 1.23.0 on Ubuntu 16.04):
cargo build --release
target/release/cbindgen
cargo run --release
Expected:
step 3 and step 4 both run the binary without errors
Actual:
Step 4 runs the binary. But step 3 produces this error:
That .so file doesn't appear in the
target
directory./cc @eqrion who was seeing this also.
The text was updated successfully, but these errors were encountered: