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

Bug 325036

Summary: p2SiteGenerator actor fails when extra prerequisites are specified
Product: z_Archived Reporter: Michal Ruzicka <michal.ruza>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
org.eclipse.buckminster.pde-allow_prerequisites_for_p2SiteGenerator.patch none

Description Michal Ruzicka CLA 2010-09-11 16:34:46 EDT
STEPS TO REPRODUCE
1) Have a feature project on which you can successfully execute the "site.p2" action, let the project be named "test.feature"

2) Add a buckminster.cspex file to the feature project with the following content:
<cspecExtension xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
	<actions>
		<private name="extra.site.p2.prerequisite" actor="null" />
	</actions>

	<alterActions>
		<public name="site.p2">
			<prerequisites>
				<attribute name="extra.site.p2.prerequisite" />
			</prerequisites>
		</public>
	</alterActions>
</cspecExtension>

3) Invoke the "site.p2" action on the project

ACTUAL RESULT
All the prerequisites of the "site.p2" action are executed successfully including the extra prerequisite but the execution of the "site.p2" action itself fails, as documented in the buckminster log:
...
[start test.feature:eclipse.feature$1.0.0.qualifier#extra.site.p2.prerequisite]
[end test.feature:eclipse.feature$1.0.0.qualifier#extra.site.p2.prerequisite]
[start test.feature:eclipse.feature$1.0.0.qualifier#site.p2]
Prerequisite with name extra.site.p2.prerequisite is not known to action test.feature:eclipse.feature$1.0.0.qualifier#site.p2

EXPECTED RESULT
The action execution succeeds as before only the extra prerequisite is executed just before the site.p2 action itself, the buckminster log looks something like this:
...
[start test.feature:eclipse.feature$1.0.0.qualifier#extra.site.p2.prerequisite]
[end test.feature:eclipse.feature$1.0.0.qualifier#extra.site.p2.prerequisite]
[start test.feature:eclipse.feature$1.0.0.qualifier#site.p2]
[end test.feature:eclipse.feature$1.0.0.qualifier#site.p2]

ADDITIONAL INFO
By inspection of org.eclipse.buckminster.pde.internal.actor.P2SiteGenerator.internalPerform() it is clear that the p2SiteGenerator actor does not accept any extra prerequisites - it throws IllegalPrerequisiteException() at line 381 if any such prerequisite is encountered.
I believe this is wrong. IMO the p2SiteGenerator actor should ignore the extra prerequisites, optionally it could issue warning(s) in this respect.
Comment 1 Michal Ruzicka CLA 2010-09-14 09:27:30 EDT
Created attachment 178828 [details]
org.eclipse.buckminster.pde-allow_prerequisites_for_p2SiteGenerator.patch

The attached patch fixes the described problem fro me, please consider it for inclusion.
Comment 2 Thomas Hallgren CLA 2010-09-15 01:20:12 EDT
This patch looks good. Please commit it to the helios-maintenance branch.
Comment 3 Michal Ruzicka CLA 2010-09-15 13:04:46 EDT
patch committed to the helios-maintenance branch in revision 11580