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

Conversation

@alfonsogarciacaro
Copy link
Contributor

commented Mar 31, 2017

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

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2017

The test is failing :(

@alfonsogarciacaro

This comment has been minimized.

Copy link
Contributor Author

commented Apr 1, 2017

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 ;)

@forki
forki approved these changes Apr 1, 2017
Copy link
Member

left a comment

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

@vasily-kirichenko

This comment has been minimized.

Copy link
Contributor

commented Apr 1, 2017

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 1, 2017

@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 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

This comment has been minimized.

Copy link
Member

commented Apr 1, 2017

@forki

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2017

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
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.