Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: prevent ort-sys panic on macOS by not setting empty ORT_LIB_LOCATION

Louis Beaumont1a91c6642420
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 92d44846f..52728e6c3 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -710,6 +710,13 @@ jobs:
Write-Host "ONNX Runtime extracted to $extractDir"
Get-ChildItem "$extractDir/lib" | ForEach-Object { Write-Host $_.Name }
+ - name: Set ORT env vars for Windows
+ if: matrix.os_type == 'windows'
+ shell: bash
+ run: |
+ echo "ORT_STRATEGY=system" >> $GITHUB_ENV
+ echo "ORT_LIB_LOCATION=${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2" >> $GITHUB_ENV
+
- name: Use production config for release
shell: bash
run: cp apps/screenpipe-app-tauri/src-tauri/tauri.prod.conf.json apps/screenpipe-app-tauri/src-tauri/tauri.conf.json
@@ -778,9 +785,7 @@ jobs:
RUSTFLAGS: ${{ matrix.os_type == 'windows' && '-C target-feature=+crt-static -C link-arg=/LTCG' || '' }}
VCPKG_STATIC_LINKAGE: "true"
KNF_STATIC_CRT: ${{ matrix.os_type == 'windows' && '1' || '' }}
- # Use system onnxruntime (from build.rs download) to avoid CRT mismatch with +crt-static
- ORT_STRATEGY: ${{ matrix.os_type == 'windows' && 'system' || '' }}
- ORT_LIB_LOCATION: ${{ matrix.os_type == 'windows' && format('{0}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2', github.workspace) || '' }}
+ # ORT_STRATEGY and ORT_LIB_LOCATION set via GITHUB_ENV in Windows-only step above
# Fix whisper.cpp crash on newer CPUs (Lunar Lake, etc.) that lack AVX-512
# GitHub windows-2022 runners have Xeon CPUs with AVX-512, but GGML_NATIVE=ON
# compiles with -march=native, causing illegal instruction crashes on CPUs without AVX-512
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index b3a7254fb..141412282 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.452"
+version = "2.0.453"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/crates/screenpipe-audio/build.rs b/crates/screenpipe-audio/build.rs
index c16714f38..ffad0f17c 100644
--- a/crates/screenpipe-audio/build.rs
+++ b/crates/screenpipe-audio/build.rs
@@ -91,31 +91,35 @@ fn install_onnxruntime() {
}
// Use CPU-only onnxruntime — GPU (DirectML) causes issues on Intel integrated GPUs
- let url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip";
- let client = Client::builder()
- .timeout(Duration::from_secs(300))
- .build()
- .expect("failed to build client");
- let resp = client.get(url).send().expect("request failed");
- let body = resp.bytes().expect("body invalid");
- fs::write("./onnxruntime-win-x64-1.19.2.zip", &body).expect("failed to write");
- let unzip_path = find_unzip().expect(
- "could not find unzip executable - please install it via GnuWin32 or add it to PATH",
- );
-
- let status = Command::new(unzip_path)
- .args(["-o", "onnxruntime-win-x64-1.19.2.zip"])
- .status()
- .expect("failed to execute unzip");
-
- if !status.success() {
- panic!("failed to install onnx binary");
- }
let target_dir =
Path::new("../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2");
- if target_dir.exists() {
- fs::remove_dir_all(target_dir).expect("failed to remove existing directory");
+
+ // Skip download if already present (CI pre-downloads via workflow step)
+ if !target_dir.join("lib").join("onnxruntime.lib").exists() {
+ let url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip";
+ let client = Client::builder()
+ .timeout(Duration::from_secs(300))
+ .build()
+ .expect("failed to build client");
+ let resp = client.get(url).send().expect("request failed");
+ let body = resp.bytes().expect("body invalid");
+ fs::write("./onnxruntime-win-x64-1.19.2.zip", &body).expect("failed to write");
+ let unzip_path = find_unzip().expect(
+ "could not find unzip executable - please install it via GnuWin32 or add it to PATH",
+ );
+
+ let status = Command::new(unzip_path)
+ .args(["-o", "onnxruntime-win-x64-1.19.2.zip"])
+ .status()
+ .expect("failed to execute unzip");
+
+ if !status.success() {
+ panic!("failed to install onnx binary");
+ }
+ if target_dir.exists() {
+ fs::remove_dir_all(target_dir).expect("failed to remove existing directory");
+ }
+ fs::rename("onnxruntime-win-x64-1.19.2", target_dir).expect("failed to rename");
}
- fs::rename("onnxruntime-win-x64-1.19.2", target_dir).expect("failed to rename");
println!("cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2/lib");
}