dotnet / netcorecli-fsc

[DEPRECATED] F# and .NET Core SDK working together

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StackOverflowException when compiling with latest SDK in Debug mode

alfonsogarciacaro opened this issue · comments

After upgrading and building Fable with latest FSharp.NET.Sdk (1.0.2) I started getting StackOverflowExceptions when compiling big projects (the F# compiler itself). I've tried to debug the problem in many ways but I didn't find the cause until I realized that going back ttoFSharp.NET.Sdk 1.0.0-beta-060000 fixed the problem. It also seems that the latest version works if the Release config is used instead.

Is this intended? What are the options in Debug config that can cause the stack overflow, just --optimize-?

@alfonsogarciacaro so, just do dotnet build -v n to see fsc args.

you can rerun same fsc from command line, to check if crash (so without msbuild)

If is fsc who crash, open a bug in https://github.com/microsoft/visualfsharp/ repo, because is a regression with fsc, so is important.
The old FSharp.NET.Sdk referenced a previous version of fsc, just check dotnet build -v n paths.
you can also try new sdk with old fsc, just set <FscToolPath> property in msbuild (do dotnet build -v diag to show all properties, but is really verbose so redirect to file :D).

Please close this after you open a bug in vf# repo

Actually I was wrong, I'm getting the StackOverflow exception even when compiling in Release mode, which is very serious as it's a blocker to use the latest FSharp.NET.Sdk :( I'll report the problem in the VF# repo, thanks!

@enricosada The problem doesn't happen with FSharp.Compiler.Tools 4.1.0. Would it be possible to release a new FSharp.NET.Sdk that is tied to that version? It's the only way I have to use intellisense with Ionide at the moment :/

Sure, just add FscToolPath Property in the fsproj pointing to previous fsc directory.
So fsproj use new msbuild task (for intelllisense) an d previous compiler (without bug)
Let me write and example tomorrow morning

Thanks, that's working! 👏 I have added the FSharp.Compiler.Tools to the repo to avoid absolute paths (commit), not sure if that's the best way :)

BTW, the issue has been reported here: dotnet/fsharp#2682