-
Notifications
You must be signed in to change notification settings - Fork 13
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
bad handling for bundles with system.bundle dependency #104
Comments
Can you provide a fix for version 0.9.4? |
Please remind, that I use the aspect "P2 Metadata Generator 1.0.0 – p2.metadata" for the generation of the needed metadatas. The datas from tycho are cleaned with the aspect "Tycho Cleaner 1.0.0 – tycho-cleaner". |
Why should Package-Drone replace system.bundle with org.eclipse.osgi? |
WTF ... Well mapping this would be easy, but what when you want to use Apache Felix, Concierge or Knopflerfish? I think the least that should be possible is to define an alternative bundle name. And still this would let the channel maintainer define which OSGi implementation you have to use. Guessing that P2 won't work outside of Equinox-World, this might be OK for now. But ... WTF. I don't want to push new features into the 0.9.x branch. This is what caused troubles in the past. ;-) And I know this regression compared to Tycho or P2. But still, adding a mapping and configuration for this, is an enhancement for Package Drone. But I will make the release 0.10.0-m2 next week, and add this feature, so that you can switch. |
Well I wouldn't use system.bundle either, but when somebody else did and P2 does handle it that way, what can you do? I would suggest providing a replacement name. Leave it empty for not replacing the alias. |
Is there a specification how the p2-metadata / context.xml have to be generated? Sure, if this is a must, we should add an option or do it the same way. |
Isn't this a problem of the plug-in / bundle at all. |
Well I think as well that it is odd. In many ways! If the bundle requires functionality from the However I could imagine that the P2 system has no clue about the fact that the So in the end this would be an option (optional) for the P2 metadata generation which has to be activated manually and would, maybe, automatically be set by a recipe. It would also not interfere with Maven or R5 handling. |
I just browsed and grepped a little bit through the P2 source code and could not find anything that indicates that their are doing something like this. However I also did browse and grep through the Tycho source code and saw that their "resolver" does resolve the So if this information is transformed during build, and this information is then lost and written out in the fragment files, then we would have the described behavior. However I would consider this a bug in Maven Tycho! There is one "easy" test you can do. Export the OSGi bundle from the Eclipse PDE to a P2 repository. Or use the P2 ant task to generate a P2 repository from this single OSGi bundle. And check the generated meta data of P2 (without Tycho). |
There is a sample project I can direct you to [1], coming from Eclipse SCADA. It is an ant file which generates a local P2 repository from local OSGi files. It is important that the ant file is executed from inside the Eclipse IDE, with the internal Ant runtime. Otherwise the tasks will not be available. |
One suggestion: create a new aspect like the conventional aspect "P2 Metadata Generator 1.0.0 – p2.metadata", but with fixed mapping to org.eclipse.osgi. The name could be "Equinox P2 Metadata Generator". |
For deployment to a filesystem-based repository I use the tycho-extras-plugin (https://wiki.eclipse.org/Tycho/Additional_Tools#publish-features-and-bundles_goal). |
According http://wiki.osgi.org/wiki/System_Bundle I agree, this is a bug in Tycho. But I hope, you can solve this Tycho-bug with a "special" aspect for package-drone? |
To get your stuff working (I think we all would like to get your stuff running), we need to change something.
|
So I made a quick test:
The result is in fact a dependency on …
<requires size='2'>
<required namespace='osgi.bundle' name='org.eclipse.osgi' range='0.0.0'/>
<required namespace='java.package' name='org.osgi.framework' range='1.3.0'/>
</requires>
… |
Therefore I would consider this as a regression in Package Drone created P2 meta data. However I would not simply replace this, hard coded, with |
This bundle and feature only serve as a test dependency to `system.bundle` in order to test P2 metadata generation.
That sounds reasonable, but is still very confusing to me, why this should be necessary. |
Thanks for your solution. I hope for getting my last problems with productive usage of pdrone (as replacement for file-based P2-repositories in a Tycho-based scenario) solved with the next releases. ;-) |
My tycho-builds runs again with version 0.10.0-m2, so we can close this issue. |
If I upload bundles with dependency to the wrapper system.bundle, the generated metadata for this bundle is bad.
Here an example: a bundle with following manifest-fragment:
Manifest-Version: 1.0 Bundle-Vendor: %Bundle-Vendor.0 Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: javax.xml Require-Bundle: system.bundle Bundle-Version: 1.3.4.v201005080400
The fragment of the generated p2-metadata in a classic p2-repository (content.xml):
<requires size='1'> <required namespace='osgi.bundle' name='org.eclipse.osgi' range='0.0.0'/> </requires> <artifacts size='1'> <artifact classifier='osgi.bundle' id='javax.xml' version='1.3.4.v201005080400'/> </artifacts>
And here the problematic fragment of the generated p2-metadata from package drone (also content.xml of the channel):
<requires size="1"> <required name="system.bundle" namespace="osgi.bundle" range="0.0.0"/> </requires> <artifacts size="1"> <artifact classifier="osgi.bundle" id="javax.xml" version="1.3.4.v201005080400"/> </artifacts>
There seems to exist a special handling for dependencies to the bundle system.bundle, so the name is mapped to org.eclipse.osgi in the metadatas. This special handling is missing in package-drone.
The text was updated successfully, but these errors were encountered: