-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix dylib name on mac #30
base: main
Are you sure you want to change the base?
Conversation
Hej @matt-phylum A couple remarks:
|
Okay, so the macOS CI run passed - which is not what I expected:
Looks like
I would have expected |
That's the issue I'm expecting.
It depends on how you're distributing your code. If you're distributing the code via Homebrew, the library rpath is embedded such that it should work without needing to set any environment variables. If you're distributing the code via Cargo, it will build from source on the target machine so as long as the dylib is located during compilation it will work. If you're distributing the code via some other means, you probably need to copy the dylib into your distribution and update the executable to use relative rpaths. Changing the rpaths can be done during the build by setting linker flags or after the build by using Using a static library should make distribution easier. However, in my case I was trying to build a local test copy of something that normally runs in a different environment, and for some reason the static library was giving me an error about missing symbols related to bz2. I thought I was only seeing it in the smaller project because the larger project I have used bz2 for something else, but I can't replicate it now in either project. 🤔 |
Do you have |
The CI being able to find the library without |
Linux uses the pattern
"lib{}.so"
, but Mac OS X uses the pattern"lib{}.dylib"
and Windows uses the pattern"{}.dll"
.This bug fix will likely cause build failures. When you do the default
brew install libmagic
, you get the following files:If
build.rs
is updated to locate shared libraries correctly, it will start finding both libraries and prompting users to select whether they want static or dynamic linking.