From 0b8b5b182e00f5d08e2b7a9859b463237a6c9cc3 Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 13 Feb 2024 16:07:15 +0100 Subject: [PATCH 1/3] add x bit to SmokeTestBenchmarks.sh (#16700) --- tests/benchmarks/SmokeTestBenchmarks.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/benchmarks/SmokeTestBenchmarks.sh diff --git a/tests/benchmarks/SmokeTestBenchmarks.sh b/tests/benchmarks/SmokeTestBenchmarks.sh old mode 100644 new mode 100755 From 0e7e4908cbe155ee65cb4791b0be1fdd3e2aa97f Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Tue, 13 Feb 2024 15:29:09 +0000 Subject: [PATCH 2/3] Add type providers support for the transparent compiler (#16690) * WIP * Clear all caches of projectSnapshot * Revert local test * Add todo about future plan. --- src/Compiler/Service/TransparentCompiler.fs | 14 ++++++++++---- src/Compiler/Service/TransparentCompiler.fsi | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 1d3ccf3690..b117fef1bf 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -115,6 +115,7 @@ type internal BootstrapInfo = LoadClosure: LoadClosure option LastFileName: string + ImportsInvalidatedByTypeProvider: Event } type internal TcIntermediateResult = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string @@ -742,9 +743,10 @@ type internal TransparentCompiler /// Bootstrap info that does not depend source files let ComputeBootstrapInfoStatic (projectSnapshot: ProjectCore, tcConfig: TcConfig, assemblyName: string, loadClosureOpt) = + let cacheKey = projectSnapshot.CacheKeyWith("BootstrapInfoStatic", assemblyName) caches.BootstrapInfoStatic.Get( - projectSnapshot.CacheKeyWith("BootstrapInfoStatic", assemblyName), + cacheKey, node { use _ = Activity.start @@ -816,6 +818,11 @@ type internal TransparentCompiler let bootstrapId = Interlocked.Increment &BootstrapInfoIdCounter + // TODO: In the future it might make sense to expose the event on the ProjectSnapshot and let the consumer deal with this. + // We could include a timestamp as part of the ProjectSnapshot key that represents the last time since the TypeProvider assembly was invalidated. + // When the event trigger, the consumer could then create a new snapshot based on the updated time. + importsInvalidatedByTypeProvider.Publish.Add(fun () -> caches.Clear(Set.singleton projectSnapshot.Identifier)) + return bootstrapId, tcImports, tcGlobals, initialTcInfo, importsInvalidatedByTypeProvider } ) @@ -865,7 +872,7 @@ type internal TransparentCompiler let tcConfig = TcConfig.Create(tcConfigB, validate = true) let outFile, _, assemblyName = tcConfigB.DecideNames sourceFiles - let! bootstrapId, tcImports, tcGlobals, initialTcInfo, _importsInvalidatedByTypeProvider = + let! bootstrapId, tcImports, tcGlobals, initialTcInfo, importsInvalidatedByTypeProvider = ComputeBootstrapInfoStatic(projectSnapshot.ProjectCore, tcConfig, assemblyName, loadClosureOpt) // Check for the existence of loaded sources and prepend them to the sources list if present. @@ -889,7 +896,7 @@ type internal TransparentCompiler LoadedSources = loadedSources LoadClosure = loadClosureOpt LastFileName = sourceFiles |> List.tryLast |> Option.defaultValue "" - //ImportsInvalidatedByTypeProvider = importsInvalidatedByTypeProvider + ImportsInvalidatedByTypeProvider = importsInvalidatedByTypeProvider } } @@ -1719,7 +1726,6 @@ type internal TransparentCompiler | None, creationDiags -> return FSharpCheckProjectResults(projectSnapshot.ProjectFileName, None, keepAssemblyContents, creationDiags, None) | Some bootstrapInfo, creationDiags -> - let! snapshotWithSources = LoadSources bootstrapInfo projectSnapshot let! tcInfo, ilAssemRef, assemblyDataResult, checkedImplFiles = ComputeProjectExtras bootstrapInfo snapshotWithSources diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index 14562f34f1..9aa5929566 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -75,7 +75,8 @@ type internal BootstrapInfo = InitialTcInfo: TcInfo LoadedSources: (range * ProjectSnapshot.FSharpFileSnapshot) list LoadClosure: LoadClosure option - LastFileName: string } + LastFileName: string + ImportsInvalidatedByTypeProvider: Event } type internal TcIntermediateResult = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string From 37251d42d51958d75709501f412cd348283d7e36 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 22:43:56 +0000 Subject: [PATCH 3/3] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240213.1 (#16699) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24109.1 -> To Version 9.0.0-alpha.1.24113.1 Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8677a94b14..20b0a1ac71 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 8ee50f75f960fbfb20fce0fefc5a3b05d15b1d21 + 2f79f97b7a6a0cf2ca3297a8fa526e6f4ea98ce2