Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321756 - What should happen if exclude an IU from an explicitly mapped Category?
Summary: What should happen if exclude an IU from an explicitly mapped Category?
Status: RESOLVED FIXED
Alias: None
Product: CBI
Classification: Technology
Component: CBI p2 Repository Aggregator (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 12:39 EDT by Miles Daffin CLA
Modified: 2016-09-16 15:59 EDT (History)
5 users (show)

See Also:


Attachments
Config file for B3 (1.38 KB, text/plain)
2011-11-23 04:10 EST, Julien HENRY CLA
no flags Details
Case of "Cannot complete the install because some dependencies are not satisfiable" (1.73 KB, text/plain)
2011-11-28 07:16 EST, Julien HENRY CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miles Daffin CLA 2010-08-04 12:39:08 EDT
At the moment exclusions only seem to work if a repo is mapped verbatim. If I explicitly map a category then exclude an IU from that category the explicit mapping wins, and the excluded IU is included in the model. This makes sense, however there are occasions when this makes things harder to model. Take an example repo with 10 categories. I only want 8 of these, and do not want some of the IUs from these 8 categories. This can only be achieved now by re-creating categories using custom categories and then explicitly adding selected IUs to these, omitting those we do not want. How hard would it be to try always to honour exclusions, and to error if they cannot be honoured, forcing the modeller to review their model? If this would be too complicated then fine. Version ranges now make models much more robust, so explicitly mapping IUs is not such a maintenance chore. However, it would be nice to be warned, somehow, that the exclusion was ineffective because overridden by the explicit mapping.
Comment 1 Julien HENRY CLA 2011-11-18 10:00:33 EST
Same question when you want to include a list of feature, but want to exclude a transitive optional feature.
For example I have mapped the repository: http://dist.springsource.com/release/TOOLS/update/e3.7/

From this repository I only want a few features. So I have added the feature:
<features name="org.springframework.ide.eclipse.integration.feature.feature.group" categories="//@customCategories[identifier='com.macif.eclipse.spring.category']"/>

This feature depends on the feature "Spring Core" (org.springframework.ide.eclipse.feature) that depends on the feature "org.springframework.ide.eclipse.uaa.feature" but it is an optional dependency.

So I would like to remove uaa from my aggregated repo. But the exclusion doesn't work.

The workaround is to not include any feature at all, but instead exclude every other features. Very annoying.
Comment 2 Thomas Hallgren CLA 2011-11-18 10:39:57 EST
Excluding something from the transitive scope would violate the parent requirement. That is the reason why forcing such an exclusion will be very hard to implement.

In order to make it work, the aggregator would have to perform surgical modifications to the IU's that hold the requirements to the excluded IU. That in turn would imply changing the id's of those IU's to something else since IU's are assumed to be immutable.

There's no way of knowing if the transitive scope will include an excluded IU until the validation has completed. I can agree that it would make sense to log a warning like "Excluded IU included transitively" or similar, when that happens.
Comment 3 Thomas Hallgren CLA 2011-11-18 11:09:04 EST
I've been thinking a bit more on this. Perhaps a better solution would be to add a negative requirement for the excluded feature. I.e. a requirement that prevents it from being included in the plan. This would mean that any transitive requirement that isn't optional would cause the validation to fail. Optional requirements would simply be skipped though.
Comment 4 Miles Daffin CLA 2011-11-18 12:00:31 EST
I think this sounds fine Thomas, as long as the validation failure message is good, e.g. "You have excluded a non-optional, transitive dependency..." Something like that, with absolute model paths for both the exclusion rule and the dependency (like we have now for other validation problems).
Comment 5 Julien HENRY CLA 2011-11-21 05:43:49 EST
(In reply to comment #1)
> Same question when you want to include a list of feature, but want to exclude a
> transitive optional feature.

> 
> The workaround is to not include any feature at all, but instead exclude every
> other features. Very annoying.

Note that in fact the workaround do not work. I have mapped a repository and excluding every features but featureA. featureA has an optional dependency on featureB. featureB is excluded.
The resulting repository contains featureB...

So I have currently no way to solve this issue.
Comment 6 Thomas Hallgren CLA 2011-11-22 05:44:38 EST
I'm currently looking into this. It would be helpful if you could attach a b3aggr file to this bugzilla that we can use as base for discussion and test.
Comment 7 Julien HENRY CLA 2011-11-23 04:10:47 EST
Created attachment 207404 [details]
Config file for B3

With this B3 config file I want to create an aggregated repo containing indigo and a few JBoss tools (2 features). The 2 features have an optional dependency on "usage" feature. I want this feature be removed from the aggregated repo so I have added an exclusion but it is not taken into account.
Comment 8 Thomas Hallgren CLA 2011-11-24 11:18:07 EST
I changed the implementation to use the negative requirement that I suggested in comment #3. It seems to work well.

Julien, in order to exclude the jboss.tools.usage stuff it was necessary to exclude the bundle. Excluding the feature didn't help much. In order to fix that kind of problem, I had to extend the list of possible IU's for a map rule to also include bundles.

Fixed on master with commit http://git.eclipse.org/c/b3/b3.git/commit/?id=6165ea694d857890b8ab9d8a8c8fc2ddeb3d08f9
Comment 9 Julien HENRY CLA 2011-11-24 11:55:00 EST
Many thanks! Is there a place where I can get an updated version of B3? Maybe a test update site?
Comment 10 Thomas Hallgren CLA 2011-11-24 15:37:30 EST
This change has been pushed to our regular update site.
Comment 11 Julien HENRY CLA 2011-11-25 10:16:57 EST
I have just tested to exclude a few features and bundles but it seems one of the exclusions is not optional so I get the following error when doing "Validate aggregation":

!ENTRY org.eclipse.b3.util 4 -364274674 2011-11-25 16:13:46.860
!MESSAGE Build failed! Exception was org.eclipse.core.runtime.CoreException: Cannot complete the install because some dependencies are not satisfiable
!STACK 1
org.eclipse.core.runtime.CoreException: Cannot complete the install because some dependencies are not satisfiable
	at org.eclipse.b3.aggregator.engine.ValidationSetVerifier.run(ValidationSetVerifier.java:677)
	at org.eclipse.b3.aggregator.engine.Builder.runRepositoryVerifier(Builder.java:1700)
	at org.eclipse.b3.aggregator.engine.Builder.run(Builder.java:1631)
	at org.eclipse.b3.aggregator.presentation.AggregatorActionBarContributor$BuildAggregationAction$1.run(AggregatorActionBarContributor.java:292)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!SUBENTRY 1 org.eclipse.equinox.p2.director 0 1 2011-11-25 16:13:46.860
!MESSAGE Cannot complete the install because some dependencies are not satisfiable

Would it be possible to have at least the name of the dependency that is not satisfiable? Currently it is very hard to sort.
Comment 12 Thomas Hallgren CLA 2011-11-25 11:02:32 EST
It really should show you a much nicer information than this. You don't get anything in the console?
Comment 13 Julien HENRY CLA 2011-11-28 05:26:51 EST
I'm running B3 from Eclipse (right click on the root element then build aggregation). There is nothing in the console. Only the error view displays some logs (seems it is simply a visual presentation of workspace/.metadata/.log).
there is nothing more than what I show in my previous comment.
Comment 14 Thomas Hallgren CLA 2011-11-28 05:43:17 EST
Can you attach an aggregation that I can look at that shows this symptom?
Comment 15 Julien HENRY CLA 2011-11-28 07:16:49 EST
Created attachment 207593 [details]
Case of "Cannot complete the install because some dependencies are not satisfiable"
Comment 16 Stephan Herrmann CLA 2013-10-07 14:41:13 EDT
Did anyone file a follow-up issue for the problem from comment 11 ff ?
I'm seeing the same unhelpful error right now. Not even logLevel DEBUG gives anything actionable.

The strange thing: the same feature that I try to aggregate can be installed into eclipse from the same set of repositories as specified in the aggregation.

What causes the validation to throw a CoreException with no relevant details?

The same exception occurs within the IDE and when running b3 headless.
B3 may be either 4.2 or 4.3, no difference.
Comment 17 David Williams CLA 2016-09-16 15:59:49 EDT
[Bookkeeping change only. Moving bugs to the new "home" of aggregator, CBI.
No change to assignee for resolved and verified bugs.]