tonhowtf/omniget · error · anyhow::Error

não existe build oficial do ONNX Runtime para este sistema.

Error message

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 {}.

What it means

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).

Solutions

  1. Install the `onnxruntime` pip package and point the app to its bundled shared library
  2. Pass a variant explicitly to install_runtime if a matching asset actually exists
  3. Check auto_variant_id()/supported variants in onnxrt.rs and extend asset mapping for your platform
  4. Use install_from_path with a manually obtained libonnxruntime file

Example fix

# before
# relying on auto-detection on an unsupported platform -> error
# after
omniget install-runtime --from $(python -c "import onnxruntime,os;print(os.path.join(os.path.dirname(onnxruntime.__file__),'capi','onnxruntime.so'))")
Defensive patterns

Strategy: fallback

Validate before calling

if std::env::consts::ARCH not in supported_arches() { require_manual_runtime(); }

Type guard

fn has_manual_runtime(p: &Path) -> bool { p.is_file() && p.file_name().map(|n| n.to_string_lossy().contains("onnxruntime")).unwrap_or(false) }

Try / catch

match onnxrt::init() { Err(e) if e.to_string().contains("build oficial") => guide_manual_install(), ... }

Prevention

When it happens

Trigger: 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.

Common situations: Running on less common Linux architectures (e.g. musl/armv7), unsupported OS targets, cross-compiled builds, or CI runners with unusual platforms.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/7d583ace00f220f4. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/onnxrt.rs:264

        variants: list_variants(),
    }
}

/// Mensagem de erro que diz o que fazer, em vez de só reclamar.
fn missing_runtime_error() -> anyhow::Error {
    let where_to = target_dir()
        .map(|d| d.display().to_string())
        .unwrap_or_else(|| "<pasta de dados do app>".into());
    if auto_variant_id().is_some() {
        anyhow!(
            "o ONNX Runtime {} ainda não está instalado. Instale pela tela de Modelos \
             (o download vai para {}) ou aponte um {} que você já tenha.",
            RUNTIME_VERSION,
            where_to,
            lib_filename()
        )
    } else {
        anyhow!(
            "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 {}.",
            lib_filename(),
            where_to
        )
    }
}

/// Caminho que o `ort` já está usando, quando o carregamento deu certo uma vez.
static READY: OnceLock<PathBuf> = OnceLock::new();

/// Aponta o `ort` para a lib resolvida. Idempotente: o `ort` guarda o handle
/// num `OnceLock` próprio, então a segunda chamada não troca nada — por isso
/// guardamos o caminho que venceu e devolvemos ele.
///
/// Falta de lib vira erro acionável, nunca panic: o `ort` só entra em pânico
/// se alguém tocar na API dele sem passar por aqui.

View on GitHub (pinned to 8600b91f42)