Community
Participate
Working Groups
Version: 4.2.0 (for M4) Getting a simple RCP product to launch is somewhat complicated in 4.2. With Platform-UI now being based on EMF, RCP apps can no longer simply include the Platform RCP feature (org.eclipse.rcp) and expect things to work. Part of the problem is that the two Platform UI RCP features (org.eclipse.rcp and org.eclipse.e4.rcp) are a bit broken (see bug 362147). But even once those features are restructured, we have some difficulties as these features rely on EMF, but at the request of the EMF team (see bug 356644) these must be expressed as feature dependencies, not inclusions, and so are not automatically pulled in. I have also seen other RCP apps using dependencies to pull in things like p2. It would be helpful if the PDE Product editor's "Dependencies" tab had a button to "Add Required Features" that would trawl the feature dependencies. Something like the Feature editor's computed feature dependencies.
Actually, I think the product editor should be including the required features. p2 seems to do the right thing.
This bug is hunting me for years now, without me being able to reproduce it. Thanks for nailing it down!
This impacts the ability to launch products in 4.2, needs investigation.
There are two solutions here: 1) Add a 'add required features' button to the editor. The user would have to recognize that some dependencies were not satisfied and use the button to add what was missing. 2) When using a feature based product editor, the launch button would create a launch configuration that used a feature based launch configuration. The feature based launch configs calculate any missing dependencies and add them to the launched bundles. Solution (1) is more in line with how the product editor is expected to work. When using a plug-in based product, users want strict control over what is included in their product. Solution (2) makes it easier for users to launch (and export assuming we fixed that as well), but the user would no longer have control over what features/bundles their product ended up containing.
@Curtis: I think the desired solution would be: 3.)If the launch configuration is updated via the product, it checks if a feature is defined as dependent in another feature and adds the included plug-ins in the dependent feature to the launch configuration. This means also to happen during product export.
(In reply to comment #5) > @Curtis: I think the desired solution would be: > > 3.)If the launch configuration is updated via the product, it checks if a > feature is defined as dependent in another feature and adds the included > plug-ins in the dependent feature to the launch configuration. > > This means also to happen during product export. To me this sounds like the worst of both (1) and (2). The user creating the product would have no control over what bundles end up in their target and we would have to try to make a complete list of required bundles each time we update the product (feature based launches handle this much better).
Created attachment 211529 [details] Patch to cause feature-based products to create feature-based launches The attached patch modifies org.eclipse.pde.internal.ui.launcher.LaunchAction to create a feature-based launch configuration for feature-based products. I didn't see anywhere for tests? (It also includes a minor optimization to FeatureModelManager.findFeatureModel() to avoid doing a lookup on empty version string.)
@Curtis: Thanks for the explanation, I just assumed that doing this is much faster then changing to feature based runtime configuration. I didn't know that Brian would be that fast. :-)
Created attachment 211814 [details] Alternative approach to populate bundle list by processing imported (required) features From talking to Curtis on IRC, one concern about creating a feature-based launcher is that the feature launcher's behaviour of automatically adding required features may not match the result produced by a product builder. This patch instead just fixes the current behaviour to also include the plugins required by any imported features.
*** Bug 278431 has been marked as a duplicate of this bug. ***
I have pushed a fix to master that adds an Add Required button to the feature based product editor. This combined with the validate button in the toolbar should make it easier for users to add the requirements they are missing. (In reply to comment #9) > This patch instead just fixes the current behaviour to also include the plugins > required by any imported features. This approach still goes against my main concern with changing the launch type. The patch bring in new things to the launch that aren't specified in the product configuration. PDE assumes that the user creating the product configuration wants strict control over what goes into the product. I am closing this as fixed, but I would appreciate feedback from Brian and Lars. Brian's first patch is great for simplifying the launch, but it goes against the assumptions we make about the user.
@Curtis: Personally I like the solution. This would have the launch config consistent with the product export. Only briefly related it that I would like to see that the "Validate" flag is enabled per default, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=272076. This might also help to identify issues with feature based products. I also feel that the performance overhead is relatively small and Exports could disable it.
@Curis: One additional point: I think that creating a feature based launch config would be consistent with the product definition. Perhaps you can use a modified version of Brians Feature patch (without adding the dependent feature automatically)?
(In reply to comment #13) > @Curis: One additional point: I think that creating a feature based launch > config would be consistent with the product definition. Perhaps you can use a > modified version of Brians Feature patch (without adding the dependent feature > automatically)? The feature based launch always drags in additional dependencies, that is its primary selling point. Clearly the feature launch logically matches up with a feature based product. However, there is currently no way to have a feature launch config results match the export results. At this point I can't commit to working on fixing that. An alternative would be to look at a product based config (bug 326059) that would do a much better job keeping in sync.
I'm fine with Curtis' solution. Thank you for doing it, Curtis. I'll note that a p2-based builds deviate from traditional PDE/Build and the export functions in that p2 does install dependent features and bundles — the product-specified IUs are roots to be installed, and not the limited set to be installed. I've opened bug 373089 to document this — it seems important information.
Just tested this in the latest integration build. Works well! @Curtis: Thanks a lot for this enhancement
Verified Version: 4.2.0 Build id: I20120313-0610
If I press "Add required" in the current build the number of included features changes. See screenshots
Created attachment 212653 [details] Screenshot
Created attachment 212654 [details] Screenshot after pressing add required again
Created attachment 212655 [details] Example project to test
I think this is a separate bug. Typically I cannot reproduce the problem, the correct required bundles are added and pressing the button additional times changes nothing. However, occasionally I get in a situation where pressing 'add required' or other buttons removes some of the entries. In this case if I keep pressing the button I will eventually end up with nothing in the table.
There is a problem with the button switch statement missing a break. This means that if you have a selection and hit add required you also delete the selection. I have pushed a fix for this. However, I have on occasion seen other similar problems in the product editor. Cases where the table and backing product model get out of synch so adding/removing doesn't do what you expect. Closing and reopening the editor solves the issue. I've never come up with a reproducible test case though, so if my fix for the switch doesn't solve your issue, let me know what your steps are.
Thanks Curtis, the included features seem stable to me now. I noticed that org.eclipse.e4.rcp is included if I press "Add Required" features. I don't think it is required, if I delete it the product still starts. I attached a new example for you to look at.
Created attachment 212826 [details] Example Project
(In reply to comment #24) > I noticed that org.eclipse.e4.rcp is included if I press "Add Required" > features. I don't think it is required, if I delete it the product still > starts. If you're running on 4.2, then org.eclipse.e4.rcp *is* required. Take a look at the org.eclipse.rcp definition: it hardly includes any bundles.
@Brian: Why doesn't the start fail, if I don't include it?
(In reply to comment #27) > @Brian: Why doesn't the start fail, if I don't include it? Possibly because you already have a launch configuration that had the appropriate bundles already present? And possibly that configuration was feature-based? I just tested that the e4 contacts demo, which only included org.eclipse.e4.rcp and org.eclipse.e4.demo.contacts.feature, fails to start as the EMF features weren't listed. Adding the two EMF features with "Add Required" allows the product to be launched. (Now fixed in the repo.)
@Brian: We might be talking different things here. My last example in this bug is an Eclipse 3.x app running in comp layer. As far as I know org.eclipse.rcp has be upgraded to support this without adding the org.eclipse.e4.rcp feature. For the missing EMF features in org.eclipse.rcp I have opened Bug 372373.
The add required action is searching for both feature dependencies and feature includes. While org.eclipse.rcp doesn't depend on org.eclipse.e4.rcp, it does include it. We assume that if it is included in a feature in your product you would want it exported as well.
Thanks Curtis for the clarification. Please close this bug again.
(In reply to comment #31) > Thanks Curtis for the clarification. Please close this bug again. Closing.