Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Usage of 'useFeatures' attribute in p2 product files

As I mentioned above, I completely agree, we should be able to craft projects with plugins and features.  However, we can't simply ignore the 'useFeatures' at the p2 level.

The reason is that in PDE if you create a product with 'plugins' and add X,Y,Z, then change to a product with 'features' and add A, B, C, the current serialization mechanism will write out plugins: X, Y, Z, AND features: A, B, C with useFeatures=true [1]. If we ignore the useFeature attribute then our behaviour will be different from PDE/Build and PDE/UI. (Not to mention it will be a breaking change with existing users).

If this is really going to change I think we have to architect this across PDE and p2. 

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=312086

I quickly searched bugzilla and I don't see a bug request for this, so feel free to file one.  I'm not sure if this particular request is on anybodies high priority list, but if you're willing to help out with some patches I'm sure we can make some progress here.

Cheers
Ian

On Fri, Aug 27, 2010 at 12:26 AM, Yousouf, Shenol <s.yousouf@xxxxxxx> wrote:

Hi,

 

Thank you for your answer !

 

Well, fact is that I am creating the .product file manually J (in xml editor) and then run the Product Publisher application from the IDE, passing the file as an argument.

                                                                                                                                                                                                                                                        

Still, the reason for introducing this restriction is entirely unclear to me. Furthermore, its logic extends from the PDE editors to the product publisher as well, as I pointed out below.

 

From a technical point of view, the p2 infrastructure is well prepared to handle such kind of “mixed” products and, if I am not wrong, the publisher needs only a small adjustment in its code to be able to define them (maybe at the cost of discarding the ‘useFeatures’ attribute which, of course, would be an incompatible change but I am sure that we can easily arrive at a more subtle solution). In that sense, this enforcement seems to be quite artificial and unnecessary to me. In fact, I would go as far as to classify it as a bug – there are no technical obstacles to install product IUs which list both features and plugins as their requirements but the infrastructure does not allow you to define them. Let me know if I am making a mistake here !

 

Best regards,

Shenol Yousouf

SAP Labs Bulgaria

 

From: p2-dev-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] On Behalf Of Ian Bull
Sent: Thursday, August 26, 2010 9:37 PM
To: P2 developer discussions
Subject: Re: [p2-dev] Usage of 'useFeatures' attribute in p2 product files

 

How are you defining a product with *both* bundles and features? This behaviour is because the PDE Product Editors (which is the only "API" way to define product files) enforces this.  That is, a product is made up of features XOR plugins.

 

FWIW, I agree, it would be nice to define a product with both features and plugins, but this isn't supported yet by the PDE.

 

cheers,

ian

On Thu, Aug 26, 2010 at 9:04 AM, Yousouf, Shenol <s.yousouf@xxxxxxx> wrote:

Hi all,

 

Recently, I had to build a product consisting of bundles only and was quite surprised to see that the described bundles were not included as requirements of the result product IU, published in the target p2 repository. After a debug session I found out that the “problem” was caused by the ‘useFeatures’ attribute in the .product file. It turns out that no bundles are considered as requirements of the product IU as long as the value of this attribute is “true”, even if there are such bundles described in the product file.

 

The interesting point for me here is the way this attribute’s value is interpreted (the programming logic can be found in org.eclipse.equinox.p2.publisher.eclipse.ProductAction.createRootAdvice(), as a reference):

  • If ‘useFeatures’ is “true” then only the features described in the product file are included into the product; described bundles, if any, are ignored
  • If ‘useFeatures’ is “false” then only the bundles described in the product file are included into the product; described features, if any, are ignored
  • If the attribute is not defined in the .product file then its value is assumed to be “false” and we arrive at the case above

 

So it seems to me that there is no feasible way to publish both features and plugins in the same product. So far, I couldn’t find any meaningful documentation about the attribute’s semantics (aside from the javadoc for IProductDescriptor.useFeatures() which simply says that this flag “Specifies whether this product was built using features or not ) to understand why it is so and whether it is intentional. Can anybody explain what is the rationale behind this behavior ?

 

Thanks and regards,

Shenny

 


_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev




--
R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource


_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev




--
R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource

Back to the top