{"record":{"id":"eb173f4a588c62fa","repo":"tonhowtf/omniget","slug":"o-pacote-baixado-nao-contem-o-whisper-cli","errorCode":null,"errorMessage":"o pacote baixado nao contem o whisper-cli","messagePattern":"o pacote baixado nao contem o whisper-cli","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/whisper.rs","lineNumber":224,"sourceCode":"}\n\npub async fn install(variant: &str, progress: ProgressFn) -> anyhow::Result<PathBuf> {\n    let name = asset_name(variant)?;\n    let dir = managed_dir().ok_or_else(|| anyhow!(\"Could not determine data directory\"))?;\n    let client = github::client()?;\n    let asset = github::asset(&client, REPO, None, |n| n == name).await?;\n    tracing::info!(\"[whisper] baixando {} ({})\", asset.name, asset.tag);\n    let data = github::download(&client, &asset, false, &progress, \"whisper-cli\").await?;\n    let staging = dir.with_extension(\"new\");\n    let _ = std::fs::remove_dir_all(&staging);\n    let staging_c = staging.clone();\n    let asset_name_c = asset.name.clone();\n    tokio::task::spawn_blocking(move || github::unpack(&data, &asset_name_c, &staging_c))\n        .await\n        .map_err(|e| anyhow!(\"Spawn blocking failed: {}\", e))??;\n    let Some(exe) = github::find_file(&staging, &bin_name(\"whisper-cli\")) else {\n        let _ = std::fs::remove_dir_all(&staging);\n        return Err(anyhow!(\"o pacote baixado nao contem o whisper-cli\"));\n    };\n    github::make_executable(&exe);\n    // As libs (.dll/.so) ficam ao lado do executável no mesmo pacote.\n    github::swap_dir(&staging, &dir)?;\n    github::strip_quarantine(&dir).await;\n    let final_exe = github::find_file(&dir, &bin_name(\"whisper-cli\"))\n        .ok_or_else(|| anyhow!(\"whisper-cli sumiu depois de mover a pasta\"))?;\n    std::fs::write(dir.join(\"VERSION\"), &asset.tag).ok();\n    Ok(final_exe)\n}\n\n#[derive(Debug, Clone, Deserialize)]\npub struct TranscribeOptions {\n    pub input: String,\n    pub model: String,\n    /// \"auto\" ou código ISO (\"pt\", \"en\").\n    pub language: String,\n    /// Traduzir a saída para inglês (recurso nativo do Whisper).","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/whisper.rs#L206-L242","documentation":"After unpacking the release archive into a staging dir, install() searches for the whisper-cli executable (bin_name accounts for .exe on Windows). If it is not present, the staging dir is removed and this error is returned. It guards against upstream release layout changes or a corrupted/partial extraction.","triggerScenarios":"github::find_file(&staging, bin_name(\"whisper-cli\")) returns None because the archive extracted successfully but contains no file named whisper-cli(.exe) — e.g. upstream renamed the binary or restructured the archive.","commonSituations":"whisper.cpp released a new package layout; a proxy/mirror served a wrong or partial asset that still unpacked; an unexpected asset matched the name filter.","solutions":["Re-run the install to rule out a corrupted download.","Check the latest whisper.cpp release layout; if the binary was renamed, update bin_name()/find_file matching.","Verify the correct asset was downloaded (asset.name logged as \"[whisper] baixando ...\").","As a workaround, install whisper-cpp from the system (brew/apt) and point Configuracoes at it."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match whisper::install(variant, &progress).await {\n    Err(e) if e.to_string().contains(\"nao contem o whisper-cli\") => {\n        // retry once; if it persists, check the upstream release layout\n    }\n    other => other?,\n}","preventionTips":["Retry installs once before reporting failure.","Track whisper.cpp release notes for renamed binaries/archives.","Use a pinned release/tag if layout churn is a problem."],"tags":["packaging","whisper-cpp","install","upstream-change"],"backgroundTag":"unexpected-response-shape","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}