From 0560eabbe2d556004404096517087c1c564dc685 Mon Sep 17 00:00:00 2001 From: Jared Hester Date: Sat, 3 Dec 2016 06:23:27 -0500 Subject: [PATCH] fix flag in outer loop stage --- src/Paket.Core/PackageResolver.fs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index 0772d225f6..386e684d7e 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -604,9 +604,9 @@ type private StepFlags (ready:bool,useUnlisted:bool,hasUnlisted:bool,forceBreak: type private Stage = - | Step of currentConflict : (ConflictState * ResolverStep * PackageRequirement) * priorConflictSteps : (ConflictState * ResolverStep * PackageRequirement) list - | Outer of currentConflict : (ConflictState * ResolverStep * PackageRequirement) * priorConflictSteps : (ConflictState * ResolverStep * PackageRequirement) list - | Inner of currentConflict : (ConflictState * ResolverStep * PackageRequirement) * priorConflictSteps : (ConflictState * ResolverStep * PackageRequirement) list + | Step of currentConflict : (ConflictState * ResolverStep * PackageRequirement) * priorConflictSteps : (ConflictState * ResolverStep * PackageRequirement * StepFlags) list + | Outer of currentConflict : (ConflictState * ResolverStep * PackageRequirement) * priorConflictSteps : (ConflictState * ResolverStep * PackageRequirement * StepFlags) list + | Inner of currentConflict : (ConflictState * ResolverStep * PackageRequirement) * priorConflictSteps : (ConflictState * ResolverStep * PackageRequirement * StepFlags) list /// Resolves all direct and transitive dependencies @@ -637,11 +637,11 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate let fuseConflicts currentConflict priorConflictSteps = match currentConflict, priorConflictSteps with - | currentConflict, (lastConflict,lastStep,lastRequirement)::priorConflictSteps -> + | currentConflict, (lastConflict,lastStep,lastRequirement,lastFlags)::priorConflictSteps -> let continueConflict = { currentConflict with VersionsToExplore = lastConflict.VersionsToExplore } - step (Inner((continueConflict,lastStep,lastRequirement),priorConflictSteps)) stackpack compatibleVersions flags + step (Inner((continueConflict,lastStep,lastRequirement),priorConflictSteps)) stackpack compatibleVersions lastFlags | currentConflict, [] -> currentConflict match stage with @@ -652,7 +652,7 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate Status = Resolution.Ok (cleanupNames currentStep.CurrentResolution) } match currentConflict, priorConflictSteps with - | currentConflict, (lastConflict,lastStep,lastRequirement)::priorConflictSteps -> + | currentConflict, (lastConflict,lastStep,lastRequirement,lastFlags)::priorConflictSteps -> let continueConflict = { currentConflict with VersionsToExplore = lastConflict.VersionsToExplore @@ -666,7 +666,7 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate r = lastRequirement || r.Graph |> List.contains lastRequirement)) -> let flags = - StepFlags(flags.Ready,flags.UseUnlisted,flags.HasUnlisted,true,flags.FirstTrial) + StepFlags(lastFlags.Ready,lastFlags.UseUnlisted,lastFlags.HasUnlisted,true,lastFlags.FirstTrial) step (Inner((continueConflict,lastStep,lastRequirement),priorConflictSteps)) stackpack compatibleVersions flags | _ -> @@ -739,7 +739,8 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate if not flags.UseUnlisted && flags.HasUnlisted && not currentConflict.Status.IsDone then - StepFlags(flags.Ready,true,flags.HasUnlisted,flags.ForceBreak,flags.FirstTrial) + // if it's been determined that an unlisted package must be used, ready must be set to false + StepFlags(false,true,flags.HasUnlisted,flags.ForceBreak,flags.FirstTrial) else StepFlags(true,flags.UseUnlisted,flags.HasUnlisted,flags.ForceBreak,flags.FirstTrial) @@ -784,7 +785,7 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate This will result in an endless loop.%sCurrent Requirement: %A%sRequirements: %A" Environment.NewLine currentRequirement Environment.NewLine nextStep.OpenRequirements - step (Step((currentConflict,nextStep,currentRequirement), (currentConflict,currentStep,currentRequirement)::priorConflictSteps)) stackpack compatibleVersions flags + step (Step((currentConflict,nextStep,currentRequirement), (currentConflict,currentStep,currentRequirement,flags)::priorConflictSteps)) stackpack compatibleVersions flags let startingStep = {