You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace provisional tasks with task validity criteria
validity criteria is a property of the task itself, and is immutable. This eliminates mutable state in ConstructedTask and allows us to annotate PlannedTask as Sendable
Copy file name to clipboardExpand all lines: Sources/SWBCore/PlannedTask.swift
+13-27Lines changed: 13 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ public protocol PlannedTaskInputsOutputs {
59
59
/// A task is a concrete unit of work to be performed by the build system as a result of task construction. For example the compilation of an individual file or the copying of a single resource. In many cases, each task will directly correspond to an external command line to be executed. Every task also has inputs and outputs which will be honored by the build system.
60
60
///
61
61
/// A *planned* task contains information used only during task construction or which is added to the `BuildDescription` and not otherwise used during execution; information used during execution is stored in a corresponding *executable* task. A planned task also contains a strong reference to its executable task (since during task construction the planned task is the only object which is keeping the executable task alive).
/// The provisional task corresponding to this task, if any.
91
-
///
92
-
/// This is mainly important for resolution of provisional tasks for directory creation: We don't want to consider a provisional task for directory creation valid just because other provisional tasks (and *only* provisional tasks) are placing content there; we want to be able to easily determine that non-provisional tasks are placing content there.
93
-
varprovisionalTask:ProvisionalTask?{getset}
90
+
/// Criteria for determining if this task should be included in the build plan.
/// A constructed task is a concrete instance of `PlannedTask` which captures information about a task which is used during task construction and creation of the `BuildDescription`. It has a reference to the executable task which will be used during task execution.
@@ -159,14 +157,8 @@ public final class ConstructedTask: PlannedTask {
159
157
160
158
publicletrepairViaOwnershipAnalysis:Bool
161
159
162
-
/// The provisional task corresponding to this task, if any.
163
-
///
164
-
/// This is mainly important for resolution of provisional tasks for directory creation: We don't want to consider a provisional task for directory creation valid just because other provisional tasks (and *only* provisional tasks) are placing content there; we want to be able to easily determine that non-provisional tasks are placing content there.
165
-
public weak varprovisionalTask:ProvisionalTask?=nil{
166
-
willSet(newProvisionalTask){
167
-
precondition(provisionalTask ==nil,"A provisional task has already been assigned to planned task \(self)")
168
-
}
169
-
}
160
+
/// Criteria for determining if this task should be included in the build plan.
@@ -277,16 +273,6 @@ public final class GateTask: PlannedTask {
277
273
case repairViaOwnershipAnalysis
278
274
}
279
275
280
-
/// The provisional task corresponding to this task, if any.
281
-
///
282
-
/// This is mainly important for resolution of provisional tasks for directory creation: We don't want to consider a provisional task for directory creation valid just because other provisional tasks (and *only* provisional tasks) are placing content there; we want to be able to easily determine that non-provisional tasks are placing content there.
283
-
/// The provisional task corresponding to this task, if any.
284
-
public weak varprovisionalTask:ProvisionalTask?=nil{
285
-
willSet(newProvisionalTask){
286
-
preconditionFailure("Tried to assign a provisional task to gate task \(self)")
287
-
}
288
-
}
289
-
290
276
/// Construct a new task from a task builder.
291
277
///
292
278
/// NOTE: This initializer does not mutate the builder, but we take it as inout nevertheless to avoid unnecessary copying.
Copy file name to clipboardExpand all lines: Sources/SWBCore/SpecImplementations/ProductTypes.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -868,7 +868,7 @@ public struct SymlinkDescriptor: Hashable
868
868
publicletlocation:Path
869
869
/// The path the symbolic link points to. This may be a relative path.
870
870
publiclettoPath:Path
871
-
/// The effective path the symbolic link points to, if we know that `toPath` is itself going to go through symbolic links. This may be a relative path. This is important for validation of symlink provisional tasks.
871
+
/// The effective path the symbolic link points to, if we know that `toPath` is itself going to go through symbolic links. This may be a relative path. This is important for validation of symlink tasks.
0 commit comments