Uh oh!
There was an error while loading. Please reload this page.
GH-882: Add support for loading native library from a user specified location - #883
Conversation
This comment has been minimized.
This comment has been minimized.
lidavidm
commented
Oct 10, 2025
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 |
lidavidm
commented
Oct 10, 2025
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.
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.
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.
lidavidm
commented
Oct 13, 2025
Ah, the JNI CI is still broken for now...we can queue this for after #865 |
lidavidm
commented
Oct 13, 2025
Ah but in the meantime do you mind helping the linter out? |
lidavidm
commented
Oct 27, 2025
Ok, please rebase and CI should be fixed! |
Uh oh!
There was an error while loading. Please reload this page.
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.pathsystem property.Closes#882.