Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316100 - [doc] Touchpoint actions marked greedy are not loaded during collect phase
Summary: [doc] Touchpoint actions marked greedy are not loaded during collect phase
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 316724
  Show dependency tree
 
Reported: 2010-06-08 04:12 EDT by Juergen Kindler CLA
Modified: 2011-06-12 21:19 EDT (History)
4 users (show)

See Also:


Attachments
Sample projects ... (27.54 KB, application/zip)
2010-06-08 04:12 EDT, Juergen Kindler CLA
no flags Details
updated p2.inf (518 bytes, text/plain)
2010-06-14 12:26 EDT, Simon Kaegi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Kindler CLA 2010-06-08 04:12:27 EDT
Created attachment 171374 [details]
Sample projects ...

I've got the problem that I want to enhance the installation of plugin test.tutorial with custom actions (org.eclipse.equinox.p2.touchpoint.tutorial) that should be downloadable.

So I marked plugin test.tutorial to greedily require org.eclipse.equinox.p2.touchpoint.tutorial.

I build this working sample around the time when M6 was out, got it running with M6 and planned to do the actual work later (as this would not be bound to the release cycle).

Now, with RC4 it does not work anymore:
java.lang.IllegalArgumentException: No action found for: org.eclipse.swordfish.p2.touchpoint.tutorial.harvest.
	at org.eclipse.equinox.internal.p2.engine.MissingAction.execute(MissingAction.java:42)
	at org.eclipse.equinox.internal.p2.engine.Phase.mainPerform(Phase.java:149)
	at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:78)
	at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:44)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:73)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
	at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:151)
	at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:79)
	at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:177)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


Tracking back, I found that already in M7 it's broken.

Unfortunately this is essential for my implementation. :-(

Is there anything I can do to make it work again?
Comment 1 Simon Kaegi CLA 2010-06-08 10:14:28 EDT
Are you using a greedy "metarequirement" for the custom actions?
e.g. see http://wiki.eclipse.org/Equinox/p2/Customizing_Metadata

Custom action providers need to be installed before the IUs that use the actions. A metarequirement places a requirement on the "installer" so that we get a two stage install where the custome action provider is installed before the custom action using IU(s).
Comment 2 Juergen Kindler CLA 2010-06-08 10:21:34 EDT
(In reply to comment #1)
Yes, indeed. We use that.

test.tutorial specifies:
metaRequirements.0.namespace=org.eclipse.equinox.p2.touchpoint.tutorial
metaRequirements.0.name=harvestHasi
metaRequirements.0.range=1.0.0
metaRequirements.0.greedy=true

and org.eclipse.equinox.p2.touchpoint.tutorial:
provides.0.namespace=org.eclipse.equinox.p2.touchpoint.tutorial
provides.0.name=harvestHasi
provides.0.version=1.0.0

So the experience was that first org.eclipse.equinox.p2.touchpoint.tutorial was installed and then during installation of test.tutorial the actions registered by org.eclipse.equinox.p2.touchpoint.tutorial could be used.
Comment 3 Simon Kaegi CLA 2010-06-14 12:26:36 EDT
Created attachment 171846 [details]
updated p2.inf

Here's an updated p2.inf that moves you action work to the install phase instead of the collect phase.

The problem was that the custom action was trying to run during the collect phase and is not installed at that point. This is caused because we "pre-download" all the artifacts using the "collect" phase before actually performing the real install.

We need to "formally" sort this use-case out more fully by either not permitting the use of custom actions in the collect phase or else in the p2 UI running the installer plan fully before doing the "pre-download" work.

For now the best workaround is to not use custom actions in the "collect" phase and to be honest I think this is the best long term approach also.
Comment 4 Juergen Kindler CLA 2010-06-16 02:13:21 EDT
(In reply to comment #3)
Thanks a lot for the info and the updated p2.inf.

Unfortunately, it leads to the same problem as the original - just in a different phase:
An error occurred while installing the items
session context was:(profile=SelfHostingProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]test.tutorial 1.0.0.201006160750, action=org.eclipse.equinox.internal.p2.engine.MissingAction).
No action found for: org.eclipse.swordfish.p2.touchpoint.tutorial.harvest.
No action found for: org.eclipse.swordfish.p2.touchpoint.tutorial.harvest.

So it seems that even during the install phase it is not possible to do this kind of thing anymore. :-(
Comment 5 Simon Kaegi CLA 2010-06-16 09:40:15 EDT
Strange.
I just re-tested with a clean RC4 install and everything worked correctly. I'll re-diff against your original projects as maybe I missed something.
Comment 6 Juergen Kindler CLA 2010-06-17 02:17:50 EDT
(In reply to comment #5)
No, it could have been my run configuration (I started the Eclipse in a debug config and even though everything gets cleared upfront, maybe something was not as clean as expected.)
:-(
I reinstalled Eclipse and it worked correctly (namely after I changed HarvestAction.EXECUTE_IN_PHASE = "install"; I saw the expected dialog popping up! :-) )

(((((-: Thank you very,very,very much Simon :-)))))
Comment 7 Simon Kaegi CLA 2010-06-17 09:57:44 EDT
That's good that you're working now.
I still want to leave this bug open as I think we need to document a little caution when using custom actions during the collect phase.
Comment 8 Pascal Rapicault CLA 2011-06-12 21:19:36 EDT
No more work planned there.