Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 235156 - Update does not work with extension location
Summary: Update does not work with extension location
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC4   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-02 11:04 EDT by Michael Scharf CLA
Modified: 2008-06-06 20:30 EDT (History)
3 users (show)

See Also:
john.arthorne: review+
pascal: review+
tjwatson: review+
dj.houghton: review+


Attachments
Attempt at fixing the problem (1.21 KB, patch)
2008-06-02 22:34 EDT, Pascal Rapicault CLA
no flags Details | Diff
patch (1.69 KB, patch)
2008-06-03 13:50 EDT, DJ Houghton CLA
no flags Details | Diff
Patch removing the locked property (1.14 KB, patch)
2008-06-05 10:22 EDT, Pascal Rapicault CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2008-06-02 11:04:13 EDT
With 3.4RC3:
- I have mylyin in an extension location using a link file
- I update
-> The new plugins are not used
Comment 1 Michael Scharf CLA 2008-06-02 11:06:02 EDT
for a flash demo see:
  http://scharf.gr/eclipse/bugs/Bug_235156/
Comment 2 Pascal Rapicault CLA 2008-06-02 22:26:23 EDT
I think this is a recent regression that has likely been introduced when we changed the code that computes the provisioning plan (bug 234186).

What happens is as follow:
- user installs GEF in the dropins, the roots gets marked as "installed from dropins".
- user updates GEF from the ganymede update site. A new version gets downloaded and installed. During this process the new IUs are installed as updates of the original one. Therefore the IU properties get transfered to the new IUs. So the IUs that the user installed get marked as "installed from dropins" where in reality they have been explicitly installed.
- next restart, the dropins kicks and believes that the new version of GEF that the user installed is something that got installed by the dropins (since it has the property) and therefore it gets removed since it does not appear in the repository we are synchronizing with.
Comment 3 Pascal Rapicault CLA 2008-06-02 22:34:10 EDT
Created attachment 103242 [details]
Attempt at fixing the problem

I have hacked this up and with it, I can confirm that the update of GEF stays around. The logic behind the patch is that something that has been installed by the dropins can only have as valid IU Properties the combination "installed from dropins" and "optional". 
Therefore in case where the "dropins" property is detected and the install mode is "Strict", it means that something else installed this new copy and therefore the "dropins" property can be removed.

Obviously this does not handle more complex scenario where GEF would be updated as part of another upgrade with flexible dependencies (e.g. GMF depending loosely on GEF) but still handle a large number of scenario.

This problem is unfortunately important since it means that we will not be able to update the EPP packages since they are created from a dropins operation :-(
Comment 4 DJ Houghton CLA 2008-06-03 13:50:17 EDT
Created attachment 103378 [details]
patch

Updated patch... same code just added comments describing the problem.

Pascal and I talked about this and we believe that it is the best solution at this point in time.

The case that it doesn't handle 100% is where the features contain non-singleton or differing bundles. Consider the following:
- Feature FFF v1.0 contains bundle BBB
- Feature FFF v2.0 contains bundle CCC

Scenario is as follows:
- If you drop FFF v1.0 into the dropins, then FFF and BB get installed. 
- Then if you do an update, we install FFF v2.0 and CCC. 
- In the ProfileSynchronizer we detect that FFF v2.0 was installed from the UI but it also has the "from dropins" property on it so we remove that property.
- FFF v1.0 is uninstalled because it is optional (default attribute when coming from the dropins)
- BBB is NOT uninstalled: this is the problem

The problem stems from the fact that we install everything and Classic Update Manager had features as its installable unit. We discussed this and feel that it is something we can live with for 1.0.
Comment 5 DJ Houghton CLA 2008-06-03 13:52:07 EDT
Adding John and Pascal as Component Lead and Reviewers as per the 3.4 endgame plan.
Comment 6 DJ Houghton CLA 2008-06-03 14:00:22 EDT
Adding Boris as additional component lead.
Comment 7 Pascal Rapicault CLA 2008-06-04 11:48:10 EDT
cc'ing Tom as component lead.
Comment 8 Thomas Watson CLA 2008-06-04 15:23:39 EDT
+1 to fixing this in 3.4.0.  I will depend on the review of Pascal and John as to the correct fix since I am not familiar with the code.

I am wandering if there are constants somewhere for the strings "STRICT" and "org.eclipse.equinox.p2.internal.inclusion.rules".  If not then you should mark these with $NON-NLS tags at least.
Comment 9 Pascal Rapicault CLA 2008-06-04 15:38:49 EDT
I have already reviewed the patch, but it seems that this has somewhat been lost.
Comment 10 Thomas Watson CLA 2008-06-04 15:56:53 EDT
Try it again Pascal, I may have +'ed the wrong name.
Comment 11 John Arthorne CLA 2008-06-04 16:05:26 EDT
+1. I verified by adding an old version of RSE in my dropins. I was able to upgrade to the new version in the Ganymede repository and the new version was running after restart.
Comment 12 Pascal Rapicault CLA 2008-06-04 16:39:18 EDT
Released.
Comment 13 John Arthorne CLA 2008-06-04 17:41:39 EDT
Reopening. There is still a problem here. We also need to remove the PROP_PROFILE_LOCKED_IU property in this case. Otherwise, I can never uninstall the thing that I upgraded. I.e., to test the patch I installed something in dropins, then upgraded with p2. This worked, but now there is no way to uninstall the upgraded feature.
Comment 14 Pascal Rapicault CLA 2008-06-05 10:22:09 EDT
Created attachment 103737 [details]
Patch removing the locked property
Comment 15 Pascal Rapicault CLA 2008-06-05 10:22:49 EDT
John, Tom, DJ, please review.
Comment 16 Thomas Watson CLA 2008-06-05 10:46:39 EDT
+1 to fixing this.
Comment 17 John Arthorne CLA 2008-06-05 11:51:07 EDT
+1. I retested with the latest patch, and I am able to upgrade features from dropins, and then uninstall the upgrade and revert to the version from dropins. The lock property is correctly added back when I revert to the version in dropins.
Comment 18 John Arthorne CLA 2008-06-05 11:52:03 EDT
Released.
Comment 19 Michael Scharf CLA 2008-06-06 20:30:16 EDT
Thanks for the fix! It works now.