native-lib-loader
native-lib-loader copied to clipboard
Add directory layout according to os-maven-plugin and osdetector-gradle-plugin
…e-plugin.
Hey! Why was this not merged? Looks really useful!
Don't know. I created my own in the end which was more versatile and then didn't need it anymore. Feel free to create a new pr 😉
We can probably reopen this pull request if there is interest. I guess the changes proposed here aren't backward compatible, so we'd require a major version bump to 3.0.0.
@ctrueden any comments?
I guess the changes proposed here aren't backward compatible
They are (in theory) using the LegacyConstants class, as was intended, quoting the (non) linked issue:
[...] sort out the folder names (retaining compatibility, of course).
https://github.com/scijava/native-lib-loader/blob/4fee864bfdf9ed18aabd8e35b40bd8f7618c1750/src/main/java/org/scijava/nativelib/DefaultOsInfo.java#L62-L77
I'd also like to add that the JNA library does something very similar, so matching their exact library search patterns may be a welcomed change for any developers mixing these.
Sorry all, just too busy trying to maintain too many things. If anyone has the time and interest to help out as co-maintainer, that would be much appreciated.
I do think we should preserve backwards compatibility if possible, or else bump to version 3.0.0-SNAPSHOT according to SemVer. Does anyone have the bandwidth to review this PR and fix backwards compatibility issues? If not, I can merge it as is and bump the version. Please let me know.
I rebased this over the latest master. Tests still pass, but I didn't check super thoroughly that everything is 100% right.
@bmarwell wrote:
I created my own in the end which was more versatile and then didn't need it anymore.
Do you think it could fully replace this library? I'm always interested in better alternatives.
@bmarwell wrote:
I created my own in the end which was more versatile and then didn't need it anymore.
Do you think it could fully replace this library? I'm always interested in better alternatives.
Hi😊
In theory, yes. But nowadays I would use a completely different approach (no maps) and I never did a release. I stopped working on jssc, because I think I was a little too progressive (I wanted to avoid manual work). We also argued about caching the unpacked file between JVM starts - which is not needed in my opinion.
So, if you are interested, we could get it going again.
We also argued about caching the unpacked file between JVM starts - which is not needed in my opinion.
Adding context, in hindsight, the argument probably would have been better spent advocating for a simple, static location (#41) instead, as that seems how other large Java projects (IntelliJ, Cyberduck, Minecraft) handle this problem (they tackle the performance issues as a packaging/deployment task, which is probably where it belongs). My perspective has changed a bit as I work with other libraries that do the same, so, sorry. 🍻
We also argued about caching the unpacked file between JVM starts - which is not needed in my opinion.
Adding context, in hindsight, the argument probably would have been better spent advocating for a simple, static location (#41) instead, as that seems how other large Java projects (IntelliJ, Cyberduck, Minecraft) handle this problem (they tackle the performance issues as a packaging/deployment task, which is probably where it belongs). My perspective has changed a bit as I work with other libraries that do the same, so, sorry.
I fully agree with that for large projects you mentioned. I am just not sure caching is so useful for a ~13kiB shared object/dll/dylib file (performance issues??). Also, having a new tmp directory each time avoids concurrency issues.
That is why I at least wanted to postpone this feature.
The performance issue does arise if you start your app multiple times per minute. Otherwise, it would probably not wear your CPU down.
If you DO have such an application, there might be a performance impact which would make caching feasible.
@lorenzleutgeb Is this work something you'd still find useful? Any time and interest in testing it?