Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331061 - Issues with dependency resolution in Indigo aggregator
Summary: Issues with dependency resolution in Indigo aggregator
Status: CLOSED WORKSFORME
Alias: None
Product: CBI
Classification: Technology
Component: CBI p2 Repository Aggregator (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-24 16:04 EST by Gunnar Wagenknecht CLA
Modified: 2016-09-16 15:51 EDT (History)
2 users (show)

See Also:


Attachments
screenshot of the error message (99.59 KB, image/png)
2010-11-29 05:11 EST, Gunnar Wagenknecht CLA
no flags Details
screenshot of the repo as shown in the b3 editor (113.61 KB, image/png)
2010-11-29 05:12 EST, Gunnar Wagenknecht CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2010-11-24 16:04:19 EST
I'm having some issues with the dependency resolution while bringing Gyrex into Indigo. Basically, b3 complains about missing dependencies although they are in the repository.

When verifying locally I get a different error than reported by Hudson. I committed the gyrex.b3aggrcon for others to reproduce the problem.

I also noted that I had to switch feature dependencies to "Compatible". The default (Greater or equal) did not produce the correct p2 version range.

BTW, can someone point me to the special p2 instructions that prevent a feature from being installed into an IDE?
Comment 1 Gunnar Wagenknecht CLA 2010-11-29 04:58:35 EST
Moving to b3 for further comment.
Comment 2 Gunnar Wagenknecht CLA 2010-11-29 04:59:09 EST
Moving to b3 for further comment.
Comment 3 Gunnar Wagenknecht CLA 2010-11-29 05:11:56 EST
Created attachment 184019 [details]
screenshot of the error message
Comment 4 Gunnar Wagenknecht CLA 2010-11-29 05:12:23 EST
Created attachment 184020 [details]
screenshot of the repo as shown in the b3 editor
Comment 5 Thomas Hallgren CLA 2010-11-29 06:58:52 EST
(In reply to comment #0)
> When verifying locally I get a different error than reported by Hudson. I
> committed the gyrex.b3aggrcon for others to reproduce the problem.
> 
What error do you get locally?

> I also noted that I had to switch feature dependencies to "Compatible". The
> default (Greater or equal) did not produce the correct p2 version range.
> 
What did the incorrect version range look like?

> BTW, can someone point me to the special p2 instructions that prevent a feature
> from being installed into an IDE?

You add a requirement in an p2.inf file:

requires.1.namespace=A.PDE.Target.Platform
requires.1.name=Cannot be installed into the IDE
requires.1.range=0.0.0
Comment 6 Gunnar Wagenknecht CLA 2010-11-29 07:17:38 EST
(In reply to comment #5)
> (In reply to comment #0)
> > When verifying locally I get a different error than reported by Hudson. I
> > committed the gyrex.b3aggrcon for others to reproduce the problem.
> > 
> What error do you get locally?

See the attached screenshots. I'll try a re-build soon with the feature-dependencies removed.

> > I also noted that I had to switch feature dependencies to "Compatible". The
> > default (Greater or equal) did not produce the correct p2 version range.
> > 
> What did the incorrect version range look like?

It looked like a direct version dependency.
Comment 7 Thomas Hallgren CLA 2010-11-29 07:48:43 EST
(In reply to comment #6)
> > What did the incorrect version range look like?
> 
> It looked like a direct version dependency.

OK. Just to make sure. An open ended range (i.e. >=) should look like this:

1.0.0

whereas a the corresponding direct version dependency will be:

[1.0.0,1.0.0]

You claim that by using the Greater or Equal, you get the latter?
Comment 8 Gunnar Wagenknecht CLA 2010-11-29 08:25:13 EST
(In reply to comment #7)
> You claim that by using the Greater or Equal, you get the latter?

Frankly, I think it was the first not the latter. I have no proof because I converted to "compatible" and it's now ok and even better for my case.
Comment 9 Gunnar Wagenknecht CLA 2010-11-29 08:39:33 EST
It seems that b3 is unable to resolve included dependencies within the same repository. Not sure what is going on. 

I just tried with a new build that has the feature dependencies removed from feature.xml files. The error that I get now when verifying the repository is:

Gyrex Target Components (Incubation) 1.0.0.v20101129-1220-7L--F9kx82dfPt3af6wpIN9z0bVN (org.eclipse.gyrex.features.sdk.feature.group 1.0.0.v20101129-1220-7L--F9kx82dfPt3af6wpIN9z0bVN) requires 'org.eclipse.gyrex.features.kernel.feature.group [1.0.0.v20101124-1415-7A--F7RZHQHQQO28NrmW]

However, when I look into the repo using the editor I can see the corresponding IU:

org.eclipse.gyrex.features.kernel.feature.group / 1.0.0.v20101124-1415-7A--F7RZHQHQQO28NrmW (Gyrex Kernel (Incubation))



Could it be some underlying issue that is preventing IU 'rg.eclipse.gyrex.features.kernel.feature.group' from being resolved properly?
Comment 10 David Williams CLA 2010-11-29 19:53:48 EST
I think, maybe, the issue has to do with platform filters. 

Current error msg is 

Missing requirement: org.eclipse.gyrex.features.sdk.feature.group 1.0.0.v20101124-1920-7L--F9kw82d1TXvQlFnX0fCz-G1k requires 'org.eclipse.gyrex.features.kernel.source.feature.group [1.0.0.v20101124-1415-7A--F7RZHQHQQO-8OlhR]' but it could not be found

By looking in the content.xml file, I see that the sdk feature has no platform filter, which is the same as "any", but the source feature has a platform filter of 
 7303       <filter>
 7304         (&amp;(|(osgi.arch=x86)(osgi.arch=x86_64))(|(osgi.os=linux)(osgi.os=macosx)(osgi.os=win32))(|(osgi.ws=cocoa)(osgi.ws=gtk)(osgi.ws=win32)))
 7305       </filter>

So, I think what happens, in aggregator, is that when looking to aggregate the sdk feature, it is looking for dependencies that match versions constraints, and platform constraints, so its needs a feature that matches "any", basically. 

How/why does that source feature have platform constraints? I think they need to be removed ... or some added to sdk feature.
Comment 11 David Williams CLA 2010-11-29 19:57:21 EST
(In reply to comment #10)
> I think, maybe, the issue has to do with platform filters. 
> 

I meant to add ... this doesn't show up during an "install", because then p2 is looking for one and only one platform, so they all do match with that one platform. 

If this is indeed the issue, can the error msg be improved? I seem to recall this having happened a couple of times in the past.
Comment 12 Thomas Hallgren CLA 2010-11-30 01:41:17 EST
(In reply to comment #11)
> If this is indeed the issue, can the error msg be improved? I seem to recall
> this having happened a couple of times in the past.

The aggregator doesn't know the reason behind a resolution failure. We leave all that to the p2 planner. We use it's "Explanation support" feature to extract information about failures. Unfortunately, the explanation is not explicit down to filter details.

I suggest you add an enhancement request for more elaborate explanations to equinox/p2.

The filter will be a problem unless all requirements pointing to the filtered IU has the same filter as the IU itself but the problem will only manifest itself in environments where the filter evaluates to false. The Helios aggregation does include such environments.

So the key question is, what does the requirement for the source feature look like?
Comment 13 David Williams CLA 2010-11-30 01:56:59 EST
> 
> BTW, can someone point me to the special p2 instructions that prevent a feature
> from being installed into an IDE?

As far as I know (not that I would ... I haven't followed issue closely) the special magic is (still) to use a dependency on a special 
A.PDE.Target.Platform. You might read through bug 313873 and the bugs it points too ... but easiest way to get it working is to take a look at how RAP runtime does it, and following their example.
Comment 14 Thomas Hallgren CLA 2010-11-30 02:01:00 EST
(In reply to comment #13)

> ... You might read through bug 313873 and the bugs it points
> too ... but easiest way to get it working is to take a look at how RAP runtime
> does it, and following their example.

Or just follow my example from comment 5 ;-)
Comment 15 David Williams CLA 2010-11-30 02:08:38 EST
(In reply to comment #14)
> (In reply to comment #13)
> 
> > ... You might read through bug 313873 and the bugs it points
> > too ... but easiest way to get it working is to take a look at how RAP runtime
> > does it, and following their example.
> 
> Or just follow my example from comment 5 ;-)

Oh, sorry ... too much speed reading after my holiday. :)
Comment 16 David Williams CLA 2010-11-30 04:31:14 EST
> 
> I suggest you add an enhancement request for more elaborate explanations to
> equinox/p2.
> 

I have opened enhancement request bug 331403. 

Thanks,
Comment 17 Gunnar Wagenknecht CLA 2010-11-30 14:32:18 EST
(In reply to comment #10)
> I think, maybe, the issue has to do with platform filters. 

Good catch! Thanks David. The repo now validates fine in my local environment. Let's see if it now builds correctly on Hudson as well.

I'm closing this as WORKSFORME since a different issue was opened for the p2 enhancements.
Comment 18 David Williams CLA 2016-09-16 15:51:54 EDT
[Bookkeeping change only. Moving bugs to the new "home" of aggregator, CBI.
Made no changes to assignee's for closed bugs, even though some were old inbox.]