From 6d98435979266712b73cc53e6e33cd7392e6c578 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:05:26 +0000 Subject: [PATCH 1/5] Initial plan From 7ad832652b32988334a169630ddfb159566b15fe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:41:36 +0000 Subject: [PATCH 2/5] Fix SignatureHash to include constant values in hash computation - Add hashConst function with exhaustive pattern matching over Const type - Modify hashNonMemberVal to include literal constant value in hash for deterministic builds - This ensures MVIDs change when constant values change (fixes #18758) Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- src/Compiler/Utilities/TypeHashing.fs | 32 +++++++++++++- .../CodeGen/EmittedIL/DeterministicTests.fs | 18 ++++++++ .../_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx | 42 +++++++++++++++++++ .../_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx | 42 +++++++++++++++++++ 4 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx create mode 100644 tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx diff --git a/src/Compiler/Utilities/TypeHashing.fs b/src/Compiler/Utilities/TypeHashing.fs index 7907c2148dc..1d4d3052525 100644 --- a/src/Compiler/Utilities/TypeHashing.fs +++ b/src/Compiler/Utilities/TypeHashing.fs @@ -302,6 +302,28 @@ module HashTastMemberOrVals = combinedHash + /// Hash a constant value with exhaustive pattern matching over all Const cases + let private hashConst (constVal: Const) : Hash = + match constVal with + | Const.Bool b -> hash b + | Const.SByte x -> hash x + | Const.Byte x -> hash x + | Const.Int16 x -> hash x + | Const.UInt16 x -> hash x + | Const.Int32 x -> hash x + | Const.UInt32 x -> hash x + | Const.Int64 x -> hash x + | Const.UInt64 x -> hash x + | Const.IntPtr x -> hash x + | Const.UIntPtr x -> hash x + | Const.Single x -> hash x + | Const.Double x -> hash x + | Const.Char x -> hash x + | Const.String x -> hashText x + | Const.Decimal x -> hash x + | Const.Unit -> hash "()" + | Const.Zero -> hash "Zero" + let private hashNonMemberVal (g: TcGlobals, observer) (tps, v: Val, tau, cxs) = if HashAccessibility.isHiddenToObserver v.Accessibility observer then 0 @@ -313,8 +335,14 @@ module HashTastMemberOrVals = let typeHash = hashTopType g argInfos retTy cxs let flagsHash = hash v.val_flags.PickledBits let attribsHash = hashAttributeList v.Attribs - - let combinedHash = nameHash @@ typarHash @@ typeHash @@ flagsHash @@ attribsHash + + // Include literal constant value in hash for deterministic builds + let constHash = + match v.LiteralValue with + | Some constVal -> hashConst constVal + | None -> 0 + + let combinedHash = nameHash @@ typarHash @@ typeHash @@ flagsHash @@ attribsHash @@ constHash combinedHash let hashValOrMemberNoInst (g, obs) (vref: ValRef) = diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs index c29c0ecb8a5..ad43e5b7bf0 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs @@ -333,3 +333,21 @@ let inline myFunc x y = x - y""" Assert.Equal(mvid1,mvid2) else Assert.NotEqual(mvid1,mvid2) + + [] + let ``Reference assemblies MVID must change when literal constant value changes`` () = + let codeWithLiteral42 = """ +module TestModule +[] +let X = 42 +""" + + let codeWithLiteral43 = """ +module TestModule +[] +let X = 43 +""" + + let mvid1, mvid2 = calculateRefAssMvids codeWithLiteral42 codeWithLiteral43 + // Different literal values should produce different MVIDs + Assert.NotEqual(mvid1, mvid2) diff --git a/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx b/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx new file mode 100644 index 00000000000..061e588883d --- /dev/null +++ b/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) +[xUnit.net 00:00:00.10] Discovering: FSharpSuite.Tests +[xUnit.net 00:00:00.21] Discovered: FSharpSuite.Tests +[xUnit.net 00:00:00.21] Starting: FSharpSuite.Tests + + + + + [xUnit.net 00:00:00.28] FSharpSuite.Tests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. + ---> System.Exception: Couldn't find "FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.compiler.interactive.settings/debug/netstandard2.0/fsharp.compiler.interactive.settings.dll". Running 'build test' once might solve this issue + at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 + at TestFramework.requireArtifact@326.Invoke(String path) + at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 337 + at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 + --- End of inner exception stack trace --- + at TestFramework.get_initialConfig() + at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 + at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 + at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 + at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 + at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 + at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 + + + No test matches the given testcase filter `Reference assemblies MVID must change when literal constant value changes` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharpSuite.Tests/Debug/net9.0/FSharpSuite.Tests.dll + + + + \ No newline at end of file diff --git a/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx b/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx new file mode 100644 index 00000000000..f0879233a5b --- /dev/null +++ b/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) +[xUnit.net 00:00:00.15] Discovering: FSharpSuite.Tests +[xUnit.net 00:00:00.32] Discovered: FSharpSuite.Tests +[xUnit.net 00:00:00.34] Starting: FSharpSuite.Tests + + + + + [xUnit.net 00:00:00.43] FSharpSuite.Tests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. + ---> System.Exception: Couldn't find "FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.compiler.interactive.settings/debug/netstandard2.0/fsharp.compiler.interactive.settings.dll". Running 'build test' once might solve this issue + at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 + at TestFramework.requireArtifact@326.Invoke(String path) + at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 337 + at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 + --- End of inner exception stack trace --- + at TestFramework.get_initialConfig() + at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 + at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 + at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 + at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 + at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 + at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 + + + No test matches the given testcase filter `Simple assembly should be deterministic` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharpSuite.Tests/Debug/net9.0/FSharpSuite.Tests.dll + + + + \ No newline at end of file From 7e5336ecc5280b83db915c4537570fa0e8108964 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:27:27 +0000 Subject: [PATCH 3/5] Address feedback: optimize constant hashing and remove test file Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .gitignore | 3 ++ src/Compiler/Utilities/TypeHashing.fs | 18 ++++---- .../_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx | 42 ------------------- 3 files changed, 12 insertions(+), 51 deletions(-) delete mode 100644 tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx diff --git a/.gitignore b/.gitignore index 6ca107a5779..0330883185d 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,6 @@ positive.exe *.bsl.actual /src/FSharp.DependencyManager.Nuget/StandardError.txt /src/FSharp.DependencyManager.Nuget/StandardOutput.txt + +# Test result files +tests/**/TestResults/*.trx diff --git a/src/Compiler/Utilities/TypeHashing.fs b/src/Compiler/Utilities/TypeHashing.fs index 1d4d3052525..d91983e3b27 100644 --- a/src/Compiler/Utilities/TypeHashing.fs +++ b/src/Compiler/Utilities/TypeHashing.fs @@ -321,8 +321,8 @@ module HashTastMemberOrVals = | Const.Char x -> hash x | Const.String x -> hashText x | Const.Decimal x -> hash x - | Const.Unit -> hash "()" - | Const.Zero -> hash "Zero" + | Const.Unit -> 0 + | Const.Zero -> 0 let private hashNonMemberVal (g: TcGlobals, observer) (tps, v: Val, tau, cxs) = if HashAccessibility.isHiddenToObserver v.Accessibility observer then @@ -336,14 +336,14 @@ module HashTastMemberOrVals = let flagsHash = hash v.val_flags.PickledBits let attribsHash = hashAttributeList v.Attribs + let combinedHash = nameHash @@ typarHash @@ typeHash @@ flagsHash @@ attribsHash + // Include literal constant value in hash for deterministic builds - let constHash = - match v.LiteralValue with - | Some constVal -> hashConst constVal - | None -> 0 - - let combinedHash = nameHash @@ typarHash @@ typeHash @@ flagsHash @@ attribsHash @@ constHash - combinedHash + match v.LiteralValue with + | Some constVal -> + let constHash = hashConst constVal + combinedHash @@ constHash + | None -> combinedHash let hashValOrMemberNoInst (g, obs) (vref: ValRef) = match vref.MemberInfo with diff --git a/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx b/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx deleted file mode 100644 index 061e588883d..00000000000 --- a/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_40_57.trx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) -[xUnit.net 00:00:00.10] Discovering: FSharpSuite.Tests -[xUnit.net 00:00:00.21] Discovered: FSharpSuite.Tests -[xUnit.net 00:00:00.21] Starting: FSharpSuite.Tests - - - - - [xUnit.net 00:00:00.28] FSharpSuite.Tests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. - ---> System.Exception: Couldn't find "FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.compiler.interactive.settings/debug/netstandard2.0/fsharp.compiler.interactive.settings.dll". Running 'build test' once might solve this issue - at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 - at TestFramework.requireArtifact@326.Invoke(String path) - at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 337 - at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 - --- End of inner exception stack trace --- - at TestFramework.get_initialConfig() - at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 - at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 - at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 - at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 - at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 - at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 - - - No test matches the given testcase filter `Reference assemblies MVID must change when literal constant value changes` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharpSuite.Tests/Debug/net9.0/FSharpSuite.Tests.dll - - - - \ No newline at end of file From aa0f591e3b68662178cfc27d07fcc2789c3e91a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:42:18 +0000 Subject: [PATCH 4/5] Remove test results file and add release notes entry Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../.FSharp.Compiler.Service/10.0.100.md | 1 + .../_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx | 42 ------------------- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index c7f68777166..8f52efcf7e5 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -4,6 +4,7 @@ ### Fixed +* Fix SignatureHash to include constant values in hash computation ([Issue #18758](https://github.com/dotnet/fsharp/issues/18758)) * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fix parsing errors using anonymous records and code quotations ([PR #18603](https://github.com/dotnet/fsharp/pull/18603)) * Better error message for attribute targets. ([PR #18641](https://github.com/dotnet/fsharp/pull/18641)) diff --git a/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx b/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx deleted file mode 100644 index f0879233a5b..00000000000 --- a/tests/fsharp/TestResults/_pkrvmq0rgcvqdmg_2025-07-21_15_41_19.trx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) -[xUnit.net 00:00:00.15] Discovering: FSharpSuite.Tests -[xUnit.net 00:00:00.32] Discovered: FSharpSuite.Tests -[xUnit.net 00:00:00.34] Starting: FSharpSuite.Tests - - - - - [xUnit.net 00:00:00.43] FSharpSuite.Tests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. - ---> System.Exception: Couldn't find "FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Compiler.Interactive.Settings/Debug/netstandard2.0/FSharp.Compiler.Interactive.Settings.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.compiler.interactive.settings/debug/netstandard2.0/fsharp.compiler.interactive.settings.dll". Running 'build test' once might solve this issue - at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 - at TestFramework.requireArtifact@326.Invoke(String path) - at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 337 - at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 - --- End of inner exception stack trace --- - at TestFramework.get_initialConfig() - at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 - at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 - at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 - at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 - at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 - at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 - - - No test matches the given testcase filter `Simple assembly should be deterministic` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharpSuite.Tests/Debug/net9.0/FSharpSuite.Tests.dll - - - - \ No newline at end of file From a6ce065ce1fb6694893d9287e197053a2aa7de79 Mon Sep 17 00:00:00 2001 From: GH Actions Date: Fri, 25 Jul 2025 09:19:47 +0000 Subject: [PATCH 5/5] Apply patch from /run fantomas --- src/Compiler/Utilities/TypeHashing.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Utilities/TypeHashing.fs b/src/Compiler/Utilities/TypeHashing.fs index d91983e3b27..c085bc84ff9 100644 --- a/src/Compiler/Utilities/TypeHashing.fs +++ b/src/Compiler/Utilities/TypeHashing.fs @@ -335,12 +335,12 @@ module HashTastMemberOrVals = let typeHash = hashTopType g argInfos retTy cxs let flagsHash = hash v.val_flags.PickledBits let attribsHash = hashAttributeList v.Attribs - + let combinedHash = nameHash @@ typarHash @@ typeHash @@ flagsHash @@ attribsHash - + // Include literal constant value in hash for deterministic builds match v.LiteralValue with - | Some constVal -> + | Some constVal -> let constHash = hashConst constVal combinedHash @@ constHash | None -> combinedHash