diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e6128d9c25..2d60535d18 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.14.3 - 16.10.2015 +* COSMETICS: Fix error message when resolver already resolved to GlobalOverride - https://github.com/fsprojects/Paket/issues/1142 + #### 2.14.2 - 16.10.2015 * PERFORMANCE: Use locked version as prefered version when resolver strategy is min - https://github.com/fsprojects/Paket/pull/1141 diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index 1f1ff8e75c..66253e1545 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -188,8 +188,16 @@ let calcOpenRequirements (exploredPackage:ResolvedPackage,globalFrameworkRestric |> Set.filter (fun d -> if Set.contains d stillOpen then false else if Set.contains d closed then false else - if closed |> Seq.exists (fun x -> x.Name = d.Name && x.VersionRequirement.Range.IsIncludedIn d.VersionRequirement.Range) then false else - rest |> Seq.exists (fun x -> x.Name = d.Name && x.VersionRequirement.Range.IsIncludedIn d.VersionRequirement.Range) |> not) + if closed |> Seq.exists (fun x -> + x.Name = d.Name && + (x.VersionRequirement.Range.IsIncludedIn d.VersionRequirement.Range || + x.VersionRequirement.Range.IsGlobalOverride)) then + false + else + stillOpen |> Seq.exists (fun x -> + x.Name = d.Name && + (x.VersionRequirement.Range.IsIncludedIn d.VersionRequirement.Range || + x.VersionRequirement.Range.IsGlobalOverride)) |> not) |> Set.union rest type Resolved = { diff --git a/src/Paket.Core/VersionRange.fs b/src/Paket.Core/VersionRange.fs index 7cee6dd958..29316f062e 100644 --- a/src/Paket.Core/VersionRange.fs +++ b/src/Paket.Core/VersionRange.fs @@ -15,12 +15,12 @@ type PreReleaseStatus = | Concrete of string list /// Represents version information. -type VersionRange = +type VersionRange = | Minimum of SemVerInfo | GreaterThan of SemVerInfo | Maximum of SemVerInfo | LessThan of SemVerInfo - | Specific of SemVerInfo + | Specific of SemVerInfo | OverrideAll of SemVerInfo | Range of fromB : VersionRangeBound * from : SemVerInfo * _to : SemVerInfo * _toB : VersionRangeBound diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index a883f1e8c9..066fe6ff71 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -37,7 +37,7 @@ update group Build pack output D:\code\paketbug\output install - update -f + update Project paket.exe c:\code\Paketkopie @@ -45,7 +45,7 @@ d:\code\paketkopie d:\code\paketbug d:\code\paketrepro - d:\code\Paket + c:\code\Paketkopie pdbonly diff --git a/tests/Paket.Tests/Resolver/ConflictGraphSpecs.fs b/tests/Paket.Tests/Resolver/ConflictGraphSpecs.fs index 744d5b3b15..ce713a338c 100644 --- a/tests/Paket.Tests/Resolver/ConflictGraphSpecs.fs +++ b/tests/Paket.Tests/Resolver/ConflictGraphSpecs.fs @@ -67,4 +67,30 @@ let ``should override graph2 conflict to first version``() = [] let ``should override graph2 conflict to second version``() = let resolved = resolve graph2 ["A",VersionRange.AtLeast "1.0"; "D",VersionRange.OverrideAll(SemVer.Parse "1.6")] - getVersion resolved.[PackageName "D"] |> shouldEqual "1.6" \ No newline at end of file + getVersion resolved.[PackageName "D"] |> shouldEqual "1.6" + +let graph3 = + [ "A", "1.0", + [ "B", VersionRequirement(VersionRange.Exactly "1.1",PreReleaseStatus.No) + "C", VersionRequirement(VersionRange.Exactly "1.0",PreReleaseStatus.No) ] + "A", "1.1", [] + "B", "1.0", + [ "A", VersionRequirement(VersionRange.Exactly "1.1",PreReleaseStatus.No) + "C", VersionRequirement(VersionRange.Exactly "2.0",PreReleaseStatus.No) ] + "B", "1.1", [] + "C", "1.0", [] + "C", "2.0", [] ] + +[] +let ``should override graph3 conflict to package C``() = + let resolved = + safeResolve graph3 + ["A",VersionRange.OverrideAll(SemVer.Parse "1.0") + "B",VersionRange.OverrideAll(SemVer.Parse "1.0")] + + match resolved with + | Resolution.Ok _ -> failwith "we expected an error" + | Resolution.Conflict(_,stillOpen,_) -> + let conflicting = stillOpen |> Seq.head + conflicting.Name + |> shouldEqual (PackageName "C") \ No newline at end of file