{"record":{"id":"4e783fd14ec949ca","repo":"denoland/deno","slug":"app-bundle-has-no-name","errorCode":null,"errorMessage":"app bundle has no name","messagePattern":"app bundle has no name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":3494,"sourceCode":"  // pre-creating it as a symlink), and cleans up on drop.\n  let parent = dmg_path\n    .parent()\n    .filter(|p| !p.as_os_str().is_empty())\n    .unwrap_or_else(|| Path::new(\".\"));\n  std::fs::create_dir_all(parent)?;\n  let staging = tempfile::Builder::new()\n    .prefix(\".dmg-staging-\")\n    .tempdir_in(parent)\n    .with_context(|| {\n      format!(\"failed to stage DMG tempdir in {}\", parent.display())\n    })?;\n\n  // Copy the .app into the staging dir and add an /Applications symlink so\n  // users can drag the app across in the mounted DMG window.\n  let staged_app = staging.path().join(\n    app_bundle\n      .file_name()\n      .ok_or_else(|| deno_core::anyhow::anyhow!(\"app bundle has no name\"))?,\n  );\n  crate::tools::compile::copy_dir_all(app_bundle, &staged_app)?;\n  #[cfg(unix)]\n  {\n    let _ = std::os::unix::fs::symlink(\n      \"/Applications\",\n      staging.path().join(\"Applications\"),\n    );\n  }\n\n  if dmg_path.exists() {\n    std::fs::remove_file(dmg_path)?;\n  }\n\n  let status = std::process::Command::new(\"hdiutil\")\n    .args([\n      \"create\",\n      \"-volname\",","sourceCodeStart":3476,"sourceCodeEnd":3512,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L3476-L3512","documentation":"While building a macOS DMG, the code copies the .app into a staging dir using its final path component (staging.path().join(app_bundle.file_name())). file_name() is None only for root/'..'-terminated paths, so this error means the app-bundle path handed to the DMG builder had no name component to stage it under.","triggerScenarios":"app_bundle resolves to '/' or a path ending in '..' when the DMG staging copy is computed — degenerate input into build_dmg, since the bundle normally comes from the bundler's own output directory (e.g. <parent>/<app_name>.app derived from a validated --output).","commonSituations":"Not reachable through normal CLI usage; would require an internal caller passing a sanitized-to-root bundle path. Think of it as an invariant guard converted from an unwrap().","solutions":["Re-run with a normal --output file path so the derived app bundle path is well-formed.","If it reproduces, note the exact command and bundle path and report it as a deno bug."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// The DMG builder should always receive a named bundle; assert it at the call site\nlet name = app_bundle.file_name().expect(\"bundle path must have a file name\");\n// or defensively:\nif app_bundle.file_name().is_none() { return anyhow::bail!(\"invalid app bundle path: {}\", app_bundle.display()); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only feed DMG building bundles produced by the bundler itself (derived from a validated --output).","Do not sanitize bundle paths by trimming components down to '/'."],"tags":["macos","dmg","path","invariant","desktop"],"backgroundTag":"path-has-no-filename","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}