From b3f62e8f738c7a981c7d280eeabb70905151e863 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Wed, 27 Aug 2025 17:44:51 -0700 Subject: [PATCH] Always diagnose failures in job execution Execution of the `MultiJobExecutor` throws a `Driver.ErrorDiagnostics.emitted` if the job was not successful, ie. it assume any errors were already emitted. Make sure to emit an error in all paths of `ExecuteJobRule.executeJob` so that failures aren't hidden. --- Sources/SwiftDriverExecution/MultiJobExecutor.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/SwiftDriverExecution/MultiJobExecutor.swift b/Sources/SwiftDriverExecution/MultiJobExecutor.swift index 8c89c0af6..0ce69614a 100644 --- a/Sources/SwiftDriverExecution/MultiJobExecutor.swift +++ b/Sources/SwiftDriverExecution/MultiJobExecutor.swift @@ -655,9 +655,8 @@ class ExecuteJobRule: LLBuildRule { context.cancelBuildIfNeeded(result) value = .jobExecution(success: success) } catch { - if error is DiagnosticData { - context.diagnosticsEngine.emit(error) - } + context.diagnosticsEngine.emit(error) + // Only inform finished job if the job has been started, otherwise the build // system may complain about malformed output if (pendingFinish) {