Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter by restrictions #1146

Merged
merged 7 commits into from
Oct 17, 2015
Merged

Conversation

mrinaldi
Copy link
Contributor

Using a restriction in paket.dependencies, it wouldn't reference the dependencies depending on the restrictions it has.

Examples that were fixed:
>= net35 would not be referenced when paket.dependencies has a >= net40 restriction.
>= net35 < net452 would not be referenced when paket.dependencies has a >= net40 restriction.

Moreover, it would not filter at all dependencies when ranged restrictions were used in paket.dependencies.

Here is a small repro:

framework >= net45
source https://nuget.org/api/v2

nuget Microsoft.Owin.Host.SystemWeb ~> 2.1

Running paket install would generate the following incorrect paket.lock

FRAMEWORK: >= NET45
NUGET
  remote: https://nuget.org/api/v2
  specs:
    Microsoft.Owin.Host.SystemWeb (2.1.0)

On the other hand, the below file would also generate an incorrect paket.lock

framework >= net45 < net46
source https://nuget.org/api/v2

nuget Microsoft.Owin.Host.SystemWeb ~> 2.1
FRAMEWORK: >= NET45 < NET46
NUGET
  remote: https://nuget.org/api/v2
  specs:
    Microsoft.Owin (3.0.1)
      Owin (>= 1.0)
    Microsoft.Owin.Host.SystemWeb (2.1.0)
      Microsoft.Owin (>= 2.1.0) - framework: >= net40
      Microsoft.Web.Infrastructure (>= 1.0.0.0) - framework: net40
      Owin (>= 1.0) - framework: >= net40
    Microsoft.Web.Infrastructure (1.0.0)
    Owin (1.0.0)

This is the correct paket.lock for both cases:

FRAMEWORK: >= NET45
NUGET
  remote: https://nuget.org/api/v2
  specs:
    Microsoft.Owin (3.0.1)
      Owin (>= 1.0)
    Microsoft.Owin.Host.SystemWeb (2.1.0)
      Microsoft.Owin (>= 2.1.0) - framework: >= net40
      Owin (>= 1.0) - framework: >= net40
    Owin (1.0.0)

when a package has a restriction >= net35 and paket.dependencies
has a restriction >= net40, that dependency should be used
when a package has a restriction >= net35 < net452 and paket.dependencies
has a restriction >= net40, that dependency should be used
when a package has a restriction >= net30 < net35 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
when a package has a restriction >= net451 < net46 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
when a package has a restriction net451 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
when a package has a restriction net35 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
when a package has a restriction >= net451 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
@forki forki merged commit 98164fd into fsprojects:master Oct 17, 2015
@mrinaldi mrinaldi deleted the filter_by_restrictions branch October 18, 2015 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants