Skip to content

PackageResolver Refactor - #2039

Merged
forki merged 4 commits into
fsprojects:core3from
cloudRoutine:overflow
Nov 25, 2016
Merged

forki merged 4 commits into
fsprojects:core3from
cloudRoutine:overflow

Conversation

@cloudRoutine

@cloudRoutine cloudRoutine commented Nov 23, 2016 •

Copy link
Copy Markdown
Member

Started working on this in an attempt to address #2030

I wasn't able to get the step function to the point where its tail recursive, but its much closer than it was before and it no longer relies on mutation across iterations.

I think it should be possible by adding a third case to

type private Stage =
    | Outer of conflictState : ConflictState
    | Inner of conflictState : ConflictState

and using it as an argument for step to direct it down one of three pathways for the start of a step, an outer loop, or an inner loop, although when I tried coding that up I couldn't get it to work.

I think this is the block of code that was causing the issues when I took that approach

                    match conflictState.Status with
                    | Resolution.Conflict(_,conflicts,_,_)
                        when
                            (Set.isEmpty conflicts |> not)
                            && nextStep.CurrentResolution.Count > 1
                            && not (conflicts |> Set.exists (fun r ->
                                r = currentRequirement
                                || r.Graph |> List.contains currentRequirement)) ->
                        let flags = StepFlags(flags.Ready,flags.UseUnlisted,flags.HasUnlisted,true,flags.FirstTrial)
                        stepLoop flags (Inner (conflictState))
                    | _ ->
                        stepLoop flags (Inner (conflictState))

but I'm not totally sure.

Comment thread src/Paket.Core/PackageResolver.fs Outdated
|> Set.add lastPackageRequirement
|> Seq.filter (fun x -> x.Name = lastPackageRequirement.Name)
|> Seq.sortBy (fun x -> x.Parent)
|> Seq.filter ^ fun x -> x.Name = lastPackageRequirement.Name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

this is really really hard to review- can you please split it in two PRs. one with the resolver change and one with all the cosmetical changes? thanks

@cloudRoutine
cloudRoutine force-pushed the overflow branch 3 times, most recently from c562664 to b38b4e3 Compare November 23, 2016 12:59
@cloudRoutine

Copy link
Copy Markdown
Member Author

@forki this fine?

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

it seems the new resolver is not resolving correctly tests like ##1254 are red. can you confirm?

@cloudRoutine

Copy link
Copy Markdown
Member Author

a bug got reintroduced when I redid the commits

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

#1883 install FSharp.Core from Chessie fails!?

@cloudRoutine

cloudRoutine commented Nov 23, 2016 •

Copy link
Copy Markdown
Member Author

I've been having issues running the integration tests on my machine


I know I can move the dir, but maybe the integration tests don't need to pull in so many netcore packages?

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

yeah these new packages are fucking up everything. MS is clearly out of control here.

@cloudRoutine

Copy link
Copy Markdown
Member Author

even when I try to run the integration tests on the core3 branch they don't complete

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

do you have VS open at that time? or something else that keeps an handle on the nupkg?

@cloudRoutine

Copy link
Copy Markdown
Member Author

I had all of that stuff closed at the time. The first time I got those errors I thought that might be the source but when I tried again with everything off it still happened.

I get these errors when I run the tests just in VS too

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

And from fake build?

Am 23.11.2016 16:50 schrieb "Jared Hester" [email protected]:

I had all of that stuff closed at the time. The first time I got those
errors I thought that might be the source but when I tried again with
everything off it still happened.

I get these errors when I run the tests just in VS too

https://camo.githubusercontent.com/941f9899d827833319c461cb4c1171afb00f673f/687474703a2f2f692e696d6775722e636f6d2f50717949665a442e706e67

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2039 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNDMhgrvmLy6PeGchRuyJk5e8gBuDks5rBGDQgaJpZM4K6Nx6
.

@cloudRoutine

Copy link
Copy Markdown
Member Author

the log in the gist is from the FAKE build

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

Ok can you please try to find out which tool is locking it? Sorry for all the work, but this whole .net standard conversion is a real mess.

@forki

forki commented Nov 23, 2016

Copy link
Copy Markdown
Member

#1977 seems to work on appveyor. (travis is expected to fail)

@cloudRoutine

Copy link
Copy Markdown
Member Author

The readme might need a note to install F# 3.0, without it #144 will fail with

But even after I installed F# 3.0

@cloudRoutine

cloudRoutine commented Nov 23, 2016 •

Copy link
Copy Markdown
Member Author

ok it seems like the error is coming from netstandard getting installed with chessie
when I run the contents of test #1883 in FSI

@cloudRoutine

Copy link
Copy Markdown
Member Author

A more detailed output


let flags = StepFlags(flags.Ready,flags.UseUnlisted,hasUnlisted,flags.ForceBreak,flags.FirstTrial)
if exploredPackage.Unlisted && not flags.UseUnlisted then
tracefn " unlisted"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now i'm pretty sure the bug is here, where I last made a change 🤦
which I'd had as

                    if exploredPackage.Unlisted && not flags.UseUnlisted then
                        tracefn "     unlisted"
                        stepLoop flags (Inner(conflictState))
                    else

before, but that caused an infinite loop printing unlisted

@forki it'd be really useful for whoever has to work on this next, if you or someone else with a deeper understanding of what's going on in this module could add some comments explaining the processes. I'd do it myself, but I don't think I have a firm enough grasp and I wouldn't want to put down something that's wrong

@cloudRoutine

Copy link
Copy Markdown
Member Author

@forki finally passed on appveyor 🎉

@cloudRoutine

Copy link
Copy Markdown
Member Author

anything else I need to do for this?

@forki
forki merged commit e144fd8 into fsprojects:core3 Nov 25, 2016
@forki

forki commented Nov 25, 2016

Copy link
Copy Markdown
Member

thanks so much. let's what the real world thinks about it ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants