-
Notifications
You must be signed in to change notification settings - Fork 588
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
#483 - Javacpp does not export package required by presets #490
#483 - Javacpp does not export package required by presets #490
Conversation
reckart
commented
Jun 2, 2021
- Add package-info with OSGI annotation so that the presets packages is exported for use by e.g. the openblas preset
- Add m2e lifecycle bindings for the maven-plugin-plugin to avoid error in Eclipse when importing the project
…is exported for use by e.g. the openblas preset - Add m2e lifecycle bindings for the maven-plugin-plugin to avoid error in Eclipse when importing the project
I made the change according to the pointer provided by @timothyjward |
Building the package, I can now see this in the MANIFEST.MF:
So it looks like the |
@timothyjward Does this look alright to you? |
…p-does-not-export-package-required-by-presets
@agibsonccc if you do a follow-up release to DL4J 1.0.0-M1 soon, it would be great if this change could make it in. |
It's probably not going to be enough. I think we need to add those package-info.java and what not to the presets themselves first. |
At least in our case, we pack the presets (e.g. openblas.jar) into our own OSGI bundle which then imports the packages from JavaCPP. We do not add JavaCPP directly into our bundle because it already is a bundle and bundling bundles doesn't really seem to be a good idea. Do you plan to turn the presets JARs into OSGI bundles as well? |
Ideally, yes, contributions are welcome. If you're bundling everything anyway, you should also bundle JavaCPP and ignore it's own bundle though. |
We had trouble integrating JavaCPP into the bundle in the past. As far as I remember, the Maven bundle plugin somehow merged some of the OSGI metadata from JavaCPP into the main bundle metadata which messed things up. At that point, we decided to handle JavaCPP separately. Also because in perspective, we'd have multiple bundles with native libraries and they should probably all share the same JavaCPP because as far as I understand Java native library loading should be centralized under a single classloader to avoid issues with attempts of loading the same native library multiple times. Not sure if I explain this well - it's a bit if a difficult terrain. So having everything in one bundle is only a temporary convenience for us that hopefully we'll move away from sooner or later. |
This is correct - you should only embed things that are designed to be completely internal to your bundle/module (much like using the maven-shade-plugin). In this case there are multiple different bundles using JavaCPP and (unless DL4J has changed its structure quite a bit) the fact that those modules are using JavaCPP is not an implementation detail. As a general rule, if a bundle which embeds some packages exports those packages then it probably shouldn't be embedding them. |
@timothyjward not a lot has changed. We're still sitting on your original pull request that adds osgi support and I think the same blockers are still there. |