Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » p2 feature update rules
p2 feature update rules [message #489362] Fri, 02 October 2009 15:23 Go to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
Can someone clarify the rules that p2 uses when updating please?

I'm new to p2, and RCP in general, but here's where I'm at:

I have an RCP product that contains a single defining product feature.This feature includes several plugins that provide functionality to the product.

Say I update a plugin, and I bump the service version number, say from 1.0.1 to 1.0.2 - I correspondingly update the feature version (which happens to be the same at the moment, but I don't expect all my plugins will change in tandem) version from 1.0.1 to 1.0.2.

When I point an installation of my app to a newly created p2 update site/repo it picks up the new version of the product feature and installs it, but seems to regard the existing installed version of the plugins as satisfying the requirements of the feature, so leaves them untouched.

I can see why this would be, I just want to know what I have to do to get p2 to see my plugins as distinct enough to require updating. Is it as simple as bumping the minor version rather than the service version, or is it more complex than that?

I understand that there is "feature patch" functionality, but I don't think this is really what I'm after, I just want the behaviour in which if I point my installed app at the p2 site after a recent build and the versions have changed, all necessary plugin content gets updated.

Thanks!

Bob Walker

Re: p2 feature update rules [message #489412 is a reply to message #489362] Fri, 02 October 2009 21:08 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
You could have a look thru the metadata in the repository to see if the new feature version has a dependency on the new plug-in version. If it still depends on the old plug-in version that would cause the behavior you mentioned.

The file you'd want to look at is content.jar (packed) or content.xml (unpacked).
Re: p2 feature update rules [message #491349 is a reply to message #489362] Wed, 14 October 2009 09:13 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
Hi Ben,

Thanks for the input sorry it's taken me so long to reply, I had some fires to fight Wink

I'm not familiar with the content.xml format, but to my reading, there is a <unit> node which represents my umbrella feature, which has its version attribute set to what I would expect. Within that, there is a <requires> node, which among other things contains the plugins I want to update, which specify a range attribute that constrains to only the latest version
e.g. range='[1.0.3.200910131551,1.0.3.200910131551].

My installation prompted for the latest version of the feature when I ran the p2 update from it, and this appeared to download and install the latest version. The installation details dialog reports the latest version of the product feature, but old version of its required plugins, and on disk, it still seems to have just the old versions of both the feature and its plugins.

Any ideas?

Re: p2 feature update rules [message #491555 is a reply to message #489362] Thu, 15 October 2009 01:17 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
Nothing comes to mind..

Is this a single or multi-user install?

Did you restart after updating?

Any errors in the Error Log?

Is it repeatable if you start with the old version and do the same steps?
Re: p2 feature update rules [message #492921 is a reply to message #491555] Thu, 22 October 2009 11:33 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
Hi Ben,

It's a single user install, and yes I restarted after the update. I've been able to reproduce the same behaviour on different machines with various versions of my app.

I found an issue with my p2 provider plugin in that I'd attempted to modify following the update from the cloud example; I reverted to the basic "use the whole p2 UI" install, and I'm still getting issues, which I think must largely due to my own lack of knowledge/understanding of the p2 rules. Is there some definitive documentation for how to manage product/feature/plugin versioning in RCP apps?

I'm happy to accept I'm doing something wrong, I don't believe for a second that I've discovered a bug, I just don't really understand where I'm going wrong and I'd like to revisit my understanding from the ground up.


Thanks,

Bob
Re: p2 feature update rules [message #493690 is a reply to message #489362] Tue, 27 October 2009 15:03 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
I'm now stuck in the "There is nothing to update" / "You can only have one version of..." quandary which appears to be a frequently asked, but not frequently answered question for newcomers like myself.

I'm guessing I'm supposed to be providing some sort of compatibility range / upgrade path between versions of my feature and the plugins it contains - I'm happy to do this, I've done plenty of work with installers in my time and accept that there is a need to define version compatibility rules, I just don't understand where and how to define these in p2.

Any help gratefully received.

Best regards,

Bob
Re: p2 feature update rules [message #493980 is a reply to message #493690] Wed, 28 October 2009 16:08 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
See this post
http://aniefer.blogspot.com/2009/07/composing-and-updating-c ustom-eclipse.html
and the referenced forum posts:
http://www.eclipse.org/forums/index.php?t=msg&th=41383&a mp;start=0&S=5763840b219361fc591b43e71884b82b
http://www.eclipse.org/forums/index.php?t=tree&th=41087& amp;start=0&S=47c495d41f26650fc5964f406daf6b70

For an explanation of the "nothing to update"/"only one version of" problem.

-Andrew
Bob Walker wrote:
> I'm now stuck in the "There is nothing to update" / "You can only have
> one version of..." quandary which appears to be a frequently asked, but
> not frequently answered question for newcomers like myself.
> I'm guessing I'm supposed to be providing some sort of compatibility
> range / upgrade path between versions of my feature and the plugins it
> contains - I'm happy to do this, I've done plenty of work with
> installers in my time and accept that there is a need to define version
> compatibility rules, I just don't understand where and how to define
> these in p2.
>
> Any help gratefully received.
>
> Best regards,
>
> Bob
Re: p2 feature update rules [message #493996 is a reply to message #489362] Wed, 28 October 2009 16:57 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
OK,

So I went back to basics and went through Ralf Ebert's tutorial at http://www.ralfebert.de/blog/eclipsercp/p2_updates_tutorial/ (thanks Ralf, great tutorial!).

Of course, that works a treat. No problems.

So I painstakingly worked through the points of difference between that setup and my app, and have made the following observations:

My product has a single defining feature that wraps all my other plugins and features. When I export my product with this setup, I cannot make updates to any of the contained features or plugins (I get "there is nothing to update" when I point my app at an updated export, and "Install New Software" gives "You can only have one version of.. XXX")

Mirroring what Ralf describes, I did this:
- omitted one of my features from my wrapper feature
- did a fresh export of my app
- added the omitted feature through "Install New Software"
- made changes to a plugin in that feature and bumped the plugin/feature versions
- re-exported that feature
- ran "Check for updates" in my app
- it finds and recognises the update, and installs it successfully.

So, I'm clearly missing something here - I don't see how this can be expected behaviour? Surely the feature can't be only updated if it's installed separately from the product? How does the IDE do it for core features?

Frustrated,

Bob
Re: p2 feature update rules [message #493997 is a reply to message #489362] Wed, 28 October 2009 16:59 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
Hi Andrew, only just seen your post after posting my last reply, thanks for the pointers, I'll review.
All the best,
Bob
Re: p2 feature update rules [message #494148 is a reply to message #489362] Thu, 29 October 2009 11:43 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
Andrew, that blog post is excellent, thank you!

It has filled in enough of the gaps in my understanding to enable me to figure out where I'm going wrong. I didn't previously understand the relationship between "explicitly installed" components and the updatability of child features.

However - I have discovered something that I still don't understand. I can work round it, but I'd like to understand what's going on. Here's what's happening:

I don't desperately need to break the link between my product and it's component parts just yet, so I was happy to to just bump version numbers up the plugin->feature->product chain, and update the whole product when a plugin changes (not ideal, but I'm just interested in a working solution rather than a broken one at this stage).

This works for exports made by the IDE, but not for buckminster builds on my remote build server. I jumped to blame buckminster, but after some long and extremely tedious repository comparisons, I discovered that my buckminster created repository is fine.

So, what I've found is this: I had a p2.inf file in an earlier version of my product with the folowing contents:
instructions.configure=\
  org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//my.build.server:8080/my.product.update/);\
  org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//my.build.server:8080/my.product.update/);  


(I stopped including this in my binary builds, but I gather that doesn't matter in 3.5.x onwards?)

Anyway, if I rename the static directory on my build server, e.g. to "my.product.update.WTF", and edit my "Available Software Site" to reflect the directory name change, "Check for Updates" then magically works and sees my updated product.

I've seen that that the build was hardwiring the repo info my old p2.inf into my product, because I'd already noticed that my product builds continued to have the update site present after I removed it from my binary output, but I don't get how/why that would stop it recognising updates? I would have thought if anything that it would be the reverse - i.e. that it would ONLY see updates from that site.

Thanks again,

Bob
Re: p2 feature update rules [message #494158 is a reply to message #489362] Thu, 29 October 2009 12:32 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
Also, I spoke too soon - I have come full circle - I can get my product to update, it updates the product, and the contained features, but despite reporting success, leaves the core plugins untouched.

This is so frustrating! Any ideas anyone?

<edit>I've calmed down and looked in the logs - I see the following:
ENTRY org.eclipse.equinox.p2.engine 4 4 2009-10-29 13:25:44.363
!MESSAGE An error occurred while collecting items to be installed
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2009-10-29 13:25:44.363
!MESSAGE session context was:(profile=MyAppProfile, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Collect, operand=, action=).
!SUBENTRY 1 org.eclipse.equinox.p2.artifact.repository 4 0 2009-10-29 13:25:44.363
!MESSAGE No repository found containing: osgi.bundle,my.app,1.1.0.200910141225
.
.
.

continued with a list of all the OLD version of my plugins. Am I supposed to maintain an aggregate/composite repo of all my historical version for it to be able to update?
</edit>
Bob

[Updated on: Thu, 29 October 2009 14:08]

Report message to a moderator

Re: p2 feature update rules [message #494367 is a reply to message #489362] Fri, 30 October 2009 12:41 Go to previous messageGo to next message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
OK - you can ignore my odd update site directory naming issues - in my frustration I had tried a couple of ways of serving repo content from my appserver and hadn't cleaned up behind myself so there was a conflict in where my p2 repo was getting served from.

BUT! As per my original post, updates to my product and its features STILL do not touch the plugins. I did this:

1) Made a fresh local install of my product,
2) made a minor change to one of my plugins
3) bumped the version on the plugin
4) bumped the version on the containing feature
5) bumped the version on the product wrapper feature
6) bumped the version on the product descriptor
7) did a fresh clean build via buckminster.
8 ) ran "Check For Updates" in my app, pointing to my buckminster created repo
9) My app saw the updated product, and updated it, and the changed child features
10) App now reports newer versions of changed product & all changed features, but still reports old version of the changed plugin.
11) On disk, the features directory contains the older version of the plugin, not the version reported by "Installed Software" in my app.

There are no new relevant errors in my log, my remote content.jar/content.xml only references the newer changed feature & plugin versions.

I've followed the same process both via Buckminster and via a local IDE export; the results are the same, so I can't blame my remote headless build. It has to be something else, but I'm utterly stumped as to what....
Re: p2 feature update rules [message #495032 is a reply to message #489362] Tue, 03 November 2009 15:15 Go to previous message
Bob Walker is currently offline Bob WalkerFriend
Messages: 31
Registered: July 2009
Member
OK so no takers.
Can anyone point me at some instructions to get p2 to log what decisions it's making so I can try to figure it out for myself?
Previous Topic:p2 installer creates my-rcp.exe.exe
Next Topic:When gets the ExtensionRegistry its BundleEvents
Goto Forum:
  


Current Time: Thu Apr 25 14:10:37 GMT 2024

Powered by FUDForum. Page generated in 0.03997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top