Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Filtering setup file 'requirement' by Eclipse release (Neon/4.6)
Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1770936] Fri, 18 August 2017 22:32 Go to next message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
Is it possible to make a requirement conditional on the Eclipse IDE release installed? The filter below works fine for checking the OS version for example, but I'm having a hard time finding an available property that will check for something like 'Neon' or '4.6'. Is that currently supported?

<requirement
name="my.feature"
versionRange="[3.0.0,4.0.0)"
filter="(osgi.os=win33)"/>
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1770975 is a reply to message #1770936] Sun, 20 August 2017 09:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
No, nothing like that is supported (in p2). I think your feature itself can specify a requirement (e.g., in the p2.inf) that would make the feature not installable unless that requirement is installable; then you could make the requirement in the p2 task optional greedy so that it's installed when possible.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771093 is a reply to message #1770975] Mon, 21 August 2017 20:50 Go to previous messageGo to next message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
Thanks Ed, that sounds like a promising approach. However, I've never been able to get 'optional' to work, as optional features always appear to be ignored (regardless of greedyness). I must be doing something wrong somehow, unless this is a recent regression.

Trying again with Neon.3 and Oxygen, the following requirement appears to be completely ignored (there is nothing interesting logged to the Eclipse error log or to the setup.log):

<requirement
name="my.feature.group"
versionRange="[3.0.0,4.0.0)"
optional="true"/>

However, after making the requirement required, the feature will install just fine into Oxygen, and will fail under Mars (as expected, due to unfulfilled requirements).

<requirement
name="my.feature.group"
versionRange="[3.0.0,4.0.0)"/>
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771109 is a reply to message #1771093] Tue, 22 August 2017 05:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Greedy should work. It's used heavily in the metadata of bundles internally. When using just optional, the dependency will effectively be ignored; the thing will be installed only if something else has a no-optional requirement. That's the purpose of greedy. It instructs p2 to attempt to install the thing whenever possible, even if there is no non-optional requirement for the thing to be installed. I just checked that in org.eclipse.oomph.p2.internal.core.ProfileTransactionImpl.adjustProfileChangeRequest(IProfileChangeRequest, IProgressMonitor) it does create a p2 requirement that respects the greed value of the model, so I do expect this to work properly with Oomph and certainly in the p2 layer, this definitely works properly. If that's not the case, you can open a Bugzilla...

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771202 is a reply to message #1771109] Tue, 22 August 2017 21:01 Go to previous messageGo to next message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
Yes, it seems unlikely that optional requirements would be broken in p2. I'm assuming that when you talk about greedy, it's in regard to the p2 configuration (p2.inf, or something similar), and not in the oomph setup file, where greedy=true is the default.

I can file an Oomph bug report for this, but would like to check if the following is supposed to work first. I added the following requirement only to an Eclipse Oxygen oomph setup file, for example to installation.setup:

<requirement
name="org.eclipse.cvs.feature.group"
versionRange="[1.4.0,2.0.0)"
optional="true"/>

However, the CVS plugin wasn't installed after restarting Eclipse, and there are no errors logged anywhere AFAIK. 'greedy="true"' should be the default for oomph requirements, while I tried explicitly adding that as well (to no avail).

On the other hand, the following non-optional requirement will install w/o problems:

<requirement
name="org.eclipse.cvs.feature.group"
versionRange="[1.4.0,2.0.0)"/>

Is there some p2 greedy setting that would need to be configured for the Eclipse (CVS plugin) update site as well, in order for the oomph 'optional' requirement to work? I chose the CVS plugin example because it's a common plugin hosted by Eclipse.
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771203 is a reply to message #1771202] Tue, 22 August 2017 21:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Sorry, I didn't realize greedy was true by default, but yes, that's the case...

CVS is already installed in most (all, I think) of the packages, by default so that seems not a good test...



Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771205 is a reply to message #1771203] Tue, 22 August 2017 21:42 Go to previous messageGo to next message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
The CVS plugin is no longer part of the JEE package, but maybe still part of the more PDE oriented packages for example. I'll try to find some less common Eclipse hosted plugin...
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771207 is a reply to message #1771205] Wed, 23 August 2017 00:04 Go to previous messageGo to next message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
I'm getting the same results when attempting to install "Eclipse 2.0 Style Plugin Support" into Oxygen JEE as an optional requirement (the first requirement below fails to install, while the 2nd is installed).

I'd be happy to log an oomph issue for this, assuming optional="true" is supposed to install the feature.

<requirement
name="org.eclipse.osgi.compatibility.plugins.feature.feature.group"
versionRange="[1.0.0,2.0.0)"
optional="true"/>

<requirement
name="org.eclipse.osgi.compatibility.plugins.feature.feature.group"
versionRange="[1.0.0,2.0.0)"/>
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771228 is a reply to message #1771207] Wed, 23 August 2017 06:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Please open a Bugzilla and I'll try to find time to look into this when I'm back in the office later this week.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Filtering setup file 'requirement' by Eclipse release (Neon/4.6) [message #1771316 is a reply to message #1771228] Thu, 24 August 2017 00:59 Go to previous message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
Great - I have filed the following issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=521337
Previous Topic:Add Repositories from P2 Task to Available Software Sites
Next Topic:org.eclipse.mylyn.builds.core [1.0.0,2.0.0)' but it could not be found
Goto Forum:
  


Current Time: Sun Dec 08 00:49:39 GMT 2024

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

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

Back to the top