-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo test is not loading dynamic library (macos) #6623
Comments
I've binary searched nightly versions - the regression was added between commit 0d1f1bb (works) and 34320d2 (fails). Looks like the problem is #6355, which sets @ehuss from that thread:
Sure enough:
|
Sorry about that, a recent change altered As a temporary workaround, you can run |
Fix default DYLD_FALLBACK_LIBRARY_PATH on MacOS. On MacOS, dyld uses the default `$(HOME)/lib:/usr/local/lib:/lib:/usr/lib` for `DYLD_FALLBACK_LIBRARY_PATH` when it is not set. #6355 switched cargo to use `DYLD_FALLBACK_LIBRARY_PATH`, which means the default paths no longer worked. This explicitly adds the defaults back to the end of the list. Fixes #6623
Problem
The rust foundationdb bindings depend on
libfdb_c.dylib
in/usr/local/lib
.cargo test
fails because it can't find the library, but when I invoke the compiled library directly it works.This is a regression - it works fine in stable. It only fails in cargo from nightly.
But if I invoke the executable directly:
Tested on:
I haven't tested this on linux or windows.
Probably related to #3366
Steps
/usr/local/lib
git clone https://github.com/bluejekyll/foundationdb-rs.git
. I've been reproducing this problem using the current master (Clikengo/foundationdb-rs@95d49a1)cargo test
. The test binary should launch, then run or complain about not being able to connect to your cluster.Notes
I tried adding
cargo:rustc-link-search=/usr/local/lib
in foundationdb-sys's build.rs file, but that seems to have no effect.I'm not sure how to inspect cargo's testing environment (environment variables / command line options / etc).
fdb issue: Clikengo/foundationdb-rs#112
The text was updated successfully, but these errors were encountered: