-
Notifications
You must be signed in to change notification settings - Fork 87
GH-882: Add support for loading native library from a user specified location #883
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Is there precedent for this kind of flag in other JNI libraries? |
See for instance https://github.com/xerial/sqlite-jdbc/blob/755cf1d0223a83b97909fca43c8027e3e02bc021/src/main/java/org/sqlite/SQLiteJDBCLoader.java#L300 and https://github.com/jnr/jffi/blob/master/src/main/java/com/kenai/jffi/internal/StubLoader.java#L302 A possible alternative could be to check As described in the issue, loading executable code from |
Thanks. I'll give this a fuller review but if there's precedent then the idea is good by me. |
return; | ||
} | ||
} catch (UnsatisfiedLinkError e) { | ||
// Ignore this error and fall back to extracting from the JAR file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, would it be better to error if the property is provided but the file doesn't exist? That way you don't unexpectedly/silently fall back when you intended to load from somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my specific application the native library will be have been stripped from the jar and loading will fail so the end result will be the same either way.
I modeled this on examples like the ones I referenced where possible alternatives are tried in a specified order. Happy to change this to fail early though. Let me know what you would prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we can leave it as is then.
Ah, the JNI CI is still broken for now...we can queue this for after #865 |
Ah but in the meantime do you mind helping the linter out?
|
What's Changed
Add an opt-in code path that attempts to load the native library relative to the path specified by the
arrow.cdata.library.path
system property.Closes #882.