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

Bug 249352

Summary: core.runtime missing start level when platform feature not included
Product: [Eclipse Project] Equinox Reporter: Andrew Niefer <aniefer>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: richard.gronback
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Andrew Niefer CLA 2008-10-01 13:27:33 EDT
Extracted from bug 237662:

I'm using 3.4.1 and still getting the wrong settings generated in bundles.info
for *.core.runtime:

org.eclipse.core.runtime,3.4.0.v20080512,file:plugins/org.eclipse.core.runtime_3.4.0.v20080512.jar,4,false

I use the 3.4.1 SDK with the delta pack extracted onto it as my director (it
also serves as my basebuilder).

bug 237662 Comment  #10 From Richard Gronback  2008-10-01 08:44:37 -0400  
I think I can narrow this down a bit...  I have 2 product-based builds in the
Amalgam project, both of which are feature-based.  One is a lightweight
'Modeler', the other a 'DSL Toolkit'.  

The Modeler product definition includes the org.eclipse.platform feature and
produces a proper bundles.info file.  

The DSL Toolkit includes the JDT and PDE features, but does not declare
org.eclipse.platform as an included feature. This causes the generation of a
faulty bundles.info discussed above.  

When I explicitly add the org.eclipse.platform feature to the DSL Toolkit
product definition, all is well (so, I'm leaving it there, obviously).  If it
helps, the scripts and product definitions I use are found here:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.amalgam/releng/org.eclipse.amalgam.releng/?root=Modeling_Project
Comment 1 Andrew Niefer CLA 2008-10-01 16:44:59 EDT
I'm not convinced there is really a bug here in p2, the explanation I have is as follows:

1) The org.eclipse.jdt feature does not include org.eclipse.platform, it requires it.
2) Metadata generation is performed on those bundles assembled/packaged by PDE/Build.
3) PDE/Build only assembles/packages included features, not required features.


Therefore, in absence of another feature including org.eclipse.platform (in your case the generated container feature when you add it to the .product file), none of the bundles under org.eclipse.platform will get metadata generated for them.

The resulting metadata repo, by itself, does not contain enough IUs to actually install the product.  Your director calls were likely only working by virtue of bug 241430, where the director is also considering repos known in the preferences (eclipse ships with Ganymede repos prepopulated in the preferences: configuration/.settings/org.eclipse.equinox.p2.*.prefs)

In this case, the director is then finding the required IUs on the galileo site and using them.  However, configuration IUs which set the start levels are required by the product IU and the dsltk product IU does not require them (because of 1,2,3 above).  Therefore, the install can pick up the missing IUs, but doesn't get any special configuration for them.


If there are any suggestions as to what p2 or PDE/Build can do to help in this situation, I can consider them.  Otherwise we can close this as invalid.
Comment 2 Andrew Niefer CLA 2008-10-01 16:49:17 EDT
(I am getting releases mixed up, obviously paragraph 5 above refers to Ganymede, not Galileo).
Comment 3 Richard Gronback CLA 2008-10-01 16:56:29 EDT
It may very well be invalid.  But first, what is the last argument do, and when would having it false for org.eclipse.core.runtime be a valid condition?
Comment 4 Andrew Niefer CLA 2008-10-01 18:41:40 EDT
False means don't start the bundle.
This is the default for all bundles that don't have start level information explicitly associated with them.  It is set by the "tooling.osgi.bundle.default" IU that is required by your product IU.

Most such bundles (including org.eclipse.core.runtime) are marked as Bundle-ActivationPolicy: lazy.  Meaning they will be started the first time someone loads a class from them.


Valid configurations where org.eclipse.core.runtime would not be started would include configurations that are more "equinox" as opposed to "eclipse".  
- Configurations that don't use the default ApplicationLauncher service setup.  They may run without an application and be more of a server than can install/uninstall and start and stop applications on demand.
- Configurations that don't use the eclipse registry for application discovery and instead register ParameterizedRunnable services directly.
- And generally, applications that don't use the eclipse registry at all and just use osgi services.


I did find a problem here in pde/build and I raised bug 249411.
Comment 5 Richard Gronback CLA 2008-10-03 16:09:20 EDT
FWIW, I have new product configuration that includes org.eclipse.sdk, which includes org.eclipse.platform and the bundles.info entry was generated like this using 3.5M1:

org.eclipse.core.runtime,3.4.100.v20080714,file:plugins/org.eclipse.core.runtime_3.4.100.v20080714.jar,4,false