Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352081 - Handling of version 0.0.0 in feature plugin inclusions
Summary: Handling of version 0.0.0 in feature plugin inclusions
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 412416
Blocks:
  Show dependency tree
 
Reported: 2011-07-14 09:16 EDT by Eckart Langhuth CLA
Modified: 2021-04-28 16:55 EDT (History)
4 users (show)

See Also:


Attachments
Reproducible example (109.49 KB, application/x-zip-compressed)
2011-07-20 06:52 EDT, Eckart Langhuth CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eckart Langhuth CLA 2011-07-14 09:16:44 EDT
Build Identifier: 

A feature.xml defines a plugin inclusion using version 0.0.0.
The build is expected to replace the version with the latest available version of the related bundle.

The current implementation uses the org.eclipse.equinox.internal.p2.director.Projector to determine a provisioning plan for installing the feature installation.
This is done under the implicit assumption that the projector will always prefer the latest version of a dependency with unspecified version constraint.
This is not the case. 
Other factors like install size might be take into account by the projector.
The build should replace the required bundle versions with the latest available bundle version prior to calculation the provisioning plan.


Reproducible: Didn't try

Steps to Reproduce:
A reproducible complex, internal example exists.
Did not create a simple example to be attached.
Comment 1 Eckart Langhuth CLA 2011-07-20 06:52:44 EDT
Created attachment 199972 [details]
Reproducible example
Comment 2 Tobias Oberlies CLA 2011-07-20 09:44:22 EDT
This problem probably also occurs in other places where "0.0.0" is used as a placeholder for including the latest version, like products and category.xmls.
Comment 3 Tobias Oberlies CLA 2011-08-04 10:09:50 EDT
Fixing this with the current target platform/dependency resolver setup is quite hard because it would need to be fixed in two places: near the dependency-only publishing and in the actual build.

The restructuring proposed in bug 353889 would reduce this to one instance... (a perfect solution if the restructuring would be so much work).
Comment 4 Tobias Oberlies CLA 2014-05-12 10:50:19 EDT
The plugin version replacement is tested in these integration tests: DotQualifierMatchingTest ("1.0.0.qualifier") and ExpandReleaseVersionTest ("0.0.0")
Comment 5 Tobias Oberlies CLA 2014-06-30 06:50:25 EDT
Work in progress is posted here: [1]

There are still a few open questions about the implementation:
* Which versions shall match the declarations in the feature.xml? See discussion on tycho-dev [2]. I'd propose to drop the "1.0.0 matches [1.0.0, 1.0.1)" support for features, but this would be an incompatible change and should be discussed with the community.
* Which attributes to check when matching IUs? Only the unit id (as done by the p2 publishers)? Or also the provided capabilities and/or properties (as done by the Tycho p2 resolver)?
* How to handle projects using the local resolver? In the current state of the change [1], only projects with resolver=p2 can build features.

Given the number of open questions, this bug won't make it into 0.21.0

[1] https://git.eclipse.org/r/#/c/29182/1
[2] https://dev.eclipse.org/mhonarc/lists/tycho-dev/msg01094.html
Comment 6 Tobias Oberlies CLA 2014-12-09 08:34:54 EST
Hooray, more progress!!

(In reply to comment #5)
> There are still a few open questions about the implementation:
> * Which versions shall match the declarations in the feature.xml? See discussion
> on tycho-dev [2]. I'd propose to drop the "1.0.0 matches [1.0.0, 1.0.1)" support
> for features, but this would be an incompatible change and should be discussed
> with the community.
I'd rather comply with the PDE UI behaviour. IMHO the less-known/less-used site.xml format doesn't justify the inconsistency in the feature.xml processing.

> * Which attributes to check when matching IUs? Only the unit id (as done by the
> p2 publishers)? Or also the provided capabilities and/or properties (as done by
> the Tycho p2 resolver)?
Actually, the publishers also check capabilities and attributes. So I did the same in the new implementation, and hence the new behaviour is consistent to the resolver.

> * How to handle projects using the local resolver? In the current state of the
> change [1], only projects with resolver=p2 can build features.
Projects with local resolver now no longer replace the versions on references in the feature.xml. The local resolver has now been deprecated for years, so I didn't keep a second implementation for the local resolver.

The current status is here: https://git.eclipse.org/r/#/c/29182/
Comment 7 Tobias Oberlies CLA 2014-12-30 09:52:58 EST
Submitted: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=4873413ee243517d933e8aa595374623edbec865

Yay, so now we have the fourth oldest Tycho bug fixed. The fix is really not that exciting, but the changes in the internals (introduction of the target platform, preliminary vs. final metadata in the target platform, the local Maven repository as real p2 artifact repository, and the pluggable artifact providers with transparent caching) mean a lot! Good that this is done.