{"record":{"id":"20435a567fcec98b","repo":"denoland/deno","slug":"failed-to-atomic-rename-laufey-cache-to-e","errorCode":null,"errorMessage":"failed to atomic-rename LAUFEY cache to {}: {e}","messagePattern":"failed to atomic-rename LAUFEY cache to (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":2023,"sourceCode":"    if marker.exists() {\n      return Ok(dir);\n    }\n\n    // Discard any prior failed-extract debris (no marker ⇒ partial).\n    // `rename` refuses a non-empty target.\n    if dir.exists() {\n      std::fs::remove_dir_all(&dir)?;\n    }\n\n    let staging_path = staging.into_path();\n    if let Err(e) = std::fs::rename(&staging_path, &dir) {\n      // Lost a rename race with a concurrent process — its dir is at\n      // our target path now. Drop our staged copy and use theirs.\n      let _ = std::fs::remove_dir_all(&staging_path);\n      if marker.exists() {\n        return Ok(dir);\n      }\n      return Err(deno_core::anyhow::anyhow!(\n        \"failed to atomic-rename LAUFEY cache to {}: {e}\",\n        dir.display(),\n      ));\n    }\n\n    // The laufey release archive linker-signs the `laufey` binary with\n    // identifier=`laufey` rather than the .app's CFBundleIdentifier. UN\n    // (UNUserNotificationCenter) rejects authorization requests when\n    // the running binary's signed identifier disagrees with the host\n    // bundle's id (UNErrorCodeNotificationsNotAllowed, error code 1).\n    // In HMR mode the user's project bundle isn't involved — we run\n    // laufey.app directly — so we have to fix the cached copy itself.\n    // Re-sign every Mach-O inside the cached laufey.app with the bundle\n    // id so the running identity is internally consistent. No-op on\n    // non-macOS targets / hosts (no `codesign(1)`).\n    #[cfg(target_os = \"macos\")]\n    if target.contains(\"apple-darwin\")\n      && let Err(e) = harmonize_cached_laufey_identifiers(&dir, backend)","sourceCodeStart":2005,"sourceCodeEnd":2041,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/desktop.rs#L2005-L2041","documentation":"Error \"failed to atomic-rename LAUFEY cache to {}: {e}\" thrown in denoland/deno.","triggerScenarios":"Thrown at cli/tools/desktop.rs:2023 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}