Skip to content

Commit 0f84e12

Browse files
author
David Ungar
committed
Write build record even if error
1 parent 8101d69 commit 0f84e12

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,12 +859,14 @@ extension Driver {
859859
recordedInputModificationDates: recordedInputModificationDates)
860860
return
861861
}
862-
863-
try performTheBuild(allJobs: jobs, forceResponseFiles: forceResponseFiles)
864-
865-
buildRecordInfo?.writeBuildRecord(
866-
jobs,
867-
incrementalCompilationState?.skippedCompilationInputs)
862+
do {
863+
defer {
864+
buildRecordInfo?.writeBuildRecord(
865+
jobs,
866+
incrementalCompilationState?.skippedCompilationInputs)
867+
}
868+
try performTheBuild(allJobs: jobs, forceResponseFiles: forceResponseFiles)
869+
}
868870

869871
// If requested, warn for options that weren't used by the driver after the build is finished.
870872
if parsedOptions.hasArgument(.driverWarnUnusedOptions) {

0 commit comments

Comments
 (0)