Skip to content

MissingMethodException when running tests in the FSharp compiler repo #13557

@abelbraaksma

Description

@abelbraaksma

It appears that I can't run tests from the FSharp repo anymore (not sure since when, it's been a while), I get:

System.MissingMethodException : Method not found: 'Microsoft.FSharp.Core.FSharpOption`1<FsCheck.Replay> FsCheck.Config.get_Replay()'.

First run I did, after building, which went smooth:

> git checkout main
> git clean -xdf
> git fetch upstream
> build

Received the following errors with build -testFSharpCore (only first dozen or so shown):

D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fsi(12,22): error FS0039: The namespace 'Parser' is not defined. Maybe you want one of the following:?   PPParser [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fsi(69,115): error FS0039: The type 'token' is not defined. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fsi(69,115): error FS0039: The type 'token' is not defined. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fsi(76,13): error FS0039: The type 'token' is not defined. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fsi(114,66): error FS0039: The type 'token' is not defined. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fsi(116,57): error FS0039: The type 'token' is not defined. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fs(17,22): error FS0039: The namespace 'Parser' is not defined. Maybe you want one of the following:?   PPParser [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fs(47,68): error FS0039: The type 'token' is not defined. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fs(50,15): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]
D:\Projects\OpenSource\VisualFSharp\src\Compiler\SyntaxTree\LexHelpers.fs(53,23): error FS0039: The value or constructor 'IDENT' is not defined. Maybe you want one of the following:?   Ident?   IfdefNot?   int?   IfdefAnd?   IEvent [D:\Projects\OpenSource\VisualFSharp\src\Compiler\FSharp.Compiler.Service.fsproj]

Running the same command again, i.e. just build -testFSharpCore again, removes the above errors, but give me these instead (only the first few):

[xUnit.net 00:00:03.21]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.findBack is consistent [FAIL]
[xUnit.net 00:00:03.22]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.tryLast is consistent [FAIL]
[xUnit.net 00:00:03.22]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.last is consistent [FAIL]
[xUnit.net 00:00:03.22]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.zip3 is consistent for collections with equal length [FAIL]
[xUnit.net 00:00:03.22]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.splitInto is consistent [FAIL]
[xUnit.net 00:00:03.22]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.tail is consistent [FAIL]
[xUnit.net 00:00:03.22]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.mapFold is consistent [FAIL]
[xUnit.net 00:00:03.23]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.indexed is consistent [FAIL]
[xUnit.net 00:00:03.23]     FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.sortWith actually sorts (but is inconsistent in regards of stability) [FAIL]
  Failed FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.findBack is consistent [129 ms]
  Error Message:
   System.MissingMethodException : Method not found: 'Microsoft.FSharp.Core.FSharpOption`1<FsCheck.Replay> FsCheck.Config.get_Replay()'.
  Stack Trace:
     at FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.smallerSizeCheck[a](a testable)
   at FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.findBack is consistent() in D:\Projects\OpenSource\VisualFSharp\tests\FSharp.Core.UnitTests\FSharp.Core\Microsoft.FSharp.Collections\CollectionModulesConsistency.fs:line 281
  Failed FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.tryLast is consistent [2 ms]
  Error Message:
   System.MissingMethodException : Method not found: 'Microsoft.FSharp.Core.FSharpOption`1<FsCheck.Replay> FsCheck.Config.get_Replay()'.
  Stack Trace:
     at FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.smallerSizeCheck[a](a testable)
   at FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.tryLast is consistent() in D:\Projects\OpenSource\VisualFSharp\tests\FSharp.Core.UnitTests\FSharp.Core\Microsoft.FSharp.Collections\CollectionModulesConsistency.fs:line 1183
  Failed FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.last is consistent [2 ms]
  Error Message:
   System.MissingMethodException : Method not found: 'Microsoft.FSharp.Core.FSharpOption`1<FsCheck.Replay> FsCheck.Config.get_Replay()'.
  Stack Trace:
     at FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.smallerSizeCheck[a](a testable)
   at FSharp.Core.UnitTests.Collections.CollectionModulesConsistency.last is consistent() in D:\Projects\OpenSource\VisualFSharp\tests\FSharp.Core.UnitTests\FSharp.Core\Microsoft.FSharp.Collections\CollectionModulesConsistency.fs:line 561

Repro steps

As mentioned above: get a clean repo, and attempt to run the tests using build -testFSharpCore.

Expected behavior

Test run and typically succeed.

Actual behavior

Compiling was fine, at least the first time around.

Known workaround

Looking for them. If I check earlier reports, like this one #10968, it appears that the cause is the wrong version of FSharp.Core being picked up somehow.

Related information

  • Operating system: Win 10 or 11
  • VS 2022 installed, also earlier versions present, but not used
  • .NET Runtime kind: uses latest, it is downloaded by the build.cmd and placed in .dotnet dir.
  • Editing Tools: none, just using commandline (Developer Command Prompt for VS 2022).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions