Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346532

Summary: Content leaks between products in the same eclipse-repository projects
Product: z_Archived Reporter: Tobias Oberlies <t-oberlies>
Component: TychoAssignee: Tobias Oberlies <t-oberlies>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: frydzewski, hmalphettes, igor
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Demonstrate content leakage between product definitions
none
mylyn/context/zip none

Description Tobias Oberlies CLA 2011-05-19 15:36:42 EDT
If two products defined in the same eclipse-repository module, only the first product is published correctly. The second product is broken: it is published to also includes all the the content of the first product in addition to its own content!

The behaviour appears to be non-deterministic because the products are published in no specified order. (The console log only mentions the order of the director calls, which is not relevant for this issue.) In the current implementation, the publishing order is the order returned by File.listFiles(), which is OS-dependent. 

The only known work-around is to not specify more than one product in an eclipse-repository module.

This is a critical bug because its effects are hidden and may lead to an unwanted delivery of content, e.g. sources. The following Tycho releases are affected by this bug: 0.11.0, 0.11.1, 0.12.0
Comment 1 Tobias Oberlies CLA 2011-05-19 15:44:02 EDT
Created attachment 196165 [details]
Demonstrate content leakage between product definitions

The products are defined to contain only one of the (unrelated) bundles org.eclipse.core.jobs or org.eclipse.equinox.registry, but in the build result, one of the product contains both!

The error lies in the generated p2 metadata: one of the product IUs requires both bundles desipte its definition in the .product file.
Comment 2 Tobias Oberlies CLA 2011-05-19 15:54:56 EDT
Created attachment 196167 [details]
mylyn/context/zip

The root cause for the issue is the re-use of the IPublisherInfo instance when publishing the products: the IPublisherInfo object stores the dependency of the product IU in "root advices", and the advices are not reset between the publisher calls for the products.
Comment 3 Hugues Malphettes CLA 2011-05-19 19:57:15 EDT
We face this bug in RTP: bug 340017
Comment 4 Igor Fedorenko CLA 2011-05-19 20:56:34 EDT
Am I right that this problem will solve itself when we separate eclipse-repository and eclipse-product (or whatever we're end up calling it) functionality in two distinct packaging types?
Comment 6 Tobias Oberlies CLA 2011-05-23 08:34:13 EDT
(In reply to comment #4)
> Am I right that this problem will solve itself when we separate
> eclipse-repository and eclipse-product (or whatever we're end up calling it)
> functionality in two distinct packaging types?
Yes, it won't be possible to publish two products in one module in eclipse-product. Nevertheless I fixed the issue now because otherwise we may seem similar problems when publishing other artifacts.
Comment 7 Hugues Malphettes CLA 2011-05-24 06:27:33 EDT
Thanks Tobias and all.
We upgraded to 0.13.0-SNAPSHOT and it worked for RTP.

I understand the need for "eclipse-product". I hope that tycho will continue to support publishing multiple products and features in the same repository.

Cheers!
Comment 8 Tobias Oberlies CLA 2011-06-10 08:00:12 EDT
Fixed target milestone field. Together with the RESOLVED FIXED status, it should now be clear that this is fixed in 0.13.0-SNAPSHOT and will be part of the 0.13.0 release. (And just in case you are wondering, once we have a planned date, it should be shown here [1] as "planned")

There are no plans to create an extra 0.12.1 release with just this patch, because a workaround is available.

[1] http://www.eclipse.org/projects/project_summary.php?projectid=technology.tycho