From 2625e15acbd8118882508b8a101ba4bf499ec62b Mon Sep 17 00:00:00 2001 From: Jared Hester Date: Sat, 3 Dec 2016 06:23:27 -0500 Subject: [PATCH] store prior step's flags to cut resolution time --- src/Paket.Core/PackageResolver.fs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index 0772d225f6..76334ca931 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 | _ -> @@ -784,7 +784,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 = {