{"record":{"id":"7d583ace00f220f4","repo":"tonhowtf/omniget","slug":"n-o-existe-build-oficial-do-onnx-runtime-para-este-sistema","errorCode":null,"errorMessage":"não existe build oficial do ONNX Runtime para este sistema. Aponte um {} que você já tenha (o pacote `onnxruntime` do pip traz um) — ele é copiado para {}.","messagePattern":"não existe build oficial do ONNX Runtime para este sistema\\. Aponte um (.+?) que você já tenha \\(o pacote `onnxruntime` do pip traz um\\) — ele é copiado para (.+?)\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/onnxrt.rs","lineNumber":264,"sourceCode":"        variants: list_variants(),\n    }\n}\n\n/// Mensagem de erro que diz o que fazer, em vez de só reclamar.\nfn missing_runtime_error() -> anyhow::Error {\n    let where_to = target_dir()\n        .map(|d| d.display().to_string())\n        .unwrap_or_else(|| \"<pasta de dados do app>\".into());\n    if auto_variant_id().is_some() {\n        anyhow!(\n            \"o ONNX Runtime {} ainda não está instalado. Instale pela tela de Modelos \\\n             (o download vai para {}) ou aponte um {} que você já tenha.\",\n            RUNTIME_VERSION,\n            where_to,\n            lib_filename()\n        )\n    } else {\n        anyhow!(\n            \"não existe build oficial do ONNX Runtime para este sistema. \\\n             Aponte um {} que você já tenha (o pacote `onnxruntime` do pip traz um) — \\\n             ele é copiado para {}.\",\n            lib_filename(),\n            where_to\n        )\n    }\n}\n\n/// Caminho que o `ort` já está usando, quando o carregamento deu certo uma vez.\nstatic READY: OnceLock<PathBuf> = OnceLock::new();\n\n/// Aponta o `ort` para a lib resolvida. Idempotente: o `ort` guarda o handle\n/// num `OnceLock` próprio, então a segunda chamada não troca nada — por isso\n/// guardamos o caminho que venceu e devolvemos ele.\n///\n/// Falta de lib vira erro acionável, nunca panic: o `ort` só entra em pânico\n/// se alguém tocar na API dele sem passar por aqui.","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/onnxrt.rs#L246-L282","documentation":"The fallback branch of missing_runtime_error() in onnxrt.rs: no official ONNX Runtime build exists for this platform (auto_variant_id() is None), so download is impossible and the user must supply a library manually. The library throws it instead of silently failing so the user knows the exact workaround (a lib from the pip `onnxruntime` package is copied into the app data dir).","triggerScenarios":"Calling init()/ensure_runtime() on an unsupported OS/arch combination (no release asset matches), so resolve_path() finds nothing and pick_asset would have no variant.","commonSituations":"Running on less common Linux architectures (e.g. musl/armv7), unsupported OS targets, cross-compiled builds, or CI runners with unusual platforms.","solutions":["Install the `onnxruntime` pip package and point the app to its bundled shared library","Pass a variant explicitly to install_runtime if a matching asset actually exists","Check auto_variant_id()/supported variants in onnxrt.rs and extend asset mapping for your platform","Use install_from_path with a manually obtained libonnxruntime file"],"exampleFix":"# before\n# relying on auto-detection on an unsupported platform -> error\n# after\nomniget install-runtime --from $(python -c \"import onnxruntime,os;print(os.path.join(os.path.dirname(onnxruntime.__file__),'capi','onnxruntime.so'))\")","handlingStrategy":"fallback","validationCode":"if std::env::consts::ARCH not in supported_arches() { require_manual_runtime(); }","typeGuard":"fn has_manual_runtime(p: &Path) -> bool { p.is_file() && p.file_name().map(|n| n.to_string_lossy().contains(\"onnxruntime\")).unwrap_or(false) }","tryCatchPattern":"match onnxrt::init() { Err(e) if e.to_string().contains(\"build oficial\") => guide_manual_install(), ... }","preventionTips":["Detect unsupported platforms at startup and pre-emptively require a manual lib","Document the pip onnxruntime workaround for uncommon targets","Keep the supported variant table in onnxrt.rs up to date"],"tags":["onnx","rust","unsupported-platform","missing-dependency"],"backgroundTag":"unsupported-platform","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"}