{"record":{"id":"db08ce4023aebd9f","repo":"denoland/deno","slug":"invalid-output-dylib-path-has-no-file-stem","errorCode":null,"errorMessage":"invalid --output: dylib path has no file stem: {}","messagePattern":"invalid --output: dylib path has no file stem: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":3019,"sourceCode":"}\n\nfn dylib_parts(dylib_path: &Path) -> Result<DylibParts<'_>, AnyError> {\n  let parent = dylib_path.parent().ok_or_else(|| {\n    deno_core::anyhow::anyhow!(\n      \"invalid --output: dylib path has no parent dir: {}\",\n      dylib_path.display()\n    )\n  })?;\n  let file_name = dylib_path.file_name().ok_or_else(|| {\n    deno_core::anyhow::anyhow!(\n      \"invalid --output: dylib path has no file name: {}\",\n      dylib_path.display()\n    )\n  })?;\n  let app_name = dylib_path\n    .file_stem()\n    .ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"invalid --output: dylib path has no file stem: {}\",\n        dylib_path.display()\n      )\n    })?\n    .to_string_lossy()\n    .into_owned();\n  Ok(DylibParts {\n    parent,\n    file_name,\n    app_name,\n  })\n}\n\n/// The runtime library filename the Linux launcher resolves for an app named\n/// `app_name`.\n///\n/// laufey's `LaufeyFindColocatedRuntime` chops everything after the last dot of\n/// the executable's file name — an extension a Linux launcher doesn't have —","sourceCodeStart":3001,"sourceCodeEnd":3037,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L3001-L3037","documentation":"Third check in dylib_parts(): file_stem() extracts the app name by stripping the dylib extension. In std, file_stem() returns None only when file_name() is None, and file_name was already validated on the line above — so this branch is a defensive near-unreachable guard keeping the function total (no unwrap panics) rather than a realistic failure mode.","triggerScenarios":"Requires dylib_path.file_stem() to be None while file_name() succeeded, which Rust's Path semantics do not produce; it exists so future refactors of the checks cannot reintroduce a panic.","commonSituations":"None realistically; hit it only via a bug or a future std behavior change. Any occurrence should be reported as a deno issue with the exact --output value.","solutions":["Re-run with a normal, fully-named dylib path (./dist/app.dylib) — the error should be unreachable.","If it reproduces, capture the exact --output string and file a deno bug, since the guard is not expected to fire."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Same hygiene as the other --output errors: pass a normal file path and this whole family cannot fire.","If it ever fires with a valid-looking path, report it upstream — the guard is considered unreachable."],"tags":["cli","path","argument-validation","invariant","desktop"],"backgroundTag":"invalid-cli-path-argument","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"}