Skip to content

Commit fca095e

Browse files
author
David Ungar
committed
Avoid problem if cancelled after job is added to queue but before removed.
1 parent bdc419e commit fca095e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/SwiftDriverExecution/MultiJobExecutor.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ class ExecuteJobRule: LLBuildRule {
450450

451451
/// Called when the build engine thinks all inputs are available in order to run the job.
452452
override func inputsAvailable(_ engine: LLTaskBuildEngine) {
453-
guard allInputsSucceeded, !context.isBuildCancelled else {
453+
guard allInputsSucceeded else {
454454
return engine.taskIsComplete(DriverBuildValue.jobExecution(success: false))
455455
}
456456

@@ -486,7 +486,10 @@ class ExecuteJobRule: LLBuildRule {
486486
}
487487

488488
private func executeJob(_ engine: LLTaskBuildEngine) {
489-
precondition(!context.isBuildCancelled)
489+
if context.isBuildCancelled {
490+
engine.taskIsComplete(DriverBuildValue.jobExecution(success: false))
491+
return
492+
}
490493
let context = self.context
491494
let resolver = context.argsResolver
492495
let job = myJob

0 commit comments

Comments
 (0)