-
Notifications
You must be signed in to change notification settings - Fork 67
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
replaced Require-Bundle with Import Packages #253
base: master
Are you sure you want to change the base?
Conversation
For unclear reasons Require-Bundle was introduced, which makes it unnecessarily hard to work with bundles outside of equinox, that have some strong reliance on eclipse core runtime. The use of Import-Packages here allows to circumvent this strong requirement in some cases with creative repackaging. Signed-off-by: Juergen Albert <[email protected]>
Sidenote: As I was building it locally with tycho, the changes in my manifest did not make it in the build jar until I changed the Version. I found my Manifest correctly copied to the target directory, but the result seemed to come from a previous version. Is this normal or am I missing something? |
The Require-bundle was introduced by @HannesWell in 97a02a0#diff-98e2e2939a98231d03432cd076fd94aa6396649b18bebff255b384f91134567c so I would let him review this one. |
The reasoning in the mentioned change was that the So if the current state does not work for you we maybe should go for the alternative suggested by @tjwatson:
I would be fine with that as well, but the adaptable types should be fully qualified class names. |
I understand the usecase, but question why one would have a hard requirement to provision equinox bundles to other frameworks besides Equinox itself. Furthermore, with the limited team we have today that needs to focus on the Eclipse IDE usage of Equinox, why we need to spend time on such a thing that gets zero testing within our own tests of the project. |
If the bundle version do not change then the build artifact is replaced by the baseline version, this is to prevent distribute the same version with slightly different content, but you should have get a warning about that. |
I must confess that even after reading the gerrit I don't understand what is the "not-speced behavior" and why it requires a require-bundle here? even if |
As explaination: we use QVT or OCL that use e.g. o.e.core.runtime.CoreException. As this moved to o.e.equinox.common, we have that strong requirement to Equinox OSGi and it is not possible to use such bundles with other OSGi Frameworks anymore. |
Just to be clear, you must be able to run equinox.common on other frameworks? We have no tests for doing that, so it is luck that it works. |
This reminds me of: what would allow to make a new bundle manifest quite easy that only exposes the required packages, maybe BND can even repack a dependency somehow? But even more worse |
It was the use of: return Optional.ofNullable(bundle.adapt(File.class)); Where we depend on If someone is willing to spend time developing testcases that prove equinox.common and other things remain "working" on other frameworks then I would be more open to having the project support such a scenario. But the current state of no tests make it very hard to claim any of this works. |
Because other bundle have import requirements to org.eclipse.core.runtime.* we might end up in o.e.equinox.common. In that case o.e.core.runtime.CoreException. From my point of view this is more a problem related to the split packages in org.eclipse.core.runtime and org.eclipse.equinox.common. From what I can see is that our QVT bundles require just some org.eclipse.core.runtime API, means interfaces IProgressMonitor and NullProgressMonitor or CoreException. Having a pure org.eclipse.core.runtime API bundle would be the greatest thing :-) |
If you assist us in form of reviews, we would invest some time creating test cases to be able to start restructuring of bundles, that are backed with tests |
But that's exactly what I mean, we do not really depend on that working, as it is an optional it just might be that for other frameworks this always returns an empty optional (while as you said it is not forbidden, just not required that a bundle can be adapted to a |
Who is "we"? I assume "someone" depends on it working. If not, then shouldn't we deprecate the method and mark for removal? |
The commons bundle / equinox
users of that method can still depend on it, it will just always give an empty optional if not used in equinox, so users that require this simply must choose equinox, as with other equinox features (from my understanding mostly Equinox itself and Eclipse really 'depend' on the feature so I don't see a general issue here. |
There are two problems with this:
Both are situations that make it hard to claim any support on other frameworks and make it harder for maintainers to keep the project working. |
Stepping back, if others want to loosen the dependency declared by |
But it is also not documented that it only works on equinox, the point is that it was said that Beside that, I have the feeling that on the long term one should slip equinox in distinct, independent parts (like for example it is done for the I have opened: |
Personally I would not object to switch back to Import-Package and provide that bundle as is without any warranty for any other Framework except Equinox. It would then be up to the users that use those bundles in another framework to find out if that works or not. Nevertheless they should be made aware of the fact that they are building on a house of cards as Tom said and not blame equinox in the end. But the suggestion to better split concerns seems reasonable to me, at least on bundle level. |
No, but I have to. This is what I wanted to avoid. Its is absolutely ok, the equinox.common is strongly wired to org.eclipse.osgi. In an ideal world I could consume the Excpetion class from an core.runtime.api bundle :-) |
I think one path would be to first reduce the number of references to the to prepare for this. |
@juergen-albert what do you think about adding a required capability of type "osgi.framework = equinox" here and provided that from the |
For unclear reasons Require-Bundle was introduced, which makes it unnecessarily hard to work with bundles outside of equinox, that have some strong reliance on eclipse core runtime. The use of Import-Packages here allows to circumvent this strong requirement in some cases with creative repackaging.