Bug 250126 - [p2] Use p2 to provision for launching, support self-hosting
Summary: [p2] Use p2 to provision for launching, support self-hosting
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.6 M3   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 253658 269288 (view as bug list)
Depends on: 291873
Blocks: 236719 293194 294215
  Show dependency tree
 
Reported: 2008-10-08 13:00 EDT by Curtis Windatt CLA
Modified: 2013-11-10 22:32 EST (History)
13 users (show)

See Also:


Attachments
Work in progress (13.15 KB, patch)
2009-10-20 16:41 EDT, Curtis Windatt CLA
curtis.windatt.public: iplog+
Details | Diff
mylyn/context/zip (117.04 KB, application/octet-stream)
2009-10-20 16:41 EDT, Curtis Windatt CLA
no flags Details
Fix (17.83 KB, patch)
2009-10-22 16:42 EDT, Curtis Windatt CLA
no flags Details | Diff
Updated fix (26.35 KB, patch)
2009-10-23 12:23 EDT, Curtis Windatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2008-10-08 13:00:21 EDT
Some discussion on bug 236719.

Currently when self-hosting (launching an Eclipse workbench from host) there is no p2 profile available.  This means that p2 code that interacts with the profile (installing, updating, introspecting, etc.) does not function when self-hosting.

If PDE can provision a profile during launch, p2 self-hosting should be possible.  It will also allow PDE to use p2 to setup config.ini/bundles.info and other files, rather than having duplicating code.

One major area of concern will be backwards compatibility.  In PDE, users want to be able to build against and launch previous versions of Eclipse (based on the contents of the target platform).  If we are using p2 to generate the configuration information, p2 may need to be provision in a backwards compatible way.
Comment 1 Curtis Windatt CLA 2008-10-08 13:03:05 EDT
Will start investigating this in M3.
Comment 2 Chris Aniszczyk CLA 2008-10-08 15:27:32 EDT
We could also help p2 work with older runtimes.

This is one solution to the backwards compatibility problem.
Comment 3 Curtis Windatt CLA 2008-11-04 10:09:22 EST
*** Bug 253658 has been marked as a duplicate of this bug. ***
Comment 4 Chris Aniszczyk CLA 2009-01-24 19:24:18 EST
We aren't there for M5 yet... moving to M6
Comment 5 Curtis Windatt CLA 2009-03-10 18:17:09 EDT
With the new target platform story, the best way to move forward with this may be to create an entirely new launch type.  This launch type would require a fully provisioned target to launch.  In any case this isn't going to happen in M6, and will likely not be done for 3.5.
Comment 6 Tim deBoer CLA 2009-04-07 18:03:19 EDT
*** Bug 269288 has been marked as a duplicate of this bug. ***
Comment 7 Curtis Windatt CLA 2009-10-20 16:19:39 EDT
This is part of the plan for 3.6.

The plan is to create a profile during the launch and install into that profile metadata for all the plug-ins being launched.
Comment 8 Curtis Windatt CLA 2009-10-20 16:34:48 EDT
A couple issues encountered so far:

1) I have had to create my own profile registry instance so that the created profile is persisted in a place where the launched config will find it.  This also prevents me from using api methods from the engine, as those methods require the profile to be valid in the standard profile registry.

Pascal suggested that some of the work to have multiple instances of p2 running in the same VM could help this case.

2) PDE recreates all the configuration data on a restart.  Recreating the profile on a restart will prevent some of the benefits of have a profile to test with.  There are likely other issues working with a spoofed up profile.  Will have to collect the most wanted use cases on the mailing list.

3) Noticed something odd about when we add the p2 data area that might explain bug 291783.  We often don't end up setting the data area property at all.  We need a specific data area so the spoofed profile gets found.
Comment 9 Curtis Windatt CLA 2009-10-20 16:41:38 EDT
Created attachment 150028 [details]
Work in progress

This patch successfully creates a profile with metadata from the launched plug-ins.  The profile is set as the default profile in the launched workbench and can be modified.
Comment 10 Curtis Windatt CLA 2009-10-20 16:41:43 EDT
Created attachment 150029 [details]
mylyn/context/zip
Comment 11 Curtis Windatt CLA 2009-10-22 16:42:48 EDT
Created attachment 150309 [details]
Fix

This fix could arguably be ready enough to go in for M3.  There are a couple of issues to consider:

1) The UI text calls it a 'P2 Profile'.  We don't use p2 elsewhere in the UI.

2) It doesn't work when launching with a 3.4 target.  The profile isn't found.
Comment 12 Curtis Windatt CLA 2009-10-23 12:23:27 EDT
Created attachment 150386 [details]
Updated fix

Updates the UI text, cleans up some code, adds javadoc
Comment 13 Curtis Windatt CLA 2009-10-23 12:24:55 EDT
Applied latest path to HEAD.
Comment 14 Chris Aniszczyk CLA 2009-10-23 12:32:28 EDT
What happens with p2.inf files and this?
Comment 15 Curtis Windatt CLA 2009-10-23 12:43:35 EDT
(In reply to comment #14)
> What happens with p2.inf files and this?

I believe the metadata generation happens before the p2.inf files would be considered.  The metadata generation doesn't consider the p2.inf.
Comment 16 John Arthorne CLA 2009-11-03 16:24:07 EST
(In reply to comment #8)
> A couple issues encountered so far:
> 
> 1) I have had to create my own profile registry instance so that the created
> profile is persisted in a place where the launched config will find it.  This
> also prevents me from using api methods from the engine, as those methods
> require the profile to be valid in the standard profile registry.
> 
> Pascal suggested that some of the work to have multiple instances of p2 running
> in the same VM could help this case.

This should now be possible. The basic API was in M3, but the fully functioning code is in the p2 API work branch. You can now instantiate an agent on an arbitrary location and obtain whatever services you need from that location (profile registry, etc). There is some documentation on this here:

http://wiki.eclipse.org/Equinox/p2/Multiple_Agents
Comment 17 Chris Aniszczyk CLA 2009-11-03 17:20:07 EST
(In reply to comment #16)
> http://wiki.eclipse.org/Equinox/p2/Multiple_Agents

I <3 you John.

I can now implement my dream of a global target bundle pool.

The question is where to store it... thinking the user home directory... .eclipsetarget
Comment 18 Jeff McAffer CLA 2009-11-04 07:36:41 EST
that would be very cool.  would be good to put it at ~/.eclipse/target or something.  that is, not cluttering the user's home dir.  We already have an "eclipse place".

Great news on the self hosting...