fsprojects / fsprojects/FSharpLint

Running on project with TargetFrameworks including `net6.0` fails with: "The exception has been reported."

Open
#618 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
F#
Stars
327
Forks
74
PR merge metrics
No merged PRs in 30d

Description

Trying the tool with one sample:

git clone https://github.com/simontreanor/FunStripe.git
cd FunStripe
cd src
dotnet fsharplint lint FunStripe.fsproj

Expected: Run and produce a lot of issues.

Actual:

Lint failed while analysing FunStripe.fsproj.
Failed with: The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: One or more errors seen during provided type setup)
Stack trace:    at FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Error[b](ErrorLogger x, Exception exn) in D:\workspace\_work\1\s\src\fsharp\ErrorLogger.fs:line 390
   at FSharp.Compiler.CompilerImports.TcImports.ImportTypeProviderExtensions(CompilationThreadToken ctok, TcConfig tcConfig, String fileNameOfRuntimeAssembly, ILScopeRef ilScopeRefOfRuntimeAssembly, FSharpList`1 runtimeAssemblyAttributes, Entity entityToInjectInto, FSharpEvent`1 invalidateCcu, Range m) in D:\workspace\_work\1\s\src\fsharp\CompilerImports.fs:line 1395
   at FSharp.Compiler.CompilerImports.ccuRawDataAndInfos@1566-1.Invoke(Unit unitVar0) in D:\workspace\_work\1\s\src\fsharp\CompilerImports.fs:line 1570
   at FSharp.Compiler.CompilerImports.PrepareToImportReferencedFSharpAssembly@1581.Invoke(Unit unitVar0) in D:\workspace\_work\1\s\src\fsharp\CompilerImports.fs:line 1590
   at Microsoft.FSharp.Primitives.Basics.List.collectToFreshConsTail[T,TResult](FSharpFunc`2 f, FSharpList`1 list, FSharpList`1 cons) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\local.fs:line 439
   at Microsoft.FSharp.Primitives.Basics.List.collect[T,TResult](FSharpFunc`2 f, FSharpList`1 list) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\local.fs:line 447
   at FSharp.Compiler.CompilerImports.k@808-28(TcImports tcImports, FSharpList`1 _arg5) in D:\workspace\_work\1\s\src\fsharp\CompilerImports.fs:line 1672
   at FSharp.Compiler.CompilerImports.RegisterAndImportReferencedAssemblies@1659-4.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\CompilerImports.fs:line 1659
   at FSharp.Compiler.CompilerImports.BuildNonFrameworkTcImports@1910-1.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\CompilerImports.fs:line 1910
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@757-237.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 757
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@756-234.Invoke(CancellationToken ct)
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.f@728-103(CompilationGlobalsScope resource, FSharpChoice`2 res)
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@752-229.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 752
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@1028-263.Invoke(CancellationToken ct, FSharpOption`1 _arg1) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 1028
   at Internal.Utilities.Library.Eventually.steps[T](CancellationToken ct, FSharpOption`1 swinfo, Eventually`1 e) in D:\workspace\_work\1\s\src\fsharp\absil\illib.fs:line 913
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@1028-264.Invoke(CancellationToken ct, FSharpOption`1 swinfo) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 1028
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.toCancellableAux@854-4[a](CancellationToken ct, Eventually`1 e)
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@1108-273.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 1108
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.clo@1108-274.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 1108
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.GetCheckResultsBeforeSlotInProject@1218-1.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 1218
   at <StartupCode$FSharp-Compiler-Service>.$Service.ParseAndCheckFileInProject@689-20.Invoke(CancellationToken ct) in D:\workspace\_work\1\s\src\fsharp\service\service.fs:line 689
   at <StartupCode$FSharp-Compiler-Service>.$Reactor.EnqueueAndAwaitOpAsync@220-2.Invoke(CompilationThreadToken ctok) in D:\workspace\_work\1\s\src\fsharp\service\Reactor.fs:line 223
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 337
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInAnotherThread[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 851
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 886
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1148
   at FSharpLint.Framework.ParseFile.parse(String file, String source, FSharpChecker checker, FSharpProjectOptions options) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Core\Framework\ParseFile.fs:line 42
   at FSharpLint.Framework.ParseFile.parseFile(String file, FSharpChecker checker, FSharpOption`1 projectOptions) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Core\Framework\ParseFile.fs:line 73
   at FSharpLint.Application.Lint.parsedFiles@427.Invoke(String file) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Core\Application\Lint.fs:line 427
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\local.fs:line 250
   at FSharpLint.Application.Lint.parseFilesInProject@410(OptionalLintParameters optionalParams, Configuration config, FSharpFunc`2 projectProgress, FSharpFunc`2 warningReceived, FSharpChecker checker, FSharpList`1 files, FSharpProjectOptions projectOptions) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Core\Application\Lint.fs:line 424
   at FSharpLint.Application.Lint.lintProject$cont@396(OptionalLintParameters optionalParams, String projectFilePath, ToolsPath toolsPath, Unit unitVar) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Core\Application\Lint.fs:line 442
   at FSharpLint.Application.Lint.lintProject(OptionalLintParameters optionalParams, String projectFilePath, ToolsPath toolsPath) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Core\Application\Lint.fs:line 395
   at FSharpLint.Console.Program.start(ParseResults`1 arguments, ToolsPath toolsPath) in D:\a\FSharpLint\FSharpLint\src\FSharpLint.Console\Program.fs:line 122

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the FunStripe.fsproj commands in the issue and inspect FSharpLint.Core/Framework/ParseFile.fs, especially parse and parseFile, together with Application/Lint.fs around lintProject. Trace how project options for a TargetFrameworks entry including net6.0 reach FSharpChecker. Done means the project lints successfully and reports its issues instead of raising the compiler exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.