Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PackageResolver Refactor #2039

Merged
merged 4 commits into from Nov 25, 2016
Merged

PackageResolver Refactor #2039

merged 4 commits into from Nov 25, 2016

Conversation

cloudRoutine
Copy link
Member

@cloudRoutine cloudRoutine commented Nov 23, 2016

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.

currentStep.ClosedRequirements
|> Set.union currentStep.OpenRequirements
|> 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
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
Copy link
Member

forki commented Nov 23, 2016

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
Copy link
Member Author

@forki this fine?

@forki
Copy link
Member

forki commented Nov 23, 2016

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

@cloudRoutine
Copy link
Member Author

a bug got reintroduced when I redid the commits

@forki
Copy link
Member

forki commented Nov 23, 2016

#1883 install FSharp.Core from Chessie fails!?

@cloudRoutine
Copy link
Member Author

cloudRoutine commented Nov 23, 2016

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
Copy link
Member

forki commented Nov 23, 2016

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

@cloudRoutine
Copy link
Member Author

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

@forki
Copy link
Member

forki commented Nov 23, 2016

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

@cloudRoutine
Copy link
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
Copy link
Member

forki commented Nov 23, 2016

And from fake build?

Am 23.11.2016 16:50 schrieb "Jared Hester" notifications@github.com:

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
Member Author

the log in the gist is from the FAKE build

@forki
Copy link
Member

forki commented Nov 23, 2016

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
Copy link
Member

forki commented Nov 23, 2016

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

@cloudRoutine
Copy link
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
Copy link
Member Author

cloudRoutine commented Nov 23, 2016

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
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
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
Member Author

@forki finally passed on appveyor 🎉

@cloudRoutine
Copy link
Member Author

anything else I need to do for this?

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

forki commented Nov 25, 2016

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.

None yet

2 participants