Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24109.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24113.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>8ee50f75f960fbfb20fce0fefc5a3b05d15b1d21</Sha>
<Sha>2f79f97b7a6a0cf2ca3297a8fa526e6f4ea98ce2</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down
14 changes: 10 additions & 4 deletions src/Compiler/Service/TransparentCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ type internal BootstrapInfo =

LoadClosure: LoadClosure option
LastFileName: string
ImportsInvalidatedByTypeProvider: Event<unit>
}

type internal TcIntermediateResult = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
)
Expand Down Expand Up @@ -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.
Expand All @@ -889,7 +896,7 @@ type internal TransparentCompiler
LoadedSources = loadedSources
LoadClosure = loadClosureOpt
LastFileName = sourceFiles |> List.tryLast |> Option.defaultValue ""
//ImportsInvalidatedByTypeProvider = importsInvalidatedByTypeProvider
ImportsInvalidatedByTypeProvider = importsInvalidatedByTypeProvider
}
}

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Compiler/Service/TransparentCompiler.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ type internal BootstrapInfo =
InitialTcInfo: TcInfo
LoadedSources: (range * ProjectSnapshot.FSharpFileSnapshot) list
LoadClosure: LoadClosure option
LastFileName: string }
LastFileName: string
ImportsInvalidatedByTypeProvider: Event<unit> }

type internal TcIntermediateResult = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string

Expand Down
Empty file modified tests/benchmarks/SmokeTestBenchmarks.sh
100644 → 100755
Empty file.