| Summary: | It should be documented that category publisher (and PDE build) can figure out absence of version means "latest" | ||
|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | David Williams <david_williams> |
| Component: | p2 | Assignee: | P2 Inbox <equinox.p2-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | kking1276 |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | stalebug | ||
I was wrong. 0.0.0.qualifier doesn't work. I was confusing myself since the categories are added to repo in a "cumulative" way.
But what does (seem to) work is leaving out version altogether.
I finally looked at the code for 'CategoryPublisher' ... I was thinking of writing our own custom app in WTP to do it, so we wouldn't have to specify all the versions "by hand". As far as I can tell from the code, the way it works is that a p2 query is formed from the category.xml feature entry ... then that query is used against the artifact repo to find all that matches, and the results are put in the category entry for that feature.
One conclusion is that the URL doesn't seem to be used at all (could be, somehow ... I guess ... I didn't dig too deep).
More significantly, a version such as "3.2.1.qualifier" forms a query to find all versions that match the range, effectively, as "3.2.1.*", so 0.0.0.qualifier would seldom match anything. BUT, what I learned from the code is that the absence of a version at all, is what causes a special query to be formed to "match any version".
So, unbelievably, a simple entry such as the following suffices to find what's there.
<feature
id="org.eclipse.wst.xml_sdk.feature">
<category
name="Web Tools Platform SDK (WTP SDK) 3.2.1"/>
</feature>
Of course, if a repo had several versions, and one wanted them in different categories, or wanted only one version in a category, then you'd have to spell it out (as far as I could tell, there where no obvious "wild cards" or vesion ranges allowed ... but, I wouldn't rule it out).
So, please confirm the intent of how to specify a category.xml file.
I understand this is a "hold over" or transition from the site.xml file (and its editor) but ... it is wasteful that I have had to spend so much time messing with this (literally, person weeks over the months) ... I hope others don't have to waste so much time on it (or, give up simply cursing p2) when its really not that hard.
I didn't know that no version also worked, but I know that the feature version "0.0.0" without "qualifier" works and means latest to the category publisher. Using "0.0.0" is what we recommend to all Tycho users (and Tycho uses the CategoryPublisher), so we'll make sure that this will continue to work. If you know a good place to document this behaviour, go for it! This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
At least I could not find this documented anywhere, and the few examples I saw had "digit.digit.digit.qualifier", but not "0.0.0.qualifier". For example, in the category.xml file, they might have had <feature url="features/org.eclipse.wst.xml_sdk.feature_2.7.0.qualifier.jar" id="org.eclipse.wst.xml_sdk.feature" version="2.7.0.qualifier"> <category name="Web Tools Platform SDK (WTP SDK) 3.2.0"/> </feature> instead of the much easier <feature url="features/org.eclipse.wst.xml_sdk.feature_0.0.0.qualifier.jar" id="org.eclipse.wst.xml_sdk.feature" version="0.0.0.qualifier"> <category name="Web Tools Platform SDK (WTP SDK) 3.2.0"/> </feature> This is "easier" not just for the one time use (though even that's much easier! and less error prone) but it is especially important "over time" as then you don't need to worry about keeping up this trivial data in multiple locations. Via trial-error I found that "0.0.0.qualifier" works to find the latest, when using the CategoryPublisher. I hope it works too during PDE build, since that's the ideal place to add categories "with each build". But that stopped working for us in WTP, because I couldn't keep up when people changed their feature version number. So, please document it ... and continue to support it! :) BTW, I think early on I tried simply "0.0.0" (as you can do in feature.xml files), but that didn't work, so I gave up on that approach. I'll update the wiki myself if you confirm this is working as designed ... and isn't a bug :) I'll be applying this "trick" to our builds soon and see if it works there too. If it doesn't ... I'll be asking for more details about how to implement bug 277359 for everyone .... how to have a "categories" repo that "works" for all features? thanks,