Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Matching feature versions
Matching feature versions [message #132982] Sat, 13 June 2009 14:57 Go to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi,

I was wondering, how the matching of feature versions happens.
Consider these features:
3.5RC3
org.eclipse.jdt_3.5.0.v20090527-2000-7r88FEeFJePyvYe69JGnUag 1
3.5RC4
org.eclipse.jdt_3.5.0.v20090527-2000-7r88FEeFJePyvYeA27DiZdc 1

It strongly looks like both are the same feature, only the last so-many
characters of this long identifier differ.

This is relevant in the context of deploying patch features, because a
patch must(?) specify the exact version of the feature being patched.

Is there a way to tell equinox / p2, that a given patch feature can indeed
be applied on top of either of the above (identical) features?

I seem to remember that those long identifiers were _intended_ to
bring more stability to dependencies, whereas in this case they seem
to _introduce_ unnecessary incompatibilities.
Am I missing something?

thanks,
Stephan
Re: Matching feature versions [message #133089 is a reply to message #132982] Mon, 15 June 2009 13:27 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Stephan Herrmann wrote:
> Hi,
>
> I was wondering, how the matching of feature versions happens.
> Consider these features:
> 3.5RC3
> org.eclipse.jdt_3.5.0.v20090527-2000-7r88FEeFJePyvYe69JGnUag 1
> 3.5RC4
> org.eclipse.jdt_3.5.0.v20090527-2000-7r88FEeFJePyvYeA27DiZdc 1

The long string at the end is to ensure that these one feature is
"greater" than the other, so that you would be able to install an
upgrade (they're generated by a mix of things, one of which is a
contained plugin incremented its version).

The problem is Feature Patches are designed to target a specific
feature, and PDE tools/build propagates the exact feature ID into the p2
metadata. In my case, I had to hack the content.xml directly to replace
the range for the feature I was patching:

<xsl:template match="@range[../@name='org.eclipse.rcp.feature.group']">
<xsl:attribute name="range">[3.5.0,4.0.0)</xsl:attribute>
</xsl:template>
<!-- Whenever you match any node or any attribute -->
<xsl:template match="node()|@*">
<!-- Copy the current node -->
<xsl:copy>
<!-- Including any attributes it has and any child nodes -->
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>


If there's another way to do it, I'm all ears.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Matching feature versions [message #133102 is a reply to message #133089] Mon, 15 June 2009 14:57 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
The long suffix at the end of the feature's version is a kind of base-64
sum of the things that are included by the feature. This way, when one
of the plug-ins included by the feature increased its version, and the
feature is then requiring the new plugin version, the feature's version
also increases.

As Paul mentioned, the old Update Manager only supported patching a
specific version of a feature. But, p2 is much more flexible, the
problem is that the only tooling we currently have for generating
patches is based on the old Update stuff, so you need to edit the
generated metadata by hand to relax the version ranges.

I am currently writing a blog post or two on this topic, they will show
up here when they are done: http://aniefer.blogspot.com/

The p2 metadata for a patch contains something like this:
<unit id='org.example.patch.feature.group' version='1.0.0'
singleton='false'>
<patchScope>
<scope>
<requires size='1'>
<required namespace='org.eclipse.equinox.p2.iu'
name='org.eclipse.equinox.p2.user.ui.feature.group'
range=''/>

</requires>
</scope>
</patchScope>

This specifies the feature you are patching, and the tooling currently
generates a specific version range because that was the semantics of the
old update feature patch.
You can relax this version range as Paul did, even to something a bit
narrower than Paul's [3.5.0,4.0.0):
[3.5.0.v20090527-2000, 3.5.0.v20090527-2001)
Which is any version equal to or larger than 3.5.0.v20090527-2000, but
smaller than 3.5.0.v20090527-2001. This matches all the different
generated suffixes.


Paul Webster wrote:
> Stephan Herrmann wrote:
>> Hi,
>>
>> I was wondering, how the matching of feature versions happens.
>> Consider these features:
>> 3.5RC3
>> org.eclipse.jdt_3.5.0.v20090527-2000-7r88FEeFJePyvYe69JGnUag 1
>> 3.5RC4
>> org.eclipse.jdt_3.5.0.v20090527-2000-7r88FEeFJePyvYeA27DiZdc 1
>
> The long string at the end is to ensure that these one feature is
> "greater" than the other, so that you would be able to install an
> upgrade (they're generated by a mix of things, one of which is a
> contained plugin incremented its version).
>
> The problem is Feature Patches are designed to target a specific
> feature, and PDE tools/build propagates the exact feature ID into the p2
> metadata. In my case, I had to hack the content.xml directly to replace
> the range for the feature I was patching:
>
> <xsl:template match="@range[../@name='org.eclipse.rcp.feature.group']">
> <xsl:attribute name="range">[3.5.0,4.0.0)</xsl:attribute>
> </xsl:template>
> <!-- Whenever you match any node or any attribute -->
> <xsl:template match="node()|@*">
> <!-- Copy the current node -->
> <xsl:copy>
> <!-- Including any attributes it has and any child nodes -->
> <xsl:apply-templates select="@*|node()"/>
> </xsl:copy>
> </xsl:template>
>
>
> If there's another way to do it, I'm all ears.
>
> PW
>
>
Re: Matching feature versions [message #133147 is a reply to message #133102] Mon, 15 June 2009 18:11 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Thanks for both your answers.

Are there chances that in the future such ranges can be declared in the
feature.xml rather than hacking the content.xml?
- might as well await the second blog post to see what answers it'll have
;-)

best,
Stephan
Previous Topic:what to expect from p2 sat solver?
Next Topic:[DS] Activate passes Dictionary as Map
Goto Forum:
  


Current Time: Thu Apr 25 14:22:58 GMT 2024

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

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

Back to the top