{"record":{"id":"efed2f0c7e8f0e52","repo":"tonhowtf/omniget","slug":"o-pacote-n-o-traz-nenhuma-biblioteca-do-onnx-runtime-em-lib","errorCode":null,"errorMessage":"o pacote não traz nenhuma biblioteca do ONNX Runtime em lib/","messagePattern":"o pacote não traz nenhuma biblioteca do ONNX Runtime em lib/","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/onnxrt.rs","lineNumber":419,"sourceCode":"            if !entry.header().entry_type().is_file() {\n                continue;\n            }\n            let path = entry.path()?.to_path_buf();\n            if !is_lib_entry(&path) {\n                continue;\n            }\n            let Some(name) = path.file_name().and_then(|s| s.to_str()).map(String::from) else {\n                continue;\n            };\n            let mut buf = Vec::new();\n            entry.read_to_end(&mut buf)?;\n            write_atomic(dir, &name, &buf)?;\n            note(&name, buf.len() as u64);\n        }\n    }\n\n    let (name, _) = biggest\n        .ok_or_else(|| anyhow!(\"o pacote não traz nenhuma biblioteca do ONNX Runtime em lib/\"))?;\n    Ok(name)\n}\n\n/// Garante que o nome canônico (`libonnxruntime.dylib` etc.) existe apontando\n/// para o arquivo versionado que veio no pacote.\nfn make_canonical(dir: &Path, extracted: &str) -> anyhow::Result<PathBuf> {\n    let canonical = dir.join(lib_filename());\n    if extracted == lib_filename() {\n        return Ok(canonical);\n    }\n    let src = dir.join(extracted);\n    let tmp = dir.join(format!(\".{}.tmp\", lib_filename()));\n    std::fs::copy(&src, &tmp)\n        .with_context(|| format!(\"copiando {} → {}\", src.display(), tmp.display()))?;\n    if canonical.exists() {\n        let _ = std::fs::remove_file(&canonical);\n    }\n    std::fs::rename(&tmp, &canonical)","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/onnxrt.rs#L401-L437","documentation":"Raised by extract_libs() during install_runtime: after scanning the extracted release package, no file under lib/ matched a runtime library (nothing entered `biggest`). The library throws it because the downloaded archive layout changed or is not the expected ONNX Runtime release asset.","triggerScenarios":"install_runtime() downloaded a release asset whose archive contains no recognized shared library under a lib/ directory — asset mismatch, upstream layout change, or corrupted/partial extraction.","commonSituations":"GitHub release layout changed between ONNX Runtime versions (files no longer under lib/); downloading the wrong asset (e.g. headers-only or a tgz for a different platform); proxy serving an HTML error page saved as the archive.","solutions":["Reinstall the runtime to re-download a fresh package (delete the old archive first)","Check the ONNX Runtime release layout for your RUNTIME_VERSION and update extract_libs path matching","Verify the downloaded archive opens correctly (unzip/tar -tf) and contains a lib/ directory","Pin a known-good ONNX Runtime version in RUNTIME_VERSION"],"exampleFix":"// before\nconst RUNTIME_VERSION: &str = \"1.22.0\"; // upstream renamed lib/ to lib64\n// after\nconst RUNTIME_VERSION: &str = \"1.21.1\"; // known-good layout with lib/onnxruntime.so","handlingStrategy":"retry","validationCode":"let names = std::fs::read_dir(extract_dir.join(\"lib\"))?.count(); if names == 0 { re_download(); }","typeGuard":"fn has_lib_dir(dir: &Path) -> bool { dir.join(\"lib\").read_dir().map(|mut d| d.next().is_some()).unwrap_or(false) }","tryCatchPattern":"match install_runtime(None, &progress).await { Err(e) if e.to_string().contains(\"nenhuma biblioteca\") => re_install_pinned_version().await, ... }","preventionTips":["Pin a known-good ONNX Runtime version in RUNTIME_VERSION","Sanity-check the archive (list entries) before extraction","Test the release layout after every version bump"],"tags":["onnx","rust","archive","extraction"],"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"}