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

[WIP] Add test for #748 #749

Merged
merged 4 commits into from
Apr 3, 2017
Merged

[WIP] Add test for #748 #749

merged 4 commits into from
Apr 3, 2017

Conversation

alfonsogarciacaro
Copy link
Contributor

I cannot get the tests to run locally, neither for netcore or netfx, I see this:

Could not load file or assembly 'nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a
1eb7f44a77' or one of its dependencies. The system cannot find the file specified.

Cannot run the new test in FSI either. I see this:

> ``add files with same name from different folders`` ()
- ;;
dllName = "test.dll", args = [|"--simpleresolution"; "--noframework"; "--debug:full"; "--define:DEBUG";
  "--optimize-"; "--out:test.dll"; "--doc:test.xml"; "--warn:3"; "--fullpaths";
  "--flaterrors"; "--target:library";
  "c:\Users\Alfonso\dev\FSharp.Compiler.Service\tests\service/data/samename/folder1/a.fs";
  "c:\Users\Alfonso\dev\FSharp.Compiler.Service\tests\service/data/samename/folder2/a.fs";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.0.0\FSharp.Core.dll
"|]
System.IO.FileNotFoundException: Could not load file or assembly 'System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Let's see what CI says, then.

@alfonsogarciacaro
Copy link
Contributor Author

The test is failing :(

@alfonsogarciacaro
Copy link
Contributor Author

Wow, I can't believe this. Monkey patching worked first time! As @forki expected, FCS is not hitting the place where he put the fix for fcs.exe. After some navigation I copy & pasted the fix where it looked more plausible, but I'm not sure. @dsyme Could you please have a look? I don't know if I put the seen dictionary in the best place, it becomes a private member of IncrementalBuilder as I couldn't find a place to access all the ParsedInputs at once as in fsc.fs.

The best news is: it's working with Fable! Now I can go to sleep ;)

Copy link
Member

@forki forki left a comment

Choose a reason for hiding this comment

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

Don't forget to reintegrate that back to VF# again. Lol

@vasily-kirichenko
Copy link
Contributor

A single (cached, may be discarded) instance of IncrementalBuilder is created for each project, so it looks like a right place for seen cache.

@alfonsogarciacaro
Copy link
Contributor Author

@vasily-kirichenko Thanks for the comment. I assume this also means that IncrementalBuilder.ParseTask won't be accessing seen from a different thread.

Now that you say that @forki, I realize that we may have the opposite problem: fsc doesn't hit the code in this PR. So we have two options:

  • Keep the fix in the two places so it applies to both fsc and FCS. In that case it may be a good idea to convert the deduplicate function into a common helper (where?) parameterizing the seen dictionary.
  • Try to move the code to CompileOps.ParseOneInputFile which seems to be common place to obtain the ParsedInputs both in Deduplicate module names dotnet/fsharp#2728 and this PR. In that case we probably need to make seen a parameter of ParseOneInputFile as this is a module helper and I guess it's not good to make it dependent of a static mutable value.

@forki
Copy link
Member

forki commented Apr 1, 2017 via email

@forki
Copy link
Member

forki commented Apr 1, 2017

So @dsyme please merge this one and @alfonsogcnunez please amend this to your VF# PR (so that VS tooling gets it as well). I will take care of fsi.

@alfonsogarciacaro alfonsogarciacaro changed the title Add test for #748 [WIP] Add test for #748 Apr 2, 2017
@alfonsogarciacaro
Copy link
Contributor Author

I have published a new Fable version with a custom FCS binary and it's working for now. We can put this on hold until thinking a better way to consolidate the fix among FCS, fsc and fsi 👍

@dsyme dsyme merged commit 4a231d9 into fsharp:master Apr 3, 2017
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.

4 participants