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

Bug 210529

Summary: [update] Error installing examples with p2-provisioned SDK
Product: [Eclipse Project] PDE Reporter: John Arthorne <john.arthorne>
Component: UIAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, daniel_megert, darin.eclipse, dj.houghton, overholt, pascal
Version: 3.4   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
log file
none
Draft fix
none
Draft fix v2
none
Fix v3 none

Description John Arthorne CLA 2007-11-21 08:54:33 EST
This will likely end up being a bug for UA team, but logging it here for now. If you try to install the examples from the Welcome page in a p2-provisioned SDK, an error occurs. I assume welcome is calling update.core APIs, so this may be a good test case for backwards compatibility support. The only entry in the log is:

!ENTRY org.eclipse.update.core 4 0 2007-11-21 08:47:43.375
!MESSAGE Cannot install featureorg.eclipse.sdk.samples 3.3.0
Comment 1 Pascal Rapicault CLA 2007-11-29 22:36:41 EST
I'm a bit surprised since I have not seen any dependency update from these plugins.
Comment 2 John Arthorne CLA 2007-12-11 23:17:48 EST
The code is in org.eclipse.pde.internal.ui.samples.ShowSampleAction#downloadFeature(). It uses update.core command API.
Comment 3 Pascal Rapicault CLA 2007-12-12 09:59:51 EST
Doh, I had ignored PDE dependencies on update thinking they were only related to the management of targets.
Comment 4 Pascal Rapicault CLA 2008-01-20 16:37:53 EST
Given that the SDK will ship with both p2 and update manager, this is not an issue. We just need to make sure that everything works properly.
Comment 5 John Arthorne CLA 2008-01-20 23:21:21 EST
If we want the SDK to be able to run with only p2, we may need some small facade API that delegates to either p2 or UM depending on which one is available.
Comment 6 Pascal Rapicault CLA 2008-01-21 21:49:36 EST
As discussed during today's meeting, supporting a p2 only mode for the SDK is not on the plan for 3.4.
Comment 7 Simon Kaegi CLA 2008-02-07 09:52:59 EST
(In reply to comment #6)
> As discussed during today's meeting, supporting a p2 only mode for the SDK is
> not on the plan for 3.4.

Can we mark Invalid?
Comment 8 Pascal Rapicault CLA 2008-09-08 21:45:54 EDT
Need to revise as part of the effort to get rid of UM.
Comment 9 DJ Houghton CLA 2009-02-19 15:08:26 EST
Created attachment 126210 [details]
log file

Attached is the log file from installing the tools in build I20090217-2200. (note classic Update Manager is available)
Comment 10 DJ Houghton CLA 2009-04-14 11:45:25 EDT
What is happening is that the PDE/UI Sample Action code is installing the sample bundles via the old Update Manager APIs. This is going out and downloading the bundle/feature, putting them in the plugins/ and features/ directories, updating the platform.xml file, and basically performing a dynamic install. It calls the operation code which in turn calls code on the update.configurator activator to perform a reconciliation when the download is complete. Then the PDE code calls "apply changes now" and things continue after the new code has been installed.

The JARs are downloaded and put in the plugins and features directories and execution is allowed to continue and the samples seem to work ok. But there are a couple of problems with this scenario if p2 is being used to manage the system. 

The main problem here is that since p2 wasn't used to install the samples, the bundles.info and profile files aren't updated with the new installation information. On the next restart, the p2 reconciler should discover the new JARs and try to install them into the running system (which may or may not work depending on if all dependency requirements are met).

If execution is allowed to continue before p2 can officially install the samples, then this can lead to confusing circumstances for the user. Basically any p2 operations that happen from this point forward will not take the samples into consideration. Thus if the user tries to install Feature Foo which depends on the samples, then p2 will not allow this although the user will think "hey, I just installed the samples so it should be there!".

Pascal and I talked about this and decided that we won't be making any changes on the update manager/p2 side of things. The client is calling the Update Manager APIs and should be changed to call p2 APIs. 

Clearing milestone. We don't feel this is a necessity for 3.5.
Comment 11 John Arthorne CLA 2010-03-31 17:36:18 EDT
*** Bug 278958 has been marked as a duplicate of this bug. ***
Comment 12 John Arthorne CLA 2010-03-31 17:44:27 EDT
Created attachment 163589 [details]
Draft fix

I am interested in fixing this, since it is the only surviving reference to legacy Update Manager in the Eclipse SDK. With this fixed we should be able to run the SDK entirely without Update Manager (leaving only update.configurator).
Comment 13 John Arthorne CLA 2010-03-31 18:09:26 EDT
Created attachment 163590 [details]
Draft fix v2
Comment 14 John Arthorne CLA 2010-04-01 15:01:24 EDT
Created attachment 163666 [details]
Fix v3

This patch is ready for review. It does three things:

1) Changes ShowSampleAction to use p2 API to install the sample feature, rather than Update Manager API. Note that if you run this in a test workbench it will download the samples, but applying the configuration does not work. This is an artifact of self hosting - I exported this patch into a nightly build and the samples were installed and configured correctly.

2) ShowDescriptionAction was using a utility method from update core in order to create a temp working directory. I have just copied this convenience method into PDE to avoid referencing update (Utilities class copied from update and trimmed down).

3) Remove org.eclipse.update.core from the manifest imports (yay!)
Comment 15 Chris Aniszczyk CLA 2010-04-01 17:30:27 EDT
Thanks John, made some minor changes.

> 20100401
Comment 16 Curtis Windatt CLA 2013-01-21 11:31:59 EST
*** Bug 279813 has been marked as a duplicate of this bug. ***