{"record":{"id":"7250a2f2ea4baa7f","repo":"denoland/deno","slug":"could-not-find-laufey-app-under-to-re-sign","errorCode":null,"errorMessage":"could not find laufey.app under {} to re-sign","messagePattern":"could not find laufey\\.app under (.+?) to re-sign","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/tools/desktop.rs","lineNumber":2812,"sourceCode":"  Ok(())\n}\n\n/// Re-sign the cached laufey.app's binaries so the running binary's\n/// identifier matches its host bundle's `CFBundleIdentifier`. Run once\n/// per fresh download; HMR mode runs laufey.app directly (no per-project\n/// wrapper), so without this UN sees `Identifier=laufey` /\n/// `CFBundleIdentifier=com.deno.desktop` and refuses notification\n/// authorization. Best-effort: failures here are logged but don't\n/// abort the install, since most desktop features still work without\n/// notifications.\n#[cfg(target_os = \"macos\")]\nfn harmonize_cached_laufey_identifiers(\n  install_dir: &Path,\n  backend: &str,\n) -> Result<(), AnyError> {\n  let laufey_app = locate_laufey_app_in_install(install_dir, backend)\n    .ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"could not find laufey.app under {} to re-sign\",\n        install_dir.display()\n      )\n    })?;\n  harmonize_laufey_app_identifiers(&laufey_app)\n}\n\n/// Idempotently re-sign every Mach-O in `<laufey.app>/Contents/MacOS/` so\n/// its code-signing identifier matches the bundle's `CFBundleIdentifier`.\n/// macOS `usernoted` rejects UN authorization with\n/// `UNErrorCodeNotificationsNotAllowed` when the running binary's\n/// signed identifier disagrees with the bundle id (\"Legacy client X\n/// connecting to modern client\" in the daemon log). The linker-signed\n/// default for the laufey binary is `Identifier=laufey`, which never matches.\n/// Safe to call on every launch — binaries already at the correct\n/// identifier are skipped without a re-sign.\n#[cfg(target_os = \"macos\")]\nfn harmonize_laufey_app_identifiers(laufey_app: &Path) -> Result<(), AnyError> {","sourceCodeStart":2794,"sourceCodeEnd":2830,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L2794-L2830","documentation":"After installing the downloaded laufey backend, deno best-effort re-signs laufey.app so each Mach-O's code-signing identifier matches the bundle's CFBundleIdentifier (otherwise macOS usernoted rejects notification authorization with UNErrorCodeNotificationsNotAllowed). This error says the expected laufey.app could not be located inside the install dir before any signing was attempted. Per the doc comment, failures on this path are logged, not fatal — desktop still works, minus notifications.","triggerScenarios":"harmonize_cached_laufey_identifiers() runs locate_laufey_app_in_install() over the freshly extracted install dir and finds no laufey.app — archive layout changed upstream, or the backend for this target ships no .app (so harmonization is attempted only where it makes sense and this indicates a layout mismatch).","commonSituations":"A laufey release moved/renamed its .app inside the archive after a LAUFEY_VERSION bump; a truncated extraction dropped the bundle; running a non-macOS-backend artifact through the macOS path.","solutions":["Treat it as a warning first: the install itself succeeded; only notification authorization may misbehave.","Clear the laufey cache dir and re-run to rule out a truncated extraction.","List the cached archive to confirm whether laufey.app exists and where; if the layout changed, update deno to a build matching the pinned release.","File an issue with the archive listing so the locator is updated alongside the next pin bump."],"exampleFix":"# before: warning at end of install\n# [desktop] could not re-sign ... could not find laufey.app under ~/.cache/...\n\n# after: refresh the cache and retry on macOS\nrm -rf ~/.cache/deno/desktop/laufey/v1.2.3-aarch64-apple-darwin\ndeno desktop   # expect no re-sign warning","handlingStrategy":"fallback","validationCode":"# After install, check the harmonization precondition yourself\nfind \"$HOME/.cache/deno/desktop/laufey\" -type d -name 'laufey.app' -print \\\n  | grep -q . || echo 'note: no laufey.app — notifications may not work'","typeGuard":null,"tryCatchPattern":"The source already treats this as best-effort (logged, not fatal): mirror that by catching, logging 'notifications may be unavailable', and continuing the install; only investigate when the user actually needs notification authorization.","preventionTips":["Treat the warning as cosmetic first — most desktop features work without notifications.","After laufey version bumps, smoke-test that laufey.app still exists at the expected location inside the install dir.","Keep the cache clean so a truncated extraction cannot be mistaken for a layout change."],"tags":["macos","code-signing","notifications","laufey","app-bundle"],"backgroundTag":"archive-layout-mismatch","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"}