Bug 320428 - product export fails silently if product id collides
Summary: product export fails silently if product id collides
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
: 341950 (view as bug list)
Depends on:
Blocks: 345996
  Show dependency tree
 
Reported: 2010-07-20 14:01 EDT by Jeff McAffer CLA
Modified: 2011-05-16 15:28 EDT (History)
5 users (show)

See Also:
curtis.windatt.public: review+


Attachments
Patch (4.45 KB, patch)
2011-05-02 17:45 EDT, Ankur Sharma CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2010-07-20 14:01:02 EDT
in 3.5.2 and Helios

if you have a .product whose ID is the same as that of a plugin in that product (e.g., both are org.eclipsercp.hyperbola) then exporting the product from PDE UI silently fails.  The output dir has plugins and a p2 dir but no executables and some other files are missing.

Note that htis only happens if the Generate Metadata Repository option is used.

I suspect the problem is that the product and bundle p2 IU IDs collide and that confuses the director.

At the very least the export should not silently fail (note it may not actually be "failing" rather, just not doing what was expected).  Even better, there should be some sort of check regarding the IDs or the product IU ID should be suffixed with something under the covers (ala how features are).
Comment 1 DJ Houghton CLA 2011-04-07 11:17:08 EDT
*** Bug 341950 has been marked as a duplicate of this bug. ***
Comment 2 DJ Houghton CLA 2011-04-07 11:18:04 EDT
Can we get this looked at as part of the polish work for 3.7? Even just a warning/error in the product editor would be a start and help the user.
Comment 3 DJ Houghton CLA 2011-04-07 11:34:12 EDT
I added this bug for consideration to the 3.7 Polish wiki (http://wiki.eclipse.org/Polish3.7).
Comment 4 Curtis Windatt CLA 2011-04-07 11:40:46 EDT
Consider for M7 or RC1
Comment 5 Ankur Sharma CLA 2011-05-02 17:45:24 EDT
Created attachment 194544 [details]
Patch

Curtis, plz review the patch. The warning message might need rewording.
Comment 6 Curtis Windatt CLA 2011-05-04 16:45:11 EDT
+1 Fixed in HEAD.

I did change the warning to the following, let me know if there are any problems with it:

The product ID should not match the defining plug-in's ID.  This product will not export correctly.
Comment 7 Jeff McAffer CLA 2011-05-05 16:49:29 EDT
Note that the product id should not match the id of ANY bundle. (really any IU but most people will not have random IUs hanging around).  Comment 0 could have been clearer on that but...
Comment 8 Curtis Windatt CLA 2011-05-06 11:08:35 EDT
(In reply to comment #7)
> Note that the product id should not match the id of ANY bundle. (really any IU
> but most people will not have random IUs hanging around).  Comment 0 could have
> been clearer on that but...

Does the export fail when it matches any ID?  I believe Ankur had trouble reproducing until he matched the defining plug-in's ID.
Comment 9 Jeff McAffer CLA 2011-05-06 15:56:57 EDT
The export might succeed but the resultant repo will either have two IU (one for the product and one for the bundle) or (if the versions are the same) there may be only one.

try exporting a product that has in it another bundle with the same id as the product.  Taht is, put the .product file for "bar" in budnle "foo" but also have a "bar" bundle as part of the product.  that should cause the problem too.
Comment 10 Curtis Windatt CLA 2011-05-06 16:50:25 EDT
Ankur, do you think we should reopen this and expand it for 3.7 or open a new bug to improve it in 3.8?
Comment 11 Ankur Sharma CLA 2011-05-08 02:36:32 EDT
We can not fix it all in 3.7. I will see if a smaller patch can issue the warning after checking for all the plug-ins.

Work better done in 3.8 would be to investigate what happens when 
1. the ID matches that of a feature
2. the product config is feature based and then a product Id matches with some plug-in
3. these problem exists and the product is build headlessly.

However, the best way to fix it will be to successfully build the repo even when the IDs match.
Comment 12 Jeff McAffer CLA 2011-05-08 20:55:52 EDT
The current fix is a step ahead for sure.  There should however be something left open for 3.8 consideration.  Some notes on your points in comment #11

> 1. the ID matches that of a feature

This will not happen as the IUs representing features are published with .feature.group appended to the feature id.  Basically for the same reason, the feature and bundle namespaces are distinct but in p2 there is no way to capture that.

> 2. the product config is feature based and then a product Id matches with some
> plug-in

Yup
> 3. these problem exists and the product is build headlessly.
Yup.  The point of having the editor flag it is so that people cannot author a product definition that has the problem. This would largely avoid the problem.

> However, the best way to fix it will be to successfully build the repo even
> when the IDs match.

The IU id must be unique.  In theory an approach similar to that taken with features could be used.  For example publishing products with some suffix (eg .product).  Would have to talk to the p2 team to see what impact if any that would have.
Comment 13 Ankur Sharma CLA 2011-05-16 15:28:37 EDT
Verified in I20110512-2000

Opened Bug 345996 for tracking remaining work in 3.8