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

Conversation

Projects
None yet
2 participants
@mrinaldi
Contributor

mrinaldi commented Oct 16, 2015

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)

mrinaldi added some commits Oct 16, 2015

Fixes comparison between AtLeast and AtLeast restrictions because
when a package has a restriction >= net35 and paket.dependencies
has a restriction >= net40, that dependency should be used
Fixes comparison between AtLeast and Between restrictions because
when a package has a restriction >= net35 < net452 and paket.dependencies
has a restriction >= net40, that dependency should be used
Fixes comparison between Between and Between restrictions because
when a package has a restriction >= net30 < net35 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
Fixes comparison between Between and Between restrictions because
when a package has a restriction >= net451 < net46 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
Fixes comparison between Between and Exactly restrictions because
when a package has a restriction net451 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
Fixes comparison between Between and Exactly restrictions because
when a package has a restriction net35 and paket.dependencies
has a restriction >= net40 < net451, that dependency should not be used
Fixes comparison between Between and AtLeast restrictions because
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

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mrinaldi mrinaldi deleted the mrinaldi:filter_by_restrictions branch Oct 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment