Skip to content

Project Cracker Output and Behavior Issues #624

@cloudRoutine

Description

@cloudRoutine

The ProjectCracker is a constant source of frustration for us while developing Ionide tools and for our users (although they rarely realize it) whether it's heisenbugs resolving project settings to pass to the compiler service or just falling short on a simple project evaluation

Personally I'm not a fan of how the project cracker runs msbuild in the background and starts creating files in a directory as soon as a project has been evaluated to provide editor services.
from

to

upon opening TextUtil.fs link to repository screencap'd

Furthermore the utility of the FSharp.Compiler.Service.ProjectCrackerTool.exe could use some improvement

λ» .\FSharp.Compiler.Service.ProjectCrackerTool.exe -h
{"LogOutput@":"At least two arguments required.","Options@":[],"ProjectFile@":"","ReferencedProjectOptions@":[]}

It shouldn't be necessary to read the src code to figure out that in order to get a text log of the cracked information you need to input

λ» .\FSharp.Compiler.Service.ProjectCrackerTool.exe FSharpTest.fsproj false --text
{ProjectFile = "FSharpTest.fsproj";
 Options =
  [|"--simpleresolution"; "--noframework";
    "--out:C:\Users\jared\Desktop\fsexp\clones\ionide-error-repro\FSharpTest\bin\Debug\FSharpTest.dll";
    "--doc:C:\Users\jared\Desktop\fsexp\clones\ionide-error-repro\FSharpTest\bin\Debug\FSharpTest.XML";
    "--subsystemversion:6.00"; "--highentropyva+"; "--fullpaths"; "--flaterrors";
    "--target:library"; "--define:DEBUG"; "--define:TRACE"; "--debug+";
    "--optimize-"; "--tailcalls-"; "--debug:full"; "--platform:anycpu";
    "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.0.0\FSharp.Core.dll";
    "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\mscorlib.dll";
    "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Core.dll";
    "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.dll";
    "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Numerics.dll";
    "C:\Users\jared\Desktop\fsexp\clones\ionide-error-repro\FSharpTest\AssemblyInfo.fs";
    "C:\Users\jared\Desktop\fsexp\clones\ionide-error-repro\FSharpTest\TextUtil.fs"|];
 ReferencedProjectOptions = [||];
 LogOutput = "";}

to get a proper output, yet at the same time the following input will fail

λ» .\FSharp.Compiler.Service.ProjectCrackerTool.exe FSharpTest.fsproj --text
{ProjectFile = "";
 Options = [||];
 ReferencedProjectOptions = [||];
 LogOutput = "At least two arguments required.";}

and really to get the output the commandline args can be

λ» .\FSharp.Compiler.Service.ProjectCrackerTool.exe FSharpTest.fsproj ItDoesntMatterWhatYouInput --text

instead of requiring false, which isn't the most intuitive behavior.
Another issue with output from an input array the tool can't properly process

{"LogOutput@":"At least two arguments required.","Options@":[],"ProjectFile@":"","ReferencedProjectOptions@":[]}

is that it implies an argument order different from what it actually accepts.

If the project cracker is going to build projects (which again I don't think it should) it should at least build them properly

λ» .\FSharp.Compiler.Service.ProjectCrackerTool.exe FSharpTest.fsproj false Configuration Release --text

shouldn't result in

where it's copying the references to the build output directory but not the actual dll produced as the result of the build.

When logging is enabled not being able to set the diagnostic level to something besides Microsoft.Build.Framework.LoggerVerbosity.Diagnostic is a nuisance.

There also doesn't seem to be a way to cancel a build being executed by the project cracker, unless I missed that somewhere.

@rneatherway thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions