Skip to content

Commit eda4114

Browse files
committed
Fix misplaced defer in manifest caching
In #5797, I introduced the outer `do`-block here, but did not move the existing `defer` from the now inner `do`-block. Related to rdar://101956252
1 parent f28c338 commit eda4114

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PackageLoading/ManifestLoader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ public final class ManifestLoader: ManifestLoaderProtocol {
385385
// shells out and compiles the manifest, finally output a JSON
386386
observabilityScope.emit(debug: "evaluating manifest for '\(packageIdentity)' v. \(packageVersion?.description ?? "unknown")")
387387
do {
388+
defer { closeAfterWrite.perform() }
389+
388390
try self.evaluateManifest(
389391
packageIdentity: key.packageIdentity,
390392
manifestPath: key.manifestPath,
@@ -396,8 +398,6 @@ public final class ManifestLoader: ManifestLoaderProtocol {
396398
dispatchPrecondition(condition: .onQueue(callbackQueue))
397399

398400
do {
399-
defer { closeAfterWrite.perform() }
400-
401401
let evaluationResult = try result.get()
402402
// only cache successfully parsed manifests
403403
let parseManifest = try self.parseManifest(

0 commit comments

Comments
 (0)