Skip to content

Commit

Permalink
Paket.dependency with version ranges fails when package has pinned de…
Browse files Browse the repository at this point in the history
…pendency and that version is unlisted - fixes #1579
  • Loading branch information
forki committed Apr 7, 2016
1 parent b099dfe commit e79f45c
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 8 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.58.5 - 07.04.2016
* BUGFIX: Paket.dependency with version ranges failed when package has pinned dependency and that version is unlisted - https://github.com/fsprojects/Paket/issues/1579

#### 2.58.4 - 07.04.2016
* BUGFIX: Github dependencies reference transitive NuGet packages to projects - https://github.com/fsprojects/Paket/issues/1578

Expand Down
8 changes: 8 additions & 0 deletions integrationtests/Paket.IntegrationTests/UpdatePackageSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ let ``#1432 update doesn't throw Stackoverflow``() =
directPaket "pack templatefile paket.D.template version 1.0.0-prerelease output bin" scenario |> ignore
directPaket "update" scenario|> ignore

[<Test>]
let ``#1579 update allows unpinned``() =
let scenario = "i001579-unlisted"

prepare scenario
directPaket "pack templatefile paket.A.template version 1.0.0-prerelease output bin" scenario |> ignore
directPaket "update" scenario|> ignore

[<Test>]
let ``#1500 don't detect framework twice``() =
update "i001500-auto-detect" |> ignore
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
type file
id Paket.Test.A
owners Wooga
authors Wooga
owners Paket
authors Paket
projectUrl
https://github.com/
iconUrl
http://github.io/logo.png
licenseUrl
https://github.com/LICENSE.txt
requireLicenseAcceptance
false
copyright
Copyright 2015
tags
wdk
summary
Sbs Core Library
description
provides connecting to sbs on the network layer
dependencies
Mvvmlight == 4.2.30.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source bin
source https://www.nuget.org/api/v2

nuget Mvvmlight ~> 4

nuget Paket.Test.A
4 changes: 4 additions & 0 deletions integrationtests/scenarios/i001579-unlisted/before/paket.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NUGET
remote: bin
specs:
Paket.Test.A (1.0.0)
11 changes: 5 additions & 6 deletions src/Paket.Core/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ let Resolve(groupName:GroupName, sources, getVersionsF, getPackageDetailsF, glob
let ready = ref false
let state = ref conflictStatus
let useUnlisted = ref false
let allUnlisted = ref true
let hasUnlisted = ref false

while not !ready do
let trial = ref 0
Expand All @@ -466,8 +466,9 @@ let Resolve(groupName:GroupName, sources, getVersionsF, getPackageDetailsF, glob
match getExploredPackage(currentRequirement,versionToExplore) with
| None -> ()
| Some exploredPackage ->
hasUnlisted := exploredPackage.Unlisted || !hasUnlisted
if exploredPackage.Unlisted && not !useUnlisted then
()
()
else
let newFilteredVersions = Map.add currentRequirement.Name ([versionToExplore],globalOverride) filteredVersions

Expand All @@ -488,11 +489,9 @@ let Resolve(groupName:GroupName, sources, getVersionsF, getPackageDetailsF, glob
newResolution.Count > 1 &&
(conflicts |> Set.exists (fun r -> r = currentRequirement || r.Graph |> List.contains currentRequirement) |> not) ->
forceBreak := true
| _ -> ()
| _ -> ()

allUnlisted := exploredPackage.Unlisted && !allUnlisted

if not !useUnlisted && !allUnlisted && not (isOk()) then
if not !useUnlisted && !hasUnlisted && not (isOk()) then
useUnlisted := true
else
ready := true
Expand Down
1 change: 1 addition & 0 deletions src/Paket.Core/Requirements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ type PackageRequirement =
override this.ToString() =
sprintf "%O %O (from %O)" this.Name this.VersionRequirement this.Parent


override this.GetHashCode() = hash (this.Name,this.VersionRequirement)

member this.IncludingPrereleases() =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</DocumentationFile>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartArguments>install</StartArguments>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001578-transitive-ref\temp</StartWorkingDirectory>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001579-unlisted\temp\</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit e79f45c

Please sign in to comment.