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

Bug 136733

Summary: resolver should account for order of required EE.
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, jeffmcaffer, wassim.melhem
Version: 3.2   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 136681    
Attachments:
Description Flags
patch none

Description Thomas Watson CLA 2006-04-13 15:31:18 EDT
See bug 136681 for some background information.

In PDE multiple platform properties can be specified for the state, each of which specifies a list of supported execution environments.  The resolver will currently resolve a bundle against the lowest possible platform profile no matter what order the EEs are specified in the bundle.  For example,

Bundle-RequiredExecutionEnvironment: J2SE-1.4, J2SE-1.3

If the state contains two platform profiles, one for J2SE-1.3 and one for J2SE-1.4 then the resolver will always pick the lowest possible profile that can satisfy the bundle.  In this case J2SE-1.3 will always be used.  The state should actually pay attention to order of EEs.  This way it would pick J2SE-1.4 if the profile is available in the state.
Comment 1 Thomas Watson CLA 2006-04-13 15:45:48 EDT
Created attachment 38548 [details]
patch

possible fix.

Simple solution that moves the inner loop for the bundle's EEs to be the outer loop so that they take the highest priority.
Comment 2 Thomas Watson CLA 2006-04-17 15:16:00 EDT
I discussed this with Jeff.  There are some concerns about putting this type of logic into the resolver.

It is confussing for developers to be required to put an "unnecessary" entry into the Bundle-RequiredExecutionEnvironment just for build purposes.  This type of information should be specified in the build.properties.  There is currently an option in the build.properties to specify the jre profile to compile against (jre.compilation.profile).  This is intended to override the one specified in the Bundle-RequiredExcecutionEnvironment header for cases where the bundle needs to compile against "higher" profiles but can run on "lower" profiles.

If this option is specified in the build.properties then PDE-UI and PDE-BUILD should use the value to replace the header specified in the bundle manifest before using it to create BundleDescription objects in the state.  This way the developer only needs to specify the required compilation profile in one spot, the build.properties file.
Comment 3 Wassim Melhem CLA 2006-04-17 15:34:28 EDT
-1 for the proposal in comment 2 based on the simple premise that the state PDE builds at development time is as close as possible to that at runtime.

The execution environments in a bundle description at runtime are based strictly on what's in the manifest.mf.  Tweaking/mutilating/polluting the state with build.properties info is not kosher.

So my objection is based on principle.

On an implementation level, it's not so easy either to synchronize the build.properties with the creation/updating of a bundle description.  It is undesirable, messy and risky.

Removing the target milestone pending further discussion.
Comment 4 Jeff McAffer CLA 2006-04-17 16:11:23 EDT
+1 we should fix this for 3.2 by reversing the lookup order
Comment 5 Thomas Watson CLA 2006-04-17 16:19:23 EDT
Moving back to equinox.  We will fix the resolver in for 3.2 to address this issue.

I will open a separate bug against PDE to look into a better fix in a post-3.2 release.
Comment 6 Thomas Watson CLA 2006-04-17 16:33:48 EDT
Released patch to resolver for RC2.