Skip to content

Commit

Permalink
Better trace of available versions when resolver fails to find a version
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Aug 13, 2015
1 parent 05d687f commit ee7f06a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/Paket.Core/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,15 @@ let Resolve(getVersionsF, getPackageDetailsF, globalFrameworkRestrictions, rootD
List.filter (fun v -> currentRequirement.VersionRequirement.IsInRange(v,currentRequirement.Parent.IsRootRequirement() |> not)) versions

if !compatibleVersions = [] then
if currentRequirement.Parent.IsRootRequirement() then
let versionText = String.Join(Environment.NewLine + " - ",List.sort !availableVersions)
if currentRequirement.Parent.IsRootRequirement() then
let versionText =
let versions =
if !availableVersions = [] then
getAllVersions(currentRequirement.Sources,currentRequirement.Name,currentRequirement.VersionRequirement.Range)
else
!availableVersions

String.Join(Environment.NewLine + " - ",List.sortDescending versions)
failwithf "Could not find compatible versions for top level dependency:%s %A%s Available versions:%s - %s%s Try to relax the dependency or allow prereleases."
Environment.NewLine (String.Join(Environment.NewLine + " ", currentRequirements |> Seq.map string)) Environment.NewLine Environment.NewLine versionText Environment.NewLine
else
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<WarningLevel>3</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<StartArguments>install</StartArguments>
<StartWorkingDirectory>D:\code\Paketkopie</StartWorkingDirectory>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>D:\code\PaketKopie</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand Down

0 comments on commit ee7f06a

Please sign in to comment.