Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341537 - more flexible feature dependency versions
Summary: more flexible feature dependency versions
Status: CLOSED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-31 15:29 EDT by Igor Fedorenko CLA
Modified: 2011-04-12 14:40 EDT (History)
5 users (show)

See Also:


Attachments
tentative patch against 3.6.x branch (11.50 KB, patch)
2011-04-01 21:40 EDT, Igor Fedorenko CLA
no flags Details | Diff
proposed implementation (17.75 KB, patch)
2011-04-02 23:50 EDT, Igor Fedorenko CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Fedorenko CLA 2011-03-31 15:29:43 EDT
I have two related requests/proposals.

First, introduce new match mode 'versionRange', which will treat dependency plugin/feature version as version range and will allow [1.2.3,4.5.6) syntax.

Second, for feature patches respect match attribute if present (but assume match=perfect if match is not specified).

I am willing to provide a patch if there is an interest in this.
Comment 1 Pascal Rapicault CLA 2011-03-31 15:33:10 EDT
+1 for having this be addressed. The handling of patches with the current expressiveness of feature.xml is a big limitation since patches can only be created for one precise version of a feature whereas p2 allows for a patch to be applicable on multiple versions of a feature.
Comment 2 Jeff McAffer CLA 2011-04-01 17:45:10 EDT
Feels like two separate and unrelated topics.  Allowing requirements to be expressed with ranges would be great.  At some point we should just get rid of the match rules of old and use ranges.

The patch thing is interesting.  What would the upper bound of the range in a patch be?  How can you say that your patch will work with some future version? Or are you saying that the upper bound would be the current version and the lower bound would be something from the past?  That seems reasonable.

In any event, this should be split into two bug IMO as they would likely be addressed separately/differently.
Comment 3 Igor Fedorenko CLA 2011-04-01 21:40:28 EDT
Created attachment 192405 [details]
tentative patch against 3.6.x branch

(In reply to comment #2)
> Feels like two separate and unrelated topics.  Allowing requirements to be
> expressed with ranges would be great.  At some point we should just get rid of
> the match rules of old and use ranges.
I thought about this too but decided to add match=versionRange but keep the old behaviour. It is not hard to keep the old match rules and I am sure there would be at least few loudly upset "fans" of the old rules if we removed them.

> The patch thing is interesting.  What would the upper bound of the range in a
> patch be?  How can you say that your patch will work with some future version?
> Or are you saying that the upper bound would be the current version and the
> lower bound would be something from the past?  That seems reasonable.
I think publisher should not enforce or imply any specific upgrade/patch scenarios but should let the users decide what makes sense for them. Especially because p2 engine's support for patch IUs seems to be quite flexible. My immediate use case is to deliver new versions of Maven runtime to existing and future m2e installations. I control both m2e versions and maven runtime versions, so I will make sure the patch only applies to compatible m2e version.


> 
> In any event, this should be split into two bug IMO as they would likely be
> addressed separately/differently.
Actually, both patch and version/match logic implemented together, so the two are much easier to implement as one change (see attached *preliminary* patch).
Comment 4 Igor Fedorenko CLA 2011-04-02 23:50:31 EDT
Created attachment 192420 [details]
proposed implementation

Let me know if attached proposed implementation makes sense or requires more work.
Comment 5 Pascal Rapicault CLA 2011-04-11 08:42:07 EDT
Patch applied
Comment 6 Andrew Niefer CLA 2011-04-12 14:31:30 EDT
This change completely broke PDE/Build.  There are over 100 test failures.

Any feature.xml containing a <requires> element will not parse.  This is because the hasImports field was change to a final with value false.  It is no longer being set in processImport.

The #endElement for "requires" enforces that there is at least one import (as required by the feature.xml DTD  - http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/feature_manifest.html)