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
Does bnd-resolver-maven-plugin have trouble with Bundle-NativeCode? #5361
Comments
Just found this: bndtools/bndtools#1059 Honestly - maybe add this |
Or at least add a helpful hint in the error message that this option exists? |
Btw. I see that this option was added to some templates. I based by bndrun files off this tutorial: https://github.com/rotty3000/osgi-test-example-mvn Since there can be many reasons for people not starting off from the templates, I think hinting at the setting in an error message would be helpful. |
hi @reckart sorry for the omission in the example, I'll try to make it current. But yeah, it would be nice to improve the error messages. I've long wished for bnd to parse the error messages out of the resolver (it does to some degree) to product some more useful hints such as this one. |
We could issue a general warning if the list from https://docs.osgi.org/javadoc/r6/cmpn/org/osgi/service/resolver/ResolutionException.html#getUnresolvedRequirements() contains a requirement in the osgi.native namespace. By default bnd does not include any platform specific capabilities when resolving. This can cause problems if the resolution has native code dependencies. |
What eventually put me on the track to google for something that produced a link to bndtools/bndtools#1059 was a message in the build that said:
That
|
Yeah, attribute inference is limited to a very small subset of instructions that have easily assumable values (just 2 to be precise; However the moment you specify the instruction inference is disabled. It doesn't even consider expansion of values just whether the instruction was used or not. So it's rather simplistic in it's current form. What you are talking about is echo instructions, but which ones? The list is really huge and will very much pollute the output. We'd need a heuristic of some kind... but which ones are the important ones in a given scenario is going to be hard to derive. Anyway, I like the idea in general, but maybe we'd be better served by an instruction that asks to dump all or some specified bit of the configuration... However, I don't know if that solves your problem. I feel the solution here is more inline with what you yourself and @timothyjward mentioned.. better error output :) |
@pkriens will investigate ensuring there is a default osgi.native capability in the resolution process. |
Implemented in #5387 |
It seems when I have a dependency on a bundle that contains native libraries, the
bnd-resolver-maven-plugin
(and also the resolver in the bnd runfile editor in Eclipse) seem to have a problem. E.g.:I'm running on a 64bit Intel Mac, so I guess that the
(&(osgi.native.osname~=macosx)(osgi.native.processor~=x86-64))
should match.I have had the same problem already with two different bundles - one that I tried to build myself but then figured out that javacc appear to be able to loads its native libraries even withtout this OSGI native statement - and now again with an off-the-shelve snappy.
I have tried debugging this in Maven with
-X
, but I didn't see and more helpful information on what may be going wrong here.Is this a known issue? If not, any idea how to debug this (without attaching a debugger and step through the code)?
bnd: 6.3.1
The text was updated successfully, but these errors were encountered: