[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] ant-ivy pull request #74: Fix IVY-982 by subtracting negated entries from wi...

GitHub user aprelev opened a pull request:


    Fix IVY-982 by subtracting negated entries from wildcard bin

    ### Issue
    Configurations negation (exclusion) as in `conf="*, !foo->@"` does not work,
    This issue is reported in [IVY-982](https://issues.apache.org/jira/browse/IVY-982) and [IVY-1547](https://issues.apache.org/jira/browse/IVY-1547).
    ### Why does it happen?
    Resolve engine silently disrespects negation on the left part of maps-to operator because the exclusion was not implemented. When parsing dependency, e.g. `conf="*, !foo â?? bar1; foo â?? bar2, bar3; % â?? bar4"`, all dependency configurations are collected into bins (map entries):
    - *all-wildcard bin* with all configurations required for `*` superset, 
    such as `bar1` in bin `*`;
    - *others-wildcard bin* with all configurations required for `%` superset, 
    such as `bar4` in bin `%`;
    - *explicit bins* for all explicit mappings, 
    such as `bar2` and `bar3` in bin `foo`, and `bar1` in bin `!foo`.
    Resolving list of dependency configurations required for some target configuration `X` is done as follows:
    1. All configurations from `X`'s *explicit bin* [are added](https://github.com/apache/ant-ivy/blob/89583444040dc5423bb143435f23ae0814f24542/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java#L347).
    2. All configurations from *others-wildcard bin* [are added](https://github.com/apache/ant-ivy/blob/89583444040dc5423bb143435f23ae0814f24542/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java#L350) in case `X`'s *explicit bin* is empty.
    3. All configurations from *all-wildcard bin* [are added](https://github.com/apache/ant-ivy/blob/89583444040dc5423bb143435f23ae0814f24542/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java#L358).
    Note that explicit bins for negated target configurations *are not referenced, and thus silently ignored*. This fix introduces fourth step:
    4. All configurations from `!X`'s *explicit bin* are removed.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aprelev/ant-ivy issue-ivy-1547-982

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #74
commit 0c2c826e4c316fdcf42fd890097edef478b692a3
Author: Aprelev Arseny <aprelev.arseny@...>
Date:   2018-08-06T14:21:21Z

    Fix IVY-982 by subtracting negated entries from wildcard bin



To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxx