Skip to content

Conversation

@nojaf
Copy link
Collaborator

@nojaf nojaf commented Nov 7, 2022

Hello,

I tried to create a failing unit test for #9 because I think I may have found a solution/workaround.

It is currently still a quite frustrating experience to collaborate on this branch.
I'll leave some pointers in this PR.

CheckMultipleInputsInParallel(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs)
| TypeCheckingMode.Graph ->
| _ ->
// `tcConfig.typeCheckingConfig.Mode` is not set correctly for unit tests `Compile graph-based`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This Mode was set to TypeCheckingMode.ParallelCheckingOfBackedImplFiles, even though the tests said compile {Method = Method.Graph; Project = project}.

I see they are not related but this was quite confusing as I was trying to add a failing unit test to draw out unsupported behaviour.

With this change, existing tests are not passing anymore.

Copy link
Owner

Choose a reason for hiding this comment

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

The issue was actually in setupCompilationMethod where I was setting the wrong value of typeCheckingMode. Have fixed this since.

let json = JsonConvert.SerializeObject(graphJson, Formatting.Indented)
let path = $"c:/projekty/fsharp/heuristic/FCS.deps.json"
System.IO.File.WriteAllText(path, json)
// let graphJson = graph.Graph |> Seq.map (fun (KeyValue(file, deps)) -> file.Name, deps |> Array.map (fun d -> d.Name)) |> dict
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I really want to pull the branch and run the tests.
This isn't very pleasant.

]
|> FProject.Make CompileOutput.Library

let emptyImplementation =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some other thing is failing when running this test.
A KeyNotFound exception in let fsQualifiedName = asts[fsName].QualifiedName (ParallelTypeChecking.fs).

The point of this code base is that this should fail because A.fs isn't implementing A.fsi.

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, I saw that last night and fixed since. Thanks for reporting 👍

try
let args = setupParsed config
let exit : int = CommandLineMain.mainAux(args, true, Some exiter)
let exit : int = CommandLineMain.mainAux2(args, true, Some exiter)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The code was not compiling after a pulling.

Copy link
Owner

Choose a reason for hiding this comment

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

Fixed

@nojaf
Copy link
Collaborator Author

nojaf commented Nov 7, 2022

Oh, and please give ASTOrX a better name.

Copy link
Owner

@safesparrow safesparrow left a comment

Choose a reason for hiding this comment

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

First of all: apologies for suggesting to work on a common branch without first cleaning it up.

I believe the issues you mentioned should be now fixed.
I tried to get rid of references to certain folder structures, but one stayed - C:/Program Files/... in fsc args files - not sure how to get rid of that one.

I tested this branch as far as I was able to by running the following script:

git clone https://github.com/safesparrow/fsharp parallel-tc
cd parallel-tc
git checkout heuristic_otel
./build.cmd -pack -noVisualStudio
cd tests/ParallelTypeCheckingTests/tests
./FCS.prepare.ps1 
# Open FSharp.sln in Rider
# Run all tests in ParallelTypeCheckingTests

After running this script, as long as you're running on Windows, all tests should be passing in Rider:
image
Any files it writes in tests it should write current directory.

If this doesn't work out-of-the-box, without any code changes, please let me know and I'll fix.

CheckMultipleInputsInParallel(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs)
| TypeCheckingMode.Graph ->
| _ ->
// `tcConfig.typeCheckingConfig.Mode` is not set correctly for unit tests `Compile graph-based`
Copy link
Owner

Choose a reason for hiding this comment

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

The issue was actually in setupCompilationMethod where I was setting the wrong value of typeCheckingMode. Have fixed this since.

try
let args = setupParsed config
let exit : int = CommandLineMain.mainAux(args, true, Some exiter)
let exit : int = CommandLineMain.mainAux2(args, true, Some exiter)
Copy link
Owner

Choose a reason for hiding this comment

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

Fixed

]
|> FProject.Make CompileOutput.Library

let emptyImplementation =
Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, I saw that last night and fixed since. Thanks for reporting 👍

@nojaf nojaf mentioned this pull request Nov 10, 2022
@nojaf
Copy link
Collaborator Author

nojaf commented Nov 10, 2022

Closing in favour of #11

@nojaf nojaf closed this Nov 10, 2022
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