Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [p2-dev] Custom touchpoints, metaRequirements, and the collect phase

Hi Simon,
Thanks for the detailed reply.

> 
> Before I get into answering questions you mention bug 275404 and I
really
> would suggest anyone writing custom touchpoints and actions to follow
that
> bug.

Done.

> > 1. Specify our own touchpoint instead of
org.eclipse.equinox.p2.native,
> > and implement (read clone) the collect action that performs the same
> > actions as in the native touchpoint. When we do this, P2 complains
that
> > the touchpoint is unknown when it try to install the IU. Obviously,
the
> > com.test.p2.install IU has not been installed yet, because we are
only at
> > the collect phase.
> > 
> Hmm... this should work as we can dynamically install a touchpoint as
part
> of the metaRequirements. One of the examples I posted for our teams
test
> runs does this since the bundle that contains the metaRequired actions
also
> contains a touchpoint that's needed by the actions. I'll do some more
> testing this weekend but again I'm pretty sure this works so I'm not
sure
> what went wrong.

This one is still bugging me. I have tried a number of combinations,
including putting the metaRequirement on the enclosing feature group (of
the binary files IU), and putting the "provided" on the enclosing
feature group (of the install plugin IU). None of this works.

Can you point me to the test that you describe? Maybe an inspection of
the metadata will point me to a solution.

> > Here are our questions: 1. Can we safely assume that the native
> > touchpoint's download cache implementation will never change?
>
> I think you can rely on the implementation changing. What I'm hoping
you
> can rely on is that there will be a download cache where you can
lookup
> your artifact's location. We'll likely make some effort to keep things
> consistent but follow the changes in 275404 and ideally work with us
to
> make sure we do the right thing.

That is sort of what I figured. Do you think that this behaviour might
be changing before Eclipse 3.5 is released?

> > 2. Is there a better way to do this?  3. Or is this the intended way
of
> > doing things?
> I think the best way for "now" is to use the native touchpoint/native
> collect action. Finding the artifact location is probably best done by
> Util.getDownloadCacheRepo as I think we might have changes in the repo
> backing the download cache. These changes will be discussed in 275404.

Unfortunately, nothing in the native touchpoint plugin is exported, so
the best that I can do is to clone Util, which is of little value if the
implementation of the cache changes in future.

> > In some ways, this relates to issue 275404
> > (https://bugs.eclipse.org/bugs/show_bug.cgi?id=275404). There is no
> > default handling of artifacts, so the touchpoint is responsible for
> > downloading the artifact during the collect phase. Using
metaRequirements
> > to activate an IU required to install another IU only occurs during
the
> > install phase (as we understand it), so there is no way for a custom
> > touchpoint to do anything during the collect phase unless the IU is
> > installed separately.
> >
> Hmm, you shouldn't have to worry about collect vs. install. When
> metarequirements are involved we end up doing the operation in two
> transactions: 1) First, we install the IUs to satisfy the
metarequiremnts
> and apply the configuration 2) Second, we install the IUs we were
asked to
> install in the first place and where needed use the newly install
actions
> (if that's what the metarequirements brought in)
> 
> This is made to appear seamless in the UI so it appears to happen in
one
> shot. By the time the second transaction starts the
touchpoints/actions are
> available for all phases.

Again, this doesn't seem to be what I am seeing. I get the following
error when I try to install my IU:

====================
An error occurred while collecting items to be installed
  session context was:(profile=PlatformProfile,
phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Collect,
operand=null --> [R com.test.binaryfiles_root 1.0.0.200905251532,
action=).
  The required Touchpoint: com.test.p2.install 1.0.0 touchpoint for the
collect action is not included in the installation manager
configuration.
  The required Touchpoint: com.test.p2.install 1.0.0 touchpoint for the
collect action is not included in the installation manager
configuration.
====================

Since the behaviour would be controlled by P2 before downloading
anything but the metadata, I assume that there is probably something
wrong with my metadata. A sample of the expected behaviour would
probably help me out a lot.

> I think you generally are on the right track and have correctly
identified
> a real problem. The good news is that we're also very much aware of it
and
> planning to do something about it in the maintenance release. For now,
and
> until the maintenance release is available unfortunately I think the
safest
> approach is to depend on the native touchpoint, it's collect action,
and
> it's artifact lookup behavior.

Ah. Well, I guess that answers my question about 3.5. Never mind then.

Thanks again.
David.


Back to the top