{"record":{"id":"27521551ef113db6","repo":"denoland/deno","slug":"laufey-backend-binary-has-no-parent-directory","errorCode":null,"errorMessage":"LAUFEY backend binary has no parent directory: {}","messagePattern":"LAUFEY backend binary has no parent directory: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":2156,"sourceCode":"    let dir = self.ensure_downloaded(backend, target).await?;\n    locate_app_bundle(&dir, backend).ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"could not find '{backend}' .app bundle inside {} (backend may not ship as an app for target '{target}')\",\n        dir.display()\n      )\n    })\n  }\n\n  /// Directory containing the backend binary and its support files (used on\n  /// Windows / Linux where support files sit alongside the binary).\n  async fn find_binary_dir(\n    &self,\n    backend: &str,\n    target: &str,\n  ) -> Result<PathBuf, AnyError> {\n    let binary = self.find_binary(backend, target).await?;\n    let parent = binary.parent().ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"LAUFEY backend binary has no parent directory: {}\",\n        binary.display()\n      )\n    })?;\n    Ok(parent.to_path_buf())\n  }\n}\n\nfn laufey_archive_name(backend: &str, target: &str) -> String {\n  let ext = if target.contains(\"windows\") {\n    \"zip\"\n  } else {\n    \"tar.gz\"\n  };\n  // The `raw` backend ships under the `winit` archive name upstream.\n  let archive_backend = match backend {\n    \"raw\" => \"winit\",\n    other => other,","sourceCodeStart":2138,"sourceCodeEnd":2174,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L2138-L2174","documentation":"find_binary_dir() takes the backend binary path returned by find_binary() and returns its containing directory (Windows/Linux support files sit next to the binary). Path::parent() only returns None for root/prefix paths, so this error indicates the locator produced a degenerate path — effectively an internal invariant violation, not something user input normally reaches.","triggerScenarios":"locate_backend_binary/locate_dev_backend_binary returned a path with no parent component ( '/', 'C:\\\\' ). With the locators walking real extracted trees this is close to unreachable; it exists to keep unwrap() panics out of the code.","commonSituations":"Almost none by design; would require a corrupted cache where a binary 'file' resolved to the filesystem root. Included so degenerate paths degrade to an error instead of a panic.","solutions":["Clear the laufey cache directory and re-run so the tree is re-extracted.","If using LAUFEY_DEV_DIR, verify the checkout layout is sane and the env var points at a real directory.","Reproduce with the exact backend/target and report it — this path should not be reachable in practice."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# The locator's output should always be a real file under a directory; sanity-check\n# the cache tree before relying on it:\nfind ~/.cache/deno/desktop/laufey -type f -name 'laufey*' -print0 \\\n  | xargs -0 -I{} test -f '{}' && echo 'cache tree sane'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not hand-place files at the cache root; keep the cache populated only by the tool itself.","Treat this error as an invariant break — capture the exact backend/target and cache state before clearing it, then report upstream."],"tags":["filesystem","path","invariant","laufey"],"backgroundTag":"path-has-no-parent-directory","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"}