From 43ec7c11d7892bc516298fde984560859f8540a3 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:38:06 +0200 Subject: [PATCH 1/2] make cache ci limit configurable --- azure-pipelines-PR.yml | 3 +++ src/Compiler/Facilities/LanguageFeatures.fs | 2 +- src/Compiler/Utilities/Caches.fs | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 563f0afcbfb..48fa88f65e4 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -457,11 +457,13 @@ stages: _configuration: Release _testKind: testFSharpQA transparentCompiler: + cacheOverride: 256 vs_release: _configuration: Release _testKind: testVs setupVsHive: true transparentCompiler: + cacheOverride: 256 transparent_compiler_release: _configuration: Release _testKind: testCoreclr @@ -485,6 +487,7 @@ stages: DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true + FSHARP_CACHE_OVERRIDE: $(cacheOverride) displayName: Build and Test $(_testKind) $(transparentCompiler) - task: PublishTestResults@2 diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 246ec741d67..565665d605b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -224,7 +224,7 @@ type LanguageVersion(versionText) = // F# preview LanguageFeature.EnforceAttributeTargets, previewVersion // Not enabled due to a number of external library dependencies on unenforced attributes - LanguageFeature.UseTypeSubsumptionCache, previewVersion + LanguageFeature.UseTypeSubsumptionCache, languageVersion90 LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509 LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion diff --git a/src/Compiler/Utilities/Caches.fs b/src/Compiler/Utilities/Caches.fs index a3cebd93161..30c45f1ecd9 100644 --- a/src/Compiler/Utilities/Caches.fs +++ b/src/Compiler/Utilities/Caches.fs @@ -162,11 +162,11 @@ module Cache = /// Use for testing purposes to reduce memory consumption in testhost and its subprocesses. let OverrideCapacityForTesting () = - Environment.SetEnvironmentVariable(overrideVariable, "true", EnvironmentVariableTarget.Process) + Environment.SetEnvironmentVariable(overrideVariable, "4096", EnvironmentVariableTarget.Process) let applyOverride (capacity: int) = - match Environment.GetEnvironmentVariable(overrideVariable) with - | NonNull _ when capacity > 4096 -> 4096 + match Int32.TryParse(Environment.GetEnvironmentVariable(overrideVariable)) with + | true, n when capacity > n -> n | _ -> capacity [] From 8dd9edea2d181278b8609457bdccbf4a679441b3 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Fri, 27 Jun 2025 23:30:18 +0200 Subject: [PATCH 2/2] simpler --- azure-pipelines-PR.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 48fa88f65e4..9f06d744935 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -457,13 +457,13 @@ stages: _configuration: Release _testKind: testFSharpQA transparentCompiler: - cacheOverride: 256 + FSHARP_CACHE_OVERRIDE: 256 vs_release: _configuration: Release _testKind: testVs setupVsHive: true transparentCompiler: - cacheOverride: 256 + FSHARP_CACHE_OVERRIDE: 256 transparent_compiler_release: _configuration: Release _testKind: testCoreclr @@ -487,7 +487,6 @@ stages: DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - FSHARP_CACHE_OVERRIDE: $(cacheOverride) displayName: Build and Test $(_testKind) $(transparentCompiler) - task: PublishTestResults@2