Home » Eclipse Projects » Equinox » p2 feature update rules
p2 feature update rules [message #489362] |
Fri, 02 October 2009 15:23 |
Bob Walker 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 #491349 is a reply to message #489362] |
Wed, 14 October 2009 09:13 |
Bob Walker 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
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 #493996 is a reply to message #489362] |
Wed, 28 October 2009 16:57 |
Bob Walker 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 #494148 is a reply to message #489362] |
Thu, 29 October 2009 11:43 |
Bob Walker 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 |
Bob Walker 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 |
Bob Walker 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....
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 14:10:37 GMT 2024
Powered by FUDForum. Page generated in 0.03997 seconds
|