Community
Participate
Working Groups
The latest API reports show org.eclipse.equinox.io was added to the Eclipse SDK, but I do not know why: http://download.eclipse.org/eclipse/downloads/drops/I20110505-0800/apitools/report.html This bundle should not be included in the SDK. I have a suspicion that it is because of the dynamic import added in bug 304706 to import javax.microedition.io (which is exported by org.eclipse.equinox.io). But that makes no sense to me because I did not think p2 knew about dynamic imports or paid any attention to them.
It isn't included in any features, so it must be coming in as part of the director install. It looks like the metadata for osgi.services has an optional package import on the package provided by this bundle: <required namespace='java.package' name='javax.microedition.io' range='0.0.0' optional='true'/> Pascal, how do we handle dynamic imports in p2?
In bug192986 we had said that dynamic imports should not be considered, but it is unclear if we actually confirmed that this is the behavior of p2. Simon mentioned that he disabled the case where wildcards (*) is used, but what about fully qualified dynamic imports?
I really think we need resolution on this bug. We need to confirm that the p2 metadata is a result of the fully qualified dynamic import from org.eclipse.osgi.services. If so I think that would be a mistake. I think it is pretty clear that p2 should not pay attention to any dynamic imports, fully qualified or not.
I'm looking at the code in the BundlesAction class in the publisher and it appears to consider non-wildcard dynamic imports as regular optional imports.
Created attachment 195531 [details] patch for p2.inf Tom and Andrew and I discussed this. There are 2 approaches: change p2 metadata generation or change the osgi.services bundle. At this point in the release, we've decided to add a p2.inf file to the osgi.services bundle which makes the dynamic package import statements non-greedy when converted to p2 metadata. I've attached this as a patch. We should investigate going forward if the right answer for dynamic package imports in general is to make them non-greedy. If we want to ignore them altogether, the code is in BundlesAction#createBundleIU: ... if (importPackageName.indexOf('*') != -1 || "dynamic".equals(importSpec.getDirective(Constants.RESOLUTION_DIRECTIVE))) ...
I think marking them non-greedy by default is probably a good idea.
Moving back to compendium to make the p2.inf changes for o.e.osgi.services. I opened bug 345726 to track the default greedy behavior of fully qualified dynamic imports in p2.
DJ, does the new p2.inf need to be included in the src.includes for the source build?
Nope, I don't think so.
I would have said the '<' and '>' characters are not intended to be part of the p2.inf entries, instead it would just be 'requires.0.namespace = java.package' However, I checked p2.inf parser, and that segment can really be anything, so '<0>' is valid. org.eclipse.osgi.services exported using a feature to get metadata did result in greedy = false requirements.
Thanks Andrew, I released the patch and removed the '<' and '>' characters to make it more clear. I kicked off a test build to confirm: https://hudson.eclipse.org/hudson/job/eclipse-equinox-test-N/355/
Test build was a success.
verified in I20110514-0800