{"record":{"id":"f7b6c248f8359d1d","repo":"denoland/deno","slug":"hdiutil-failed-to-create-dmg-at","errorCode":null,"errorMessage":"hdiutil failed to create DMG at {}","messagePattern":"hdiutil failed to create DMG at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":3529,"sourceCode":"      \"create\",\n      \"-volname\",\n      &app_name,\n      \"-srcfolder\",\n      &staging.path().display().to_string(),\n      \"-ov\",\n      \"-format\",\n      \"UDZO\",\n      &dmg_path.display().to_string(),\n    ])\n    .stdout(std::process::Stdio::null())\n    .stderr(std::process::Stdio::inherit())\n    .status()\n    .context(\"Failed to run hdiutil\")?;\n\n  // staging tempdir is removed by its Drop impl when this fn returns.\n\n  if !status.success() {\n    bail!(\"hdiutil failed to create DMG at {}\", dmg_path.display());\n  }\n  Ok(())\n}\n\n/// Zstd-compressed AppImage Type-2 runtime ELF stubs, vendored from\n/// github.com/AppImage/type2-runtime at tag `20251108`. The selected runtime\n/// is decompressed and prepended to the SquashFS payload when creating an\n/// AppImage.\nconst APPIMAGE_RUNTIME_X86_64: &[u8] = include_bytes!(concat!(\n  env!(\"OUT_DIR\"),\n  \"/appimage_runtime/runtime-x86_64.zstd\"\n));\nconst APPIMAGE_RUNTIME_AARCH64: &[u8] = include_bytes!(concat!(\n  env!(\"OUT_DIR\"),\n  \"/appimage_runtime/runtime-aarch64.zstd\"\n));\n\n/// 1×1 transparent PNG, used when the caller didn't supply an icon.","sourceCodeStart":3511,"sourceCodeEnd":3547,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L3511-L3547","documentation":"`hdiutil create -format UDZO <dmg>` exited non-zero while producing the distributable disk image; hdiutil's stderr is inherited and printed above this bail. hdiutil is finicky: common causes are insufficient disk space, an existing/locked file at the DMG path, and transient failures under system load.","triggerScenarios":"Building a macOS .dmg when: /tmp or the output volume is out of space; a stale .dmg from a previous run occupies the output path; another hdiutil/disk-images process holds resources; or a sandboxed environment blocks disk-image creation.","commonSituations":"CI runners with small temp disks; concurrent builds racing to the same output path; macOS VMs where the disk arbitration service is restricted.","solutions":["Read the hdiutil stderr printed above the error for the specific reason.","Delete any stale .dmg at the printed output path and re-run.","Free disk space (hdiutil needs room for the compressed image plus staging).","Re-run — transient hdiutil failures under load are common; avoid running parallel dmg builds to the same path."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Pre-flight: space and a clean output path\ndf -h \"$TMPDIR\" | awk 'NR==2 && $4+0 < 1024 { print \"low disk space\"; exit 1 }'\nrm -f \"$OUT_DIR/App.dmg\"","typeGuard":null,"tryCatchPattern":"for i in 1 2 3; do\n  deno desktop ... && break\n  echo \"dmg build attempt $i failed (hdiutil) — retrying\"\n  rm -f \"$OUT_DIR\"/*.dmg\n  [ \"$i\" = 3 ] && exit 1\n  sleep $((i * 5))\ndone","preventionTips":["Delete the target .dmg before each build; hdiutil dislikes existing outputs.","Keep several GB free on the staging volume in CI.","Serialize dmg builds — parallel hdiutil runs to one path fail unpredictably."],"tags":["desktop","macos","dmg","hdiutil","packaging"],"backgroundTag":"disk-image-creation-failed","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}