@@ -504,7 +504,7 @@ class ExecuteJobRule: LLBuildRule {
504
504
let env = context. env. merging ( job. extraEnvironment, uniquingKeysWith: { $1 } )
505
505
506
506
let value : DriverBuildValue
507
- var knownPId = Set < Int > ( )
507
+ var pendingFinish = false
508
508
var pid = 0
509
509
do {
510
510
let arguments : [ String ] = try resolver. resolveArgumentList ( for: job,
@@ -525,8 +525,8 @@ class ExecuteJobRule: LLBuildRule {
525
525
// Inform the delegate.
526
526
context. delegateQueue. sync {
527
527
context. executorDelegate. jobStarted ( job: job, arguments: arguments, pid: pid)
528
- knownPId. insert ( pid)
529
528
}
529
+ pendingFinish = true
530
530
531
531
let result = try process. waitUntilExit ( )
532
532
let success = result. exitStatus == . terminated( code: EXIT_SUCCESS)
@@ -552,6 +552,7 @@ class ExecuteJobRule: LLBuildRule {
552
552
context. delegateQueue. sync {
553
553
context. executorDelegate. jobFinished ( job: job, result: result, pid: pid)
554
554
}
555
+ pendingFinish = false
555
556
context. cancelBuildIfNeeded ( result)
556
557
if !context. isBuildCancelled {
557
558
try context. addRuleBeyondMandatoryCompiles ( finishedJob: job, result: result)
@@ -563,7 +564,7 @@ class ExecuteJobRule: LLBuildRule {
563
564
}
564
565
// Only inform finished job if the job has been started, otherwise the build
565
566
// system may complain about malformed output
566
- if ( knownPId . contains ( pid ) ) {
567
+ if ( pendingFinish ) {
567
568
context. delegateQueue. sync {
568
569
let result = ProcessResult (
569
570
arguments: [ ] ,
0 commit comments