native-lib-loader icon indicating copy to clipboard operation
native-lib-loader copied to clipboard

Add directory layout according to os-maven-plugin and osdetector-gradle-plugin

Open bmarwell opened this issue 6 years ago • 11 comments

…e-plugin.

bmarwell avatar Apr 07 '19 21:04 bmarwell

Hey! Why was this not merged? Looks really useful!

lorenzleutgeb avatar Jan 10 '21 10:01 lorenzleutgeb

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 😉

bmarwell avatar Jan 10 '21 13:01 bmarwell

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?

imagejan avatar Jan 15 '21 09:01 imagejan

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.

tresf avatar Jul 27 '21 15:07 tresf

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.

ctrueden avatar Jul 27 '21 16:07 ctrueden

I rebased this over the latest master. Tests still pass, but I didn't check super thoroughly that everything is 100% right.

ctrueden avatar Jul 27 '21 17:07 ctrueden

@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.

ctrueden avatar Jul 27 '21 17:07 ctrueden

@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.

bmarwell avatar Jul 27 '21 18:07 bmarwell

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. 🍻

tresf avatar Jul 27 '21 19:07 tresf

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.

bmarwell avatar Jul 28 '21 05:07 bmarwell

@lorenzleutgeb Is this work something you'd still find useful? Any time and interest in testing it?

ctrueden avatar Aug 10 '21 03:08 ctrueden