Skip to content

Filter by restrictions - #1146

Merged
forki merged 7 commits into
fsprojects:masterfrom
mrinaldi:filter_by_restrictions
Oct 17, 2015
Merged

forki merged 7 commits into
fsprojects:masterfrom
mrinaldi:filter_by_restrictions

Conversation

@mrinaldi

Copy link
Copy Markdown
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.

2 participants