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

Bug 248181

Summary: [planner] Feature patch not installed from Software Updates if feature installed from extension location (links)
Product: [Eclipse Project] Equinox Reporter: Tom Tabanao <tomt>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: pascal
Version: 3.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Extension location and projects to build feature patch none

Description Tom Tabanao CLA 2008-09-22 14:22:05 EDT
Created attachment 113174 [details]
Extension location and projects to build feature patch

Build id: I20080617-2000

Steps to reproduce:

1) Start with a clean Eclipse 3.4 SDK install
2) Unzip attached waldo_feature.zip
3) Create a *.link file to the "waldo_feature" directory
4) Launch Eclipse
5) Verify that two buttons appear in the toolbar
   - Each button is backed by a "Hello, world" plug-in, com.foobar.baz 1.0.0 and com.foobar.qux 1.0.0
5) Import projects from the "waldo_projects" directory into the workspace
   - "waldo_projects" contains 1.0.1 versions of baz & qux with slightly different dialog text
6) Open site.xml in the "com.foobar.waldo.updates" project and build the feature patch
7) Open "Help > Software Updates > Available Software"
8) Add a new local site and point it at the "com.foobar.waldo.updates" project
9) Install the feature patch and restart
10) Observe that the feature patch and new plug-ins were not installed
   - Button dialog text remains the same and About menu does not list new plug-ins

I spent some time tracing through the p2 source and I observed a few things:

* When resolving entries in the "links" directory, ProfileSynchronizer.createProfileChangeRequest() installs all features and bundles and creates IU profile properties for each, marking them as optional.  These properties are persisted in the SDK profile.

* When the feature patch is installed, SimplePlanner.updatePlannerInfo() collects all IUs with inclusion rules.  This includes the dropin bundles that were saved with the OPTIONAL property in the profile.  These IUs are then added as optional requirements for the main feature patch IU.

* From all of the optional requirements, Projector generates an .opb file with optionality expressions for each of the dropin-installed bundles as well as the feature patch bundles.

* sat4j satisfies the min function by choosing the existing (dropin) IUs rather than the IUs comprising the feature patch.

* When SimplePlanner.generateProvisioningPlan() compares the old and new states, there is no change, and thus the iuOperands array is empty and nothing is installed.

Other things I've observed:

* If the feature patch contains only one plug-in, the feature patch and plug-in are installed.  Two plugins (as demonstrated here) doesn't work.

* If the original version of the bundles are installed via the Sofware Updates menu (by adding a new local site that points at the "waldo_features" dir), the feature patch will install as expected.  When I looked at the profile file after installing the feature this way, I noticed that only the feature had iu properties and thus the plug-ins were not included as optional requirements when installing the feature patch.

* If the jars created by the update site project are unpacked and placed in the "dropins" directory, the feature patch will also be installed correctly.

The symptoms here sound similar to bug 235156, however it doesn't sound like the cause is the same, so I'm not sure if it's applicable.
Comment 1 Pascal Rapicault CLA 2008-11-25 15:38:53 EST

*** This bug has been marked as a duplicate of bug 254481 ***