fix: retry dmg detach in macOS sharp check

This commit is contained in:
LukeGus committed 2026-10-21 09:54:43 -05:00
1 parent a65b4a5d48
commit b691d4f7cb
1 file changed
+12 -2
+12 -2
View File
@@ -137,9 +137,19 @@ function verifyArtifact(artifact) {
console.log(`Verified macOS sharp packaging: ${path.basename(artifact)}`);
} finally {
if (mountedAt) {
spawnSync("hdiutil", ["detach", mountedAt], { stdio: "ignore" });
for (let attempt = 0; attempt < 5; attempt++) {
const args =
attempt < 3 ? ["detach", mountedAt] : ["detach", "-force", mountedAt];
if (spawnSync("hdiutil", args, { stdio: "ignore" }).status === 0) break;
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 2000);
}
fs.rmSync(temporaryRoot, { recursive: true, force: true });
}
fs.rmSync(temporaryRoot, {
recursive: true,
force: true,
maxRetries: 5,
retryDelay: 1000,
});
}
}