@@ -132,7 +132,7 @@ package final class BuildDescription: Serializable, Sendable, Encodable, Cacheab
132
132
}
133
133
134
134
// rdar://107734664 (Consider passing the task store as a parameter to build description methods rather than as a property of BuildDescription)
135
- package let taskStore : TaskStore
135
+ package let taskStore : FrozenTaskStore
136
136
137
137
/// The set of all (non-virtual) paths produced by tasks in the build description.
138
138
private let allOutputPaths : Set < Path >
@@ -188,7 +188,7 @@ package final class BuildDescription: Serializable, Sendable, Encodable, Cacheab
188
188
package let targetsBuildInParallel : Bool
189
189
190
190
/// Load a build description from the given path.
191
- fileprivate init ( inDir dir: Path , signature: BuildDescriptionSignature , taskStore: TaskStore , allOutputPaths: Set < Path > , rootPathsPerTarget: [ ConfiguredTarget : [ Path ] ] , moduleCachePathPerTarget: [ ConfiguredTarget : Path ] , settingsPerTarget: [ ConfiguredTarget : Settings ] , enableStaleFileRemoval: Bool = true , taskActionMap: [ String : TaskAction . Type ] , targetTaskCounts: [ ConfiguredTarget : Int ] , moduleSessionFilePath: Path ? , diagnostics: [ ConfiguredTarget ? : [ Diagnostic ] ] , fs: any FSProxy , invalidationPaths: [ Path ] , recursiveSearchPathResults: [ RecursiveSearchPathResolver . CachedResult ] , copiedPathMap: [ String : String ] , targetDependencies: [ TargetDependencyRelationship ] , definingTargetsByModuleName: [ String : OrderedSet < ConfiguredTarget > ] , capturedBuildInfo: CapturedBuildInfo ? , bypassActualTasks: Bool , targetsBuildInParallel: Bool ) throws {
191
+ fileprivate init ( inDir dir: Path , signature: BuildDescriptionSignature , taskStore: FrozenTaskStore , allOutputPaths: Set < Path > , rootPathsPerTarget: [ ConfiguredTarget : [ Path ] ] , moduleCachePathPerTarget: [ ConfiguredTarget : Path ] , settingsPerTarget: [ ConfiguredTarget : Settings ] , enableStaleFileRemoval: Bool = true , taskActionMap: [ String : TaskAction . Type ] , targetTaskCounts: [ ConfiguredTarget : Int ] , moduleSessionFilePath: Path ? , diagnostics: [ ConfiguredTarget ? : [ Diagnostic ] ] , fs: any FSProxy , invalidationPaths: [ Path ] , recursiveSearchPathResults: [ RecursiveSearchPathResolver . CachedResult ] , copiedPathMap: [ String : String ] , targetDependencies: [ TargetDependencyRelationship ] , definingTargetsByModuleName: [ String : OrderedSet < ConfiguredTarget > ] , capturedBuildInfo: CapturedBuildInfo ? , bypassActualTasks: Bool , targetsBuildInParallel: Bool ) throws {
192
192
self . dir = dir
193
193
self . signature = signature
194
194
self . taskStore = taskStore
@@ -650,9 +650,11 @@ package final class BuildDescriptionBuilder {
650
650
throw StubError . error ( " unable to record manifest to build description delegate: \( error) " )
651
651
}
652
652
653
+ let frozenTaskStore = taskStore. freeze ( )
654
+
653
655
// Compute the count of tasks by target, which we use to know when a task is complete.
654
656
var targetTaskCounts = [ ConfiguredTarget: Int] ( )
655
- taskStore . forEachTask { task in
657
+ frozenTaskStore . forEachTask { task in
656
658
if let target = task. forTarget, !task. isGate {
657
659
targetTaskCounts [ target] = ( targetTaskCounts [ target] ?? 0 ) + 1
658
660
}
@@ -663,7 +665,7 @@ package final class BuildDescriptionBuilder {
663
665
// Create the build description.
664
666
let buildDescription : BuildDescription
665
667
do {
666
- buildDescription = try BuildDescription ( inDir: path, signature: signature, taskStore: taskStore , allOutputPaths: allOutputPaths, rootPathsPerTarget: rootPathsPerTarget, moduleCachePathPerTarget: moduleCachePathPerTarget, settingsPerTarget: settingsPerTarget, taskActionMap: taskActionMap, targetTaskCounts: targetTaskCounts, moduleSessionFilePath: moduleSessionFilePath, diagnostics: diagnosticsEngines. mapValues { engine in engine. diagnostics } , fs: fs, invalidationPaths: invalidationPaths, recursiveSearchPathResults: recursiveSearchPathResults, copiedPathMap: copiedPathMap, targetDependencies: targetDependencies, definingTargetsByModuleName: definingTargetsByModuleName, capturedBuildInfo: capturedBuildInfo, bypassActualTasks: bypassActualTasks, targetsBuildInParallel: targetsBuildInParallel)
668
+ buildDescription = try BuildDescription ( inDir: path, signature: signature, taskStore: frozenTaskStore , allOutputPaths: allOutputPaths, rootPathsPerTarget: rootPathsPerTarget, moduleCachePathPerTarget: moduleCachePathPerTarget, settingsPerTarget: settingsPerTarget, taskActionMap: taskActionMap, targetTaskCounts: targetTaskCounts, moduleSessionFilePath: moduleSessionFilePath, diagnostics: diagnosticsEngines. mapValues { engine in engine. diagnostics } , fs: fs, invalidationPaths: invalidationPaths, recursiveSearchPathResults: recursiveSearchPathResults, copiedPathMap: copiedPathMap, targetDependencies: targetDependencies, definingTargetsByModuleName: definingTargetsByModuleName, capturedBuildInfo: capturedBuildInfo, bypassActualTasks: bypassActualTasks, targetsBuildInParallel: targetsBuildInParallel)
667
669
}
668
670
catch {
669
671
throw StubError . error ( " unable to create build description: \( error) " )
@@ -1398,7 +1400,7 @@ package final class BuildDescriptionDeserializerDelegate: DeserializerDelegate,
1398
1400
1399
1401
package let uniquingCoordinator = UniquingDeserializationCoordinator ( )
1400
1402
1401
- package var taskStore : TaskStore ? = nil
1403
+ package var taskStore : FrozenTaskStore ? = nil
1402
1404
1403
1405
package init ( workspace: Workspace , platformRegistry: PlatformRegistry , sdkRegistry: SDKRegistry , specRegistry: SpecRegistry ) {
1404
1406
self . workspace = workspace
0 commit comments