Bug 231144 - Orbit bundles should use Eclipse-BundleShape
Summary: Orbit bundles should use Eclipse-BundleShape
Status: CLOSED FIXED
Alias: None
Product: Orbit
Classification: Tools
Component: releng (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Project Inbox CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on: 157562 217006
Blocks:
  Show dependency tree
 
Reported: 2008-05-08 11:38 EDT by David Williams CLA
Modified: 2018-03-08 12:54 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2008-05-08 11:38:07 EDT
Eclipse-BundleShape ::= type
type ::= ('jar' | 'dir')

Once it is supported by the rest of Eclipse, that is. 

I'm just opening this bug to track. 

Bugs to watch: 

Bug 157562 to track documenting the header
bug 217005 to track changes to PDE-Build.
bug 217006 to track changes to p2.
bug 217007 to track changes to PDE-UI.
bug 217009 to track changes needed for jnlp.
Comment 1 David Williams CLA 2009-02-17 01:02:59 EST
assigning to myself just to have an owner
Comment 2 Gunnar Wagenknecht CLA 2011-02-11 02:57:30 EST
David, not sure if it is still necessary to keep this one open. Did you have specific bundles in mind?
Comment 3 David Williams CLA 2011-02-13 14:08:46 EST
(In reply to comment #2)
> David, not sure if it is still necessary to keep this one open. Did you have
> specific bundles in mind?

No nothing specific in mind ... more like all those that currently have "unpack-true" in the feature.xml (or map file?). 

It was mentioned once (on mailing list?) as maybe something we should do "in mass". (The directive didn't exist when we started Orbit ... added in 3.6?). It seems like a "good way" to do it ... but, not sure if it is in wide spread use or if there is a true "need". If no one (else) chimes in, then I agree, we should probably close this "in mass" bug, and update the "how to add a bundle to Orbit" directions, so committers can use it moving forward, but otherwise just "fix" those where there is a specific request.
Comment 4 David Williams CLA 2011-02-13 14:11:27 EST
assigning back to inbox (to signify there is no true assignee that's working on this) and marked as "helpwanted" to signify that if someone desires this change in mass, then they should take ownership and direct us as to what needs to happen.
Comment 5 Steffen Pingel CLA 2012-07-11 18:23:36 EDT
We noticed that Orbit bundles that should be unzipped (e.g. org.apache.axis) don't get exploded when provisioning a product using Tycho's eclipse-feature packaging type: http://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-feature . Tycho apparently expects the Eclipse-BundleShape header to provision the bundles as expected. 

It seems that it would be fairly important that the Orbit bundles that need to be unzipped would specify the header or is there another way to correctly provision Orbit bundles with Tycho?
Comment 6 Steffen Pingel CLA 2012-07-11 18:29:03 EDT
Here is some more background why Tycho ignore the unpack flag in the feature.xml: https://issues.sonatype.org/browse/TYCHO-555
Comment 7 David Williams CLA 2012-07-11 18:55:24 EDT
I certainly don't mind committers adding Eclipse-BundleShape to those Orbit bundles that want to be unzipped. 

But, the rest of what you say is a little disconcerting. I think the way the rest of Eclipse (not sure if its PDE, p2, or both) takes the Eclipse-BundleShape as a "hint" of what to do, but the feature specification is given priority. As far as I know.  

To do otherwise would have the potential to be breaking behaviour. I personally do not know of anyone who uses a feature specification to "go against" what is in an Eclipse-BundleShape directive ... but ... seems it should get some good community exposure, discussion, warnings, etc. if there is some big change coming. 

The "directive" to unzip or not eventually becomes part of the p2 metadata directive (right?) but I think in an ideal OSGi world, its expected that the consumer/adopter of a bundle could in theory have control if its left jarred or takes the 'dir' shape. 

This larger issue does not sounds like _this bug_ (which is just about adding the directive to Orbit bundles) but appreciate you pointing out the issue and giving some background.
Comment 8 Steffen Pingel CLA 2012-07-11 19:39:00 EDT
Sorry for posting information in small bits. The more I read about this, the more I realize that we haven't gotten to the bottom of our build problem. As you point out the problem that bundles are getting unpacked is not related to the header not being specified in Orbit bundles. 

The meta-data on the Orbit site looks correct, e.g. for org.apache.axis it specifies in the content.jar:

      <touchpointData size='1'>
        <instructions size='2'>
          <instruction key='zipped'>
            true
          </instruction>
          ...

If I understand the Tycho issue correctly this would only be a problem if Orbit decided to use Tycho for building. In this case the meta-data generated for the repository would be missing the 'zipped' touchpoint instruction regardless of unpack attribute specified in the feature (as Tycho would only honor the manifest header). Thanks very much for listening though.
Comment 9 David Williams CLA 2013-05-26 21:52:42 EDT

> 
> If I understand the Tycho issue correctly this would only be a problem if
> Orbit decided to use Tycho for building. In this case the meta-data
> generated for the repository would be missing the 'zipped' touchpoint
> instruction regardless of unpack attribute specified in the feature (as
> Tycho would only honor the manifest header). Thanks very much for listening
> though.

I think this is correct. I checked our feature.xml and there are currently only 6 that are expected to be "unzipped": 

org.junit
org.apache.ant
org.apache.axis
javax.xml.rpc
javax.xml.soap
org.apache.commons.discovery

I check the Eclipse Platform, and org.junit, and org.apache.ant are indeed unzipped ... so Tycho "copies" not only the artifact, but also the metadata ... whew.
Comment 10 Mickael Istria CLA 2013-09-11 03:44:13 EDT
We can also imagine that if one day, Orbit only builds bundles and no feature, the "unpack" metadata would get lost. That's why it would make sense to use Eclipse-BundleShape instead of a flag in feature.xml, and to rely on it to create p2 metadata.

Tycho generates metadata for each bundle, and then consumes them (without modifying them because modifying p2 metadata is evil according to p2 folks). That's why Tycho relies on Eclipse-BundleShape rather that the unpack flag, because it doesn't know the flag in the feature while generating p2 metadata.
Comment 11 Mickael Istria CLA 2013-09-11 07:36:01 EDT
This issue also affects Orbit consumption in tycho-surefire-plugin. Cf bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=416982 (comments 3 and 5)
Comment 12 Roland Grunberg CLA 2018-03-08 12:54:54 EST
I think we're now in a state where orbit recipe based bundles can easily add "Eclipse-BundleShape: dir" to their osgi.bnd if necessary. This won't fix already existing older bundles, unless they get moved over to the EBR side but it certainly improves things.

Marking as CLOSED (FIXED)