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

feat: add Windows ARM64 build and release (#2442)

Divanshud62360bc4db4
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index faae53561..681ec43eb 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -229,6 +229,13 @@ jobs:
args: "--target x86_64-pc-windows-msvc"
pre-build-args: ""
tauri-args: "--target x86_64-pc-windows-msvc --features official-build"
+ target: x86_64-pc-windows-msvc
+ os_type: "windows"
+ - platform: windows-11-arm
+ args: "--target aarch64-pc-windows-msvc"
+ pre-build-args: ""
+ tauri-args: "--target aarch64-pc-windows-msvc --features official-build"
+ target: aarch64-pc-windows-msvc
os_type: "windows"
# Linux disabled - too many bundling issues
# - platform: "ubuntu-22.04"
@@ -320,7 +327,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
- node-version: 20
+ node-version: ${{ matrix.target == 'aarch64-pc-windows-msvc' && '22' || '20' }}
- name: Set up Rust
if: matrix.os_type != 'windows'
@@ -329,12 +336,20 @@ jobs:
toolchain: stable
targets: ${{ matrix.target }}
- - name: Install Rust
- if: matrix.os_type == 'windows'
+ - name: Install Rust (Windows x64)
+ if: matrix.os_type == 'windows' && matrix.target == 'x86_64-pc-windows-msvc'
+ shell: powershell
run: |
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe -OutFile rustup-init.exe
.\rustup-init.exe -y
+ - name: Install Rust (Windows ARM64 native)
+ if: matrix.os_type == 'windows' && matrix.target == 'aarch64-pc-windows-msvc'
+ shell: powershell
+ run: |
+ Invoke-WebRequest https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe
+ .\rustup-init.exe -y
+
- name: setup rust path
if: matrix.os_type == 'windows'
shell: powershell
@@ -498,37 +513,20 @@ jobs:
if: matrix.os_type == 'windows'
uses: ilammy/msvc-dev-cmd@v1
- - name: Install 7zip
- if: matrix.os_type == 'windows'
+ - name: Install Ninja (ARM64)
+ if: matrix.os_type == 'windows' && matrix.target == 'aarch64-pc-windows-msvc'
shell: powershell
run: |
- # Skip if already installed (self-hosted runners)
- if (Test-Path "C:\Program Files\7-Zip\7z.exe") {
- Write-Host "7-Zip already installed, skipping"
- } else {
- $7zipUrl = "https://7-zip.org/a/7z2301-x64.exe"
- $7zipInstaller = "7z-installer.exe"
- Invoke-WebRequest -Uri $7zipUrl -OutFile $7zipInstaller
- Start-Process -FilePath .\$7zipInstaller -Args "/S" -Wait
- Remove-Item $7zipInstaller
- }
- echo "C:\Program Files\7-Zip" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- & "C:\Program Files\7-Zip\7z.exe" i
-
- - name: Persist MSVC cl.exe path
- if: matrix.os_type == 'windows'
- shell: powershell
- run: |
- $clPath = (Get-Command cl.exe -ErrorAction SilentlyContinue).Source
- if ($clPath) {
- $clDir = Split-Path $clPath
- echo "$clDir" >> $env:GITHUB_PATH
- echo "CC=$clPath" >> $env:GITHUB_ENV
- echo "CXX=$clPath" >> $env:GITHUB_ENV
- Write-Host "Set CC/CXX to $clPath"
- } else {
- Write-Host "WARNING: cl.exe not found on PATH"
+ winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent
+ $paths = @("C:\Program Files\Ninja", "C:\Tools\Ninja")
+ foreach ($p in $paths) {
+ if (Test-Path "$p\ninja.exe") {
+ echo $p | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ break
+ }
}
+ $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
+ ninja --version
- name: Install wget on Windows
if: matrix.os_type == 'windows'
@@ -563,44 +561,9 @@ jobs:
& "$wgetDir\wget.exe" --version
- name: Run pre_build.js
- env:
- SKIP_SCREENPIPE_SETUP: true
run: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ${{ github.workspace }}/apps/screenpipe-app-tauri
- - name: Download ONNX Runtime (CPU) for Windows
- if: matrix.os_type == 'windows'
- shell: pwsh
- run: |
- # Pre-download CPU onnxruntime for both Tauri resources and ort linking.
- # Extract to TWO separate directories to avoid file locking:
- # - onnxruntime-win-x64-1.19.2/ → Tauri resources (tauri_build reads these)
- # - ort-system-lib/ → ORT_LIB_LOCATION (ort-sys copy-dylibs reads these)
- # These build scripts run concurrently (different dependency chains), so they
- # MUST NOT share files or Windows will return os error 32 (file locked).
- $url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip"
- $zipFile = "onnxruntime-win-x64-1.19.2.zip"
- $tauriDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2"
- $ortDir = "ort-system-lib"
- Invoke-WebRequest -Uri $url -OutFile $zipFile
- if (Test-Path $tauriDir) { Remove-Item $tauriDir -Recurse -Force }
- 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y
- Write-Host "ONNX Runtime extracted to $tauriDir (for Tauri resources)"
- # Create separate copy for ort-sys linking
- if (Test-Path $ortDir) { Remove-Item $ortDir -Recurse -Force }
- Copy-Item -Path $tauriDir -Destination $ortDir -Recurse -Force
- Write-Host "ONNX Runtime copied to $ortDir (for ORT_LIB_LOCATION)"
- Get-ChildItem "$ortDir/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 }}/ort-system-lib" >> $GITHUB_ENV
- # Use prebuilt NASM objects on Windows: https://aws.github.io/aws-lc-rs/requirements/windows.html#prebuilt-nasm-objects
- echo "AWS_LC_SYS_PREBUILT_NASM=1" >> $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
@@ -726,6 +689,7 @@ jobs:
echo "Build keychain ready at $BUILD_KC"
- name: Compute Tauri build args
+ if: matrix.os_type == 'macos'
id: tauri-args
shell: bash
run: |
@@ -756,7 +720,33 @@ jobs:
security find-identity -v -p codesigning "$BUILD_KC" 2>&1 | tail -3
fi
+ - name: Build (Windows)
+ if: matrix.os_type == 'windows'
+ working-directory: apps/screenpipe-app-tauri
+ shell: powershell
+ env:
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ CI: true
+ # Optimize for build speed on Windows
+ CARGO_PROFILE_RELEASE_LTO: thin
+ CARGO_PROFILE_RELEASE_OPT_LEVEL: "2"
+ CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
+ # Enable incremental compilation for Windows
+ CARGO_INCREMENTAL: "true"
+ # Windows: keep symbols for Sentry upload, macOS: none
+ CARGO_PROFILE_RELEASE_STRIP: none
+ CARGO_PROFILE_RELEASE_PANIC: abort
+ CARGO_PROFILE_RELEASE_INCREMENTAL: "false"
+ RUSTFLAGS: -C link-arg=/LTCG
+ # Fix whisper.cpp crash on newer CPUs (Lunar Lake, etc.) that lack AVX-512
+ # GGML_NATIVE=ON compiles with -march=native, causing illegal instruction on CPUs without AVX-512
+ CMAKE_ARGS: -DGGML_NATIVE=OFF -DGGML_AVX512=OFF -DGGML_AVX512_VBMI=OFF -DGGML_AVX512_VNNI=OFF -DGGML_AVX512_BF16=OFF
+ run: bunx tauri build --verbose --target ${{ matrix.target }} --features official-build
+
- name: Build (with codesign retry)
+ if: matrix.os_type == 'macos'
shell: bash
env:
# for updater
@@ -776,33 +766,24 @@ jobs:
# Fix std::filesystem availability - requires macOS 10.15+
# whisper.cpp ggml uses std::filesystem::path which needs 10.15
# All these vars needed to ensure cmake picks up the deployment target
- MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os_type == 'macos' && '10.15' || '' }}
- CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.os_type == 'macos' && '10.15' || '' }}
+ MACOSX_DEPLOYMENT_TARGET: "10.15"
+ CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
# Fix i8mm build error - force M1 compatible architecture
# -U__ARM_FEATURE_MATMUL_INT8 undefines i8mm macro
# -mmacosx-version-min=10.15 ensures std::filesystem is available
# See: https://github.com/ggml-org/whisper.cpp/issues/3427
- CFLAGS: ${{ matrix.os_type == 'macos' && (matrix.target == 'aarch64-apple-darwin' && '-mmacosx-version-min=10.15 -mcpu=apple-m1 -U__ARM_FEATURE_MATMUL_INT8' || '-mmacosx-version-min=10.15') || '' }}
- CXXFLAGS: ${{ matrix.os_type == 'macos' && (matrix.target == 'aarch64-apple-darwin' && '-mmacosx-version-min=10.15 -mcpu=apple-m1 -U__ARM_FEATURE_MATMUL_INT8' || '-mmacosx-version-min=10.15') || '' }}
- CMAKE_C_FLAGS: ${{ matrix.os_type == 'macos' && '-mmacosx-version-min=10.15' || '' }}
- CMAKE_CXX_FLAGS: ${{ matrix.os_type == 'macos' && '-mmacosx-version-min=10.15' || '' }}
-
- # Optimize for build speed on Windows
- CARGO_PROFILE_RELEASE_LTO: ${{ matrix.os_type == 'windows' && 'thin' || 'false' }}
- CARGO_PROFILE_RELEASE_OPT_LEVEL: ${{ matrix.os_type == 'windows' && '2' || '3' }}
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ matrix.os_type == 'windows' && '16' || '16' }}
- # Enable incremental compilation for Windows
- CARGO_INCREMENTAL: ${{ matrix.os_type == 'windows' && 'true' || 'false' }}
- # Windows: keep symbols for Sentry upload, macOS: none
+ CFLAGS: ${{ matrix.target == 'aarch64-apple-darwin' && '-mmacosx-version-min=10.15 -mcpu=apple-m1 -U__ARM_FEATURE_MATMUL_INT8' || '-mmacosx-version-min=10.15' }}
+ CXXFLAGS: ${{ matrix.target == 'aarch64-apple-darwin' && '-mmacosx-version-min=10.15 -mcpu=apple-m1 -U__ARM_FEATURE_MATMUL_INT8' || '-mmacosx-version-min=10.15' }}
+ CMAKE_C_FLAGS: "-mmacosx-version-min=10.15"
+ CMAKE_CXX_FLAGS: "-mmacosx-version-min=10.15"
+
+ CARGO_PROFILE_RELEASE_LTO: "false"
+ CARGO_PROFILE_RELEASE_OPT_LEVEL: "3"
+ CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
+ CARGO_INCREMENTAL: "false"
CARGO_PROFILE_RELEASE_STRIP: none
- CARGO_PROFILE_RELEASE_PANIC: ${{ matrix.os_type == 'windows' && 'abort' || 'unwind' }}
- CARGO_PROFILE_RELEASE_INCREMENTAL: ${{ matrix.os_type == 'windows' && 'false' || 'true' }}
- RUSTFLAGS: ${{ matrix.os_type == 'windows' && '-C link-arg=/LTCG' || '' }}
- # 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
- CMAKE_ARGS: ${{ matrix.os_type == 'windows' && '-DGGML_NATIVE=OFF -DGGML_AVX512=OFF -DGGML_AVX512_VBMI=OFF -DGGML_AVX512_VNNI=OFF -DGGML_AVX512_BF16=OFF' || '' }}
+ CARGO_PROFILE_RELEASE_PANIC: unwind
+ CARGO_PROFILE_RELEASE_INCREMENTAL: "true"
# Fix linuxdeploy crash on AppImage bundling
NO_STRIP: ${{ matrix.os_type == 'linux' && '1' || '' }}
LINUXDEPLOY_OUTPUT_VERSION: ${{ matrix.os_type == 'linux' && '1' || '' }}
@@ -813,15 +794,6 @@ jobs:
TARGET="${{ matrix.target }}"
BUNDLE_DIR="apps/screenpipe-app-tauri/src-tauri/target/${TARGET}/release/bundle"
- # On Windows, ensure MSVC link.exe is found before Git's /usr/bin/link
- if [[ "${{ matrix.os_type }}" == "windows" ]]; then
- MSVC_DIR=$(dirname "$(which cl.exe 2>/dev/null)" 2>/dev/null)
- if [ -n "$MSVC_DIR" ]; then
- export PATH="$MSVC_DIR:$PATH"
- echo "Prepended MSVC dir to PATH: $MSVC_DIR"
- fi
- fi
-
for attempt in $(seq 1 $MAX_ATTEMPTS); do
echo "=== Build attempt $attempt/$MAX_ATTEMPTS ==="
@@ -912,13 +884,14 @@ jobs:
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: mediar
+ SENTRY_ARCH: ${{ matrix.target == 'aarch64-pc-windows-msvc' && 'aarch64' || 'x86_64' }}
run: |
- # Install sentry-cli
- Invoke-WebRequest -Uri "https://release-registry.services.sentry.io/apps/sentry-cli/latest?response=download&arch=x86_64&platform=Windows&package=sentry-cli" -OutFile sentry-cli.exe
+ # Install sentry-cli (native arch on ARM64 runner)
+ Invoke-WebRequest -Uri "https://release-registry.services.sentry.io/apps/sentry-cli/latest?response=download&arch=$env:SENTRY_ARCH&platform=Windows&package=sentry-cli" -OutFile sentry-cli.exe
# Upload debug symbols (.pdb files) for the app
Write-Host "Uploading debug symbols to Sentry..."
- .\sentry-cli.exe debug-files upload --org $env:SENTRY_ORG --project screenpipe-app apps/screenpipe-app-tauri/src-tauri/target/release/
+ .\sentry-cli.exe debug-files upload --org $env:SENTRY_ORG --project screenpipe-app apps/screenpipe-app-tauri/src-tauri/target/${{ matrix.target }}/release/
- name: Upload debug symbols to Sentry (macOS)
if: matrix.os_type == 'macos'
@@ -1022,9 +995,9 @@ jobs:
$env:PATH += ";C:\Program Files\Amazon\AWSCLIV2"
}
$version = (Select-String -Path apps/screenpipe-app-tauri/src-tauri/Cargo.toml -Pattern '^version = "(.*)"').Matches[0].Groups[1].Value
- $bundleDir = "apps/screenpipe-app-tauri/src-tauri/target/x86_64-pc-windows-msvc/release/bundle"
+ $bundleDir = "apps/screenpipe-app-tauri/src-tauri/target/${{ matrix.target }}/release/bundle"
$r2Endpoint = "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
- $r2Prefix = "s3://screenpipe-releases/releases/$version/x86_64-pc-windows-msvc"
+ $r2Prefix = "s3://screenpipe-releases/releases/$version/${{ matrix.target }}"
Write-Host "uploading Windows bundles for v$version to R2..."
diff --git a/.gitignore b/.gitignore
index 59c7d68ed..dc178cadf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,3 +70,5 @@ screenpipe-app-tauri/src-tauri/.next/
# Claude Code
.claude/worktrees/
.claude/*.local* # local changes are specific to the individual developer, let's not check them in for everyone.
+apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-arm64-1.19.2/
+apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2/
diff --git a/apps/screenpipe-app-tauri/scripts/pre_build.js b/apps/screenpipe-app-tauri/scripts/pre_build.js
index 5ffd5259d..df423290d 100644
--- a/apps/screenpipe-app-tauri/scripts/pre_build.js
+++ b/apps/screenpipe-app-tauri/scripts/pre_build.js
@@ -17,6 +17,8 @@ const platform = {
darwin: 'macos',
linux: 'linux',
}[os.platform()]
+// Windows arch: 'x64' (amd64) or 'arm64' (aarch64) — used for bun binary name and ffmpeg/CRT paths
+const winArch = platform === 'windows' ? (process.arch === 'arm64' ? 'arm64' : 'x64') : null
const cwd = process.cwd()
console.log('cwd', cwd)
@@ -26,6 +28,9 @@ const config = {
windows: {
ffmpegName: 'ffmpeg-8.0.1-full_build-shared',
ffmpegUrl: 'https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-8.0.1-full_build-shared.7z',
+ // Windows ARM64 (aarch64-pc-windows-msvc) — tordona/ffmpeg-win-arm64, full-shared for bin/ + lib/
+ ffmpegNameArm64: 'ffmpeg-master-latest-full-shared-win-arm64',
+ ffmpegUrlArm64: 'https://github.com/tordona/ffmpeg-win-arm64/releases/download/latest/ffmpeg-master-latest-full-shared-win-arm64.7z',
},
linux: {
aptPackages: [
@@ -164,8 +169,9 @@ async function copyBunBinary() {
throw new Error('Could not find bun.exe in any expected location. Please check if bun is installed correctly');
}
- // Define the destination path
- bunDest1 = path.join(cwd, 'bun-x86_64-pc-windows-msvc.exe');
+ // Tauri externalBin looks for bun-{target_triple}; on Windows arm64 → aarch64-pc-windows-msvc, x64 → x86_64-pc-windows-msvc
+ const bunTripleSuffix = winArch === 'arm64' ? 'aarch64-pc-windows-msvc' : 'x86_64-pc-windows-msvc'
+ bunDest1 = path.join(cwd, `bun-${bunTripleSuffix}.exe`)
console.log('copying bun from:', bunSrc);
console.log('copying bun to:', bunDest1);
} else if (platform === 'macos' || platform === 'linux') {
@@ -288,48 +294,62 @@ if (platform == 'linux') {
}
// VC Redist discovery (Windows): vswhere + standard locations so pre_build/pre_dev and CI both work.
-// Microsoft.VC143.CRT = VS 2022 (v143) / 2015–2022 redist family; still current as of 2025.
+// CRT folder can be Microsoft.VC143.CRT (VS 2022), VC144, or VC145 (newer VS); all provide vcruntime140.dll.
const PROGRAM_FILES_X86 = process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)';
const PROGRAM_FILES_LIST = [process.env['ProgramFiles(x86)'], process.env['ProgramFiles']].filter(Boolean);
const VS_EDITIONS = ['Enterprise', 'Professional', 'Community', 'BuildTools'];
-const VS_YEARS = ['2025', '2022', '2019', '2017'];
+const VS_YEARS = ['18', '2026', '2025', '2022', '2019', '2017'];
const VSWHERE_DIR = path.join(PROGRAM_FILES_X86, 'Microsoft Visual Studio', 'Installer');
+const CRT_FOLDER_NAMES = ['Microsoft.VC145.CRT', 'Microsoft.VC144.CRT', 'Microsoft.VC143.CRT'];
-/** Resolve VC\\Redist\\MSVC\\{version} to the latest version subfolder and return x64 CRT path, or null */
-async function getMsvcCrtDirFromInstallRoot(installRoot) {
+/** Resolve VC\\Redist\\MSVC\\{version} to the latest version subfolder and return CRT path for arch (x64 or arm64), or null */
+async function getMsvcCrtDirFromInstallRoot(installRoot, arch = 'x64') {
const msvcPath = path.join(installRoot, 'VC', 'Redist', 'MSVC');
try {
const versions = await fs.readdir(msvcPath);
const numeric = versions.filter((v) => /^\d+\.\d+\.\d+/.test(v)).sort();
if (numeric.length === 0) return null;
const latest = numeric[numeric.length - 1];
- const crtDir = path.join(msvcPath, latest, 'x64', 'Microsoft.VC143.CRT');
- await fs.access(path.join(crtDir, 'vcruntime140.dll'));
- return crtDir;
+ const archPath = path.join(msvcPath, latest, arch);
+ for (const crtName of CRT_FOLDER_NAMES) {
+ const crtDir = path.join(archPath, crtName);
+ try {
+ await fs.access(path.join(crtDir, 'vcruntime140.dll'));
+ return crtDir;
+ } catch {
+ continue;
+ }
+ }
+ return null;
} catch {
return null;
}
}
-/** Find Microsoft.VC143.CRT dir: VCToolsRedistDir → vswhere → standard paths */
-async function findVc143CrtDir() {
+/** Find Microsoft.VC14*.CRT dir (143/144/145): VCToolsRedistDir → vswhere → standard paths. arch: 'x64' or 'arm64' (Windows ARM64). */
+async function findVc143CrtDir(arch = 'x64') {
if (process.env.VCToolsRedistDir) {
- const crtDir = path.join(process.env.VCToolsRedistDir, 'x64', 'Microsoft.VC143.CRT');
- try {
- await fs.access(path.join(crtDir, 'vcruntime140.dll'));
- console.log('Using VCToolsRedistDir:', crtDir);
- return crtDir;
- } catch (e) {
- console.warn('VCToolsRedistDir set but CRT not found:', e.message);
+ const base = path.join(process.env.VCToolsRedistDir, arch);
+ for (const crtName of CRT_FOLDER_NAMES) {
+ const crtDir = path.join(base, crtName);
+ try {
+ await fs.access(path.join(crtDir, 'vcruntime140.dll'));
+ console.log('Using VCToolsRedistDir:', crtDir);
+ return crtDir;
+ } catch (e) {
+ continue;
+ }
}
+ console.warn('VCToolsRedistDir set but no CRT (VC143/144/145) found');
}
const vswhereExe = path.join(VSWHERE_DIR, 'vswhere.exe');
+ const component = arch === 'arm64' ? 'Microsoft.VisualStudio.Component.VC.Tools.ARM64' : 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64';
try {
if (await fs.access(vswhereExe).then(() => true).catch(() => false)) {
- const installDir = (await $`"${vswhereExe}" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`.text()).trim();
+ const installDir = (await $`"${vswhereExe}" -latest -products * -requires ${component} -property installationPath`.text()).trim();
if (installDir) {
- const crtDir = await getMsvcCrtDirFromInstallRoot(installDir);
+ const crtDir = await getMsvcCrtDirFromInstallRoot(installDir, arch);
if (crtDir) {
console.log('Found with vswhere:', crtDir);
return crtDir;
@@ -340,11 +360,12 @@ async function findVc143CrtDir() {
console.warn('vswhere failed:', e.message);
}
+ // Fallback: same VS install often has both x64 and arm64 under MSVC\<ver>\
for (const progFiles of PROGRAM_FILES_LIST) {
for (const year of VS_YEARS) {
for (const edition of VS_EDITIONS) {
const installRoot = path.join(progFiles, 'Microsoft Visual Studio', year, edition);
- const crtDir = await getMsvcCrtDirFromInstallRoot(installRoot);
+ const crtDir = await getMsvcCrtDirFromInstallRoot(installRoot, arch);
if (crtDir) {
console.log('Found in standard location:', crtDir);
return crtDir;
@@ -353,42 +374,70 @@ async function findVc143CrtDir() {
}
}
- throw new Error('Microsoft VC143 CRT not found. Install Visual Studio with C++ tools or set VCToolsRedistDir.');
+ throw new Error(`Microsoft VC143/144/145 CRT (${arch}) not found. Install Visual Studio with C++ tools or set VCToolsRedistDir.`);
}
-// Copy VC143 CRT DLLs into src-tauri/vcredist for Tauri bundle (Windows only)
-async function copyVcredistDlls() {
+// Copy VC CRT DLLs (VC143/144/145) into src-tauri/vcredist for Tauri bundle (Windows only). arch: 'x64' or 'arm64'.
+async function copyVcredistDlls(arch = 'x64') {
const vcredistDir = path.join(cwd, 'vcredist');
await fs.mkdir(vcredistDir, { recursive: true });
- const crtDir = await findVc143CrtDir();
+ const crtDir = await findVc143CrtDir(arch);
const dlls = ['msvcp140.dll', 'msvcp140_1.dll', 'msvcp140_2.dll', 'vcruntime140.dll', 'vcruntime140_1.dll'];
for (const dll of dlls) {
await fs.copyFile(path.join(crtDir, dll), path.join(vcredistDir, dll));
}
- console.log('VC143 CRT DLLs copied to vcredist');
+ console.log('VC CRT DLLs copied to vcredist');
}
/* ########## Windows ########## */
if (platform == 'windows') {
const wgetPath = await findWget();
- // Setup FFMPEG
+ // Setup FFMPEG (x64: gyan.dev; arm64: tordona/ffmpeg-win-arm64)
if (!(await fs.exists(config.ffmpegRealname))) {
- await $`${wgetPath} --no-config --tries=10 --retry-connrefused --waitretry=10 --secure-protocol=auto --no-check-certificate --show-progress ${config.windows.ffmpegUrl} -O ${config.windows.ffmpegName}.7z`
- await $`7z x ${config.windows.ffmpegName}.7z`
- await $`mv ${config.windows.ffmpegName} ${config.ffmpegRealname}`
- await $`rm -rf ${config.windows.ffmpegName}.7z`
+ if (winArch === 'arm64') {
+ await $`${wgetPath} --no-config --tries=10 --retry-connrefused --waitretry=10 --secure-protocol=auto --no-check-certificate --show-progress ${config.windows.ffmpegUrlArm64} -O ${config.windows.ffmpegNameArm64}.7z`
+ await $`7z x ${config.windows.ffmpegNameArm64}.7z`
+ // tordona 7z extracts to a single folder; move its contents to ffmpeg (or rename if single top-level dir)
+ const entries = await fs.readdir(cwd, { withFileTypes: true })
+ const extractedDir = entries.find((d) => d.isDirectory() && d.name.startsWith('ffmpeg-') && d.name.includes('win-arm64'))
+ if (extractedDir) {
+ await fs.rename(path.join(cwd, extractedDir.name), path.join(cwd, config.ffmpegRealname))
+ } else {
+ await fs.mkdir(config.ffmpegRealname, { recursive: true })
+ for (const e of entries) {
+ if (e.name.endsWith('.7z') || e.name === config.ffmpegRealname) continue
+ await fs.rename(path.join(cwd, e.name), path.join(cwd, config.ffmpegRealname, e.name))
+ }
+ }
+ await fs.rm(path.join(cwd, `${config.windows.ffmpegNameArm64}.7z`), { force: true }).catch(() => {})
+ } else {
+ await $`${wgetPath} --no-config --tries=10 --retry-connrefused --waitretry=10 --secure-protocol=auto --no-check-certificate --show-progress ${config.windows.ffmpegUrl} -O ${config.windows.ffmpegName}.7z`
+ await $`7z x ${config.windows.ffmpegName}.7z`
+ await $`mv ${config.windows.ffmpegName} ${config.ffmpegRealname}`
+ await $`rm -rf ${config.windows.ffmpegName}.7z`
+ }
+ }
+
+ // Windows ARM64: tordona package has no lib/; create dummy so bundle resources "ffmpeg\lib\*" glob matches
+ if (winArch === 'arm64') {
+ const ffmpegLib = path.join(cwd, config.ffmpegRealname, 'lib')
+ await fs.mkdir(ffmpegLib, { recursive: true })
+ const placeholder = path.join(ffmpegLib, '.gitkeep')
+ if (!(await fs.exists(placeholder))) {
+ await fs.writeFile(placeholder, '')
+ }
}
- // Copy VC143 CRT DLLs for Tauri bundle (required in CI; optional locally)
+ // Copy VC143 CRT DLLs for Tauri bundle (required in CI; optional locally). Use arch matching current Windows (x64 or arm64).
const inCI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
if (inCI) {
- await copyVcredistDlls();
+ await copyVcredistDlls(winArch);
} else {
try {
- await copyVcredistDlls();
+ await copyVcredistDlls(winArch);
} catch (err) {
console.warn('Skipping VC redist DLL copy (optional outside CI):', err.message);
}
diff --git a/crates/screenpipe-audio/Cargo.toml b/crates/screenpipe-audio/Cargo.toml
index a4900d0ae..f02147cba 100644
--- a/crates/screenpipe-audio/Cargo.toml
+++ b/crates/screenpipe-audio/Cargo.toml
@@ -40,9 +40,7 @@ hf-hub = "0.3.2"
# https://github.com/pdeljanov/Symphonia/tree/master?tab=readme-ov-file#optimizations
symphonia = { version = "0.5.4", features = ["aac", "isomp4", "opt-simd"] }
rubato = "0.15.0"
-whisper-rs = { git = "https://github.com/tazz4843/whisper-rs.git", rev = "d38738df8dc54b12d2918494586ba0817c3cb12f", features = [
- "tracing_backend",
-] } # pin revision to avoid breaking changes
+whisper-rs = { git = "https://github.com/divanshu-go/whisper-rs.git", rev = "43a3a2cd4db3609fa266a0d695b00acb737be1b3", features = ["tracing_backend"] }
# Log
log = { workspace = true }
@@ -81,7 +79,7 @@ ort-sys = "=2.0.0-rc.6"
knf-rs = "0.3.2"
futures = "0.3.31"
deepgram = "0.6.4"
-audiopipe = { git = "https://github.com/screenpipe/audiopipe.git", rev = "c92760e", default-features = false, features = ["qwen3-asr-ggml"], optional = true }
+audiopipe = { git = "https://github.com/screenpipe/audiopipe.git", rev = "1785a66884a6a9a42826b1a0fbf5a17f7b5c53f4", default-features = false, features = ["qwen3-asr-ggml"], optional = true }
bytes = { version = "1.9.0", features = ["serde"] }
rand = "0.9.0"
@@ -89,7 +87,7 @@ rand = "0.9.0"
libpulse-binding = { version = "2.28", optional = true }
libpulse-simple-binding = { version = "2.28", optional = true }
-[target.'cfg(target_os = "windows")'.dependencies]
+[target.'cfg(all(target_os = "windows", target_arch = "x86_64"))'.dependencies]
ort = { version = "=2.0.0-rc.6", features = [
"download-binaries",
"copy-dylibs",
@@ -98,6 +96,14 @@ esaxx-rs = "0.1.10"
samplerate = { version = "0.2.4" }
libsamplerate-sys = "0.1.10"
+# Windows ARM64: use our own ONNX Runtime DLL at runtime (load-dynamic); no compile-time link, no ort.pyke.io cache
+[target.'cfg(all(target_os = "windows", target_arch = "aarch64"))'.dependencies]
+ort = { version = "=2.0.0-rc.6", default-features = false, features = ["load-dynamic"] }
+ort-sys = { version = "=2.0.0-rc.6", default-features = false, features = ["load-dynamic"] }
+esaxx-rs = "0.1.10"
+samplerate = { version = "0.2.4" }
+libsamplerate-sys = "0.1.10"
+
[target.'cfg(target_os = "macos")'.dependencies]
once_cell = "1.17.1"
objc = "0.2.7"
diff --git a/crates/screenpipe-audio/build.rs b/crates/screenpipe-audio/build.rs
index fa1f313dc..2862f1543 100644
--- a/crates/screenpipe-audio/build.rs
+++ b/crates/screenpipe-audio/build.rs
@@ -85,26 +85,42 @@ fn install_onnxruntime() {
use std::time::Duration;
use std::{path::Path, process::Command};
- // Use CPU-only onnxruntime — GPU (DirectML) causes issues on Intel integrated GPUs
- let target_dir =
- Path::new("../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2");
+ // Use CPU-only onnxruntime — GPU (DirectML) causes issues on Intel integrated GPUs.
+ // Windows ARM64 (aarch64-pc-windows-msvc) uses onnxruntime-win-arm64-*.
+ let arch_var = env::var("CARGO_CFG_TARGET_ARCH");
+ let arch = arch_var.as_deref().unwrap_or("x86_64");
+ let (pkg_name, zip_name) = if arch == "aarch64" {
+ (
+ "onnxruntime-win-arm64-1.19.2",
+ "onnxruntime-win-arm64-1.19.2.zip",
+ )
+ } else {
+ (
+ "onnxruntime-win-x64-1.19.2",
+ "onnxruntime-win-x64-1.19.2.zip",
+ )
+ };
+ let target_dir = Path::new("../../apps/screenpipe-app-tauri/src-tauri").join(pkg_name);
// 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 url = format!(
+ "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/{}",
+ zip_name
+ );
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 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");
+ fs::write(zip_name, &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"])
+ .args(["-o", zip_name])
.status()
.expect("failed to execute unzip");
@@ -112,9 +128,17 @@ fn install_onnxruntime() {
panic!("failed to install onnx binary");
}
if target_dir.exists() {
- fs::remove_dir_all(target_dir).expect("failed to remove existing directory");
+ 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(pkg_name, &target_dir).expect("failed to rename");
+ }
+ // Windows x86_64: emit link so we link against our extracted ONNX Runtime.
+ // Windows aarch64: we use load-dynamic; ort loads our DLL at runtime via init_ort_from_dll(), no link here.
+ if arch != "aarch64" {
+ println!(
+ "cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/{}/lib",
+ pkg_name
+ );
+ println!("cargo:rustc-link-lib=dylib=onnxruntime");
}
- println!("cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2/lib");
}
diff --git a/crates/screenpipe-engine/build.rs b/crates/screenpipe-engine/build.rs
index 4f018f31e..0da8eb118 100644
--- a/crates/screenpipe-engine/build.rs
+++ b/crates/screenpipe-engine/build.rs
@@ -1,6 +1,17 @@
#[cfg(target_os = "windows")]
fn link_onnx() {
- println!("cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2/lib");
+ let arch_var = std::env::var("CARGO_CFG_TARGET_ARCH");
+ let arch = arch_var.as_deref().unwrap_or("x86_64");
+ // Windows aarch64 uses load-dynamic: ort loads our DLL at runtime, no compile-time link.
+ if arch == "aarch64" {
+ return;
+ }
+ let pkg = "onnxruntime-win-x64-1.19.2";
+ println!(
+ "cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/{}/lib",
+ pkg
+ );
+ println!("cargo:rustc-link-lib=dylib=onnxruntime");
}
#[cfg(target_os = "macos")]