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(release): build Windows Vulkan dependencies with Ninja

screenpipe Windows autonomous worker1e0e672a0b9e
diff --git a/.github/scripts/release-workflows.test.ts b/.github/scripts/release-workflows.test.ts
index 590e6d092..fff794536 100644
--- a/.github/scripts/release-workflows.test.ts
+++ b/.github/scripts/release-workflows.test.ts
@@ -4,9 +4,10 @@
import { expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { join } from "node:path";
+import { fileURLToPath } from "node:url";
import { dispatchEnterprise, reportEnterprise } from "./enterprise-release.cjs";
-const root = new URL("../../", import.meta.url).pathname;
+const root = fileURLToPath(new URL("../../", import.meta.url));
const readYaml = (path: string): any => Bun.YAML.parse(readFileSync(join(root, path), "utf8"));
const app = readYaml(".github/workflows/release-app.yml");
const enterprise = readYaml(".github/workflows/release-enterprise.yml");
@@ -95,6 +96,18 @@ test("both Windows builds use the shared install action from the workflow revisi
expect(action.runs.steps[0].shell).toBe("pwsh");
});
+test("all Windows native dependency builds select the shared Ninja setup", () => {
+ const appStep = app.jobs["publish-tauri"].steps.find((step: any) => step.name === "Configure Ninja for Windows native dependencies");
+ expect(appStep.if).toBe("matrix.os_type == 'windows'");
+ expect(appStep.run).toBe("./.github/scripts/setup-ninja-windows.ps1");
+
+ const enterpriseStep = enterprise.jobs["release-enterprise-windows"].steps.find(
+ (step: any) => step.name === "Configure Ninja for Windows native dependencies",
+ );
+ expect(enterpriseStep.run).toBe("./.github/scripts/setup-ninja-windows.ps1");
+ expect(readFileSync(join(root, ".github/scripts/setup-ninja-windows.ps1"), "utf8")).toContain('"CMAKE_GENERATOR=Ninja"');
+});
+
test("completion reports every platform even if one is failed or skipped", () => {
const gate = enterprise.jobs["enterprise-complete"];
expect(gate.if).toBe("always()");
diff --git a/.github/scripts/setup-ninja-windows.ps1 b/.github/scripts/setup-ninja-windows.ps1
new file mode 100644
index 000000000..6351d9692
--- /dev/null
+++ b/.github/scripts/setup-ninja-windows.ps1
@@ -0,0 +1,60 @@
+# screenpipe — AI that knows everything you've seen, said, or heard
+# https://screenpipe.com
+
+[CmdletBinding()]
+param(
+ [string]$TargetDirectory = $env:CARGO_TARGET_DIR
+)
+
+$ErrorActionPreference = 'Stop'
+
+$ninja = Get-Command ninja.exe -ErrorAction SilentlyContinue
+if (-not $ninja) {
+ $knownPaths = @('C:\Program Files\Ninja', 'C:\Tools\Ninja')
+ $ninjaDirectory = $knownPaths |
+ Where-Object { Test-Path -LiteralPath "$_\ninja.exe" } |
+ Select-Object -First 1
+
+ if (-not $ninjaDirectory) {
+ if (Get-Command winget.exe -ErrorAction SilentlyContinue) {
+ winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent
+ $ninjaDirectory = $knownPaths |
+ Where-Object { Test-Path -LiteralPath "$_\ninja.exe" } |
+ Select-Object -First 1
+ }
+
+ if (-not $ninjaDirectory) {
+ $archive = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'ninja-winarm64.zip' } else { 'ninja-win.zip' }
+ $zip = Join-Path $env:RUNNER_TEMP $archive
+ $ninjaDirectory = 'C:\Tools\Ninja'
+ Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/latest/download/$archive" -OutFile $zip
+ New-Item -ItemType Directory -Force -Path $ninjaDirectory | Out-Null
+ Expand-Archive -LiteralPath $zip -DestinationPath $ninjaDirectory -Force
+ }
+ }
+
+ $ninjaDirectory | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
+ $env:Path = "$ninjaDirectory;$env:Path"
+ $ninja = Get-Command ninja.exe -ErrorAction Stop
+}
+
+"CMAKE_GENERATOR=Ninja" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+$env:CMAKE_GENERATOR = 'Ninja'
+Write-Host "Using Ninja $(& $ninja.Source --version) at $($ninja.Source)"
+
+if ($TargetDirectory -and (Test-Path -LiteralPath $TargetDirectory)) {
+ $targetRoot = (Get-Item -LiteralPath $TargetDirectory).FullName.TrimEnd('\')
+ Get-ChildItem -LiteralPath $targetRoot -Filter CMakeCache.txt -File -Recurse -ErrorAction SilentlyContinue |
+ ForEach-Object {
+ $generator = Select-String -LiteralPath $_.FullName -Pattern '^CMAKE_GENERATOR:(?:INTERNAL|UNINITIALIZED)=(.+)$' |
+ Select-Object -First 1
+ if ($generator -and $generator.Matches[0].Groups[1].Value -ne 'Ninja') {
+ $buildDirectory = (Get-Item -LiteralPath $_.Directory.FullName).FullName
+ if (-not $buildDirectory.StartsWith("$targetRoot\", [StringComparison]::OrdinalIgnoreCase)) {
+ throw "Refusing to remove CMake cache outside target directory: $buildDirectory"
+ }
+ Write-Host "Removing stale $($generator.Matches[0].Groups[1].Value) CMake build directory: $buildDirectory"
+ Remove-Item -LiteralPath $buildDirectory -Recurse -Force
+ }
+ }
+}
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 29ad25f0a..ebbd01921 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -699,40 +699,10 @@ jobs:
shell: pwsh
run: ./.github/scripts/setup-vulkan-windows.ps1 -Architecture ${{ matrix.target == 'aarch64-pc-windows-msvc' && 'arm64' || 'x64' }} -InstallSdk
- - name: Install Ninja (ARM64)
- if: matrix.os_type == 'windows' && matrix.target == 'aarch64-pc-windows-msvc'
+ - name: Configure Ninja for Windows native dependencies
+ if: matrix.os_type == 'windows'
shell: pwsh
- run: |
- # The windows-11-arm runner image pre-installs Ninja at C:\Tools\Ninja
- # but winget is NOT on PATH by default - so blindly calling
- # `winget install` fails with CommandNotFoundException and kills
- # the build even though Ninja is already available. Check first,
- # fall back to winget only if both the pre-installed path AND the
- # winget CLI are present.
- $paths = @("C:\Program Files\Ninja", "C:\Tools\Ninja")
- $found = $paths | Where-Object { Test-Path "$_\ninja.exe" } | Select-Object -First 1
-
- if (-not $found) {
- Write-Host "Ninja not found in preinstalled paths, trying winget..."
- if (Get-Command winget -ErrorAction SilentlyContinue) {
- winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent
- $found = $paths | Where-Object { Test-Path "$_\ninja.exe" } | Select-Object -First 1
- } else {
- Write-Host "winget unavailable on this runner - downloading Ninja release zip"
- $zip = "$env:RUNNER_TEMP\ninja.zip"
- Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/latest/download/ninja-winarm64.zip" -OutFile $zip
- $dest = "C:\Tools\Ninja"
- New-Item -ItemType Directory -Force -Path $dest | Out-Null
- Expand-Archive -Path $zip -DestinationPath $dest -Force
- $found = $dest
- }
- }
-
- if (-not $found) { throw "Ninja not found and could not be installed" }
- Write-Host "Using Ninja at: $found"
- echo $found | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- $env:Path = "$found;" + $env:Path
- ninja --version
+ run: ./.github/scripts/setup-ninja-windows.ps1
- name: Verify Windows download support
if: matrix.os_type == 'windows'
diff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.yml
index a9444883a..d8596cd13 100644
--- a/.github/workflows/release-enterprise.yml
+++ b/.github/workflows/release-enterprise.yml
@@ -356,6 +356,10 @@ jobs:
shell: pwsh
run: ./.github/scripts/setup-vulkan-windows.ps1 -Architecture x64 -InstallSdk -StageRuntimeDirectory apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.24.2/lib
+ - name: Configure Ninja for Windows native dependencies
+ shell: pwsh
+ run: ./.github/scripts/setup-ninja-windows.ps1
+
- name: Use enterprise config
shell: bash
run: cp -p apps/screenpipe-app-tauri/src-tauri/tauri.enterprise.conf.json apps/screenpipe-app-tauri/src-tauri/tauri.conf.json
diff --git a/Cargo.lock b/Cargo.lock
index 65323a538..e373a97a7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12227,7 +12227,7 @@ dependencies = [
[[package]]
name = "whisper-rs"
version = "0.16.0"
-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"
+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"
dependencies = [
"libc",
"tracing",
@@ -12237,7 +12237,7 @@ dependencies = [
[[package]]
name = "whisper-rs-sys"
version = "0.15.0"
-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"
+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"
dependencies = [
"bindgen 0.72.1",
"cfg-if",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 71215d623..4a5486a62 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -16410,7 +16410,7 @@ dependencies = [
[[package]]
name = "whisper-rs"
version = "0.16.0"
-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"
+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"
dependencies = [
"libc",
"tracing",
@@ -16420,7 +16420,7 @@ dependencies = [
[[package]]
name = "whisper-rs-sys"
version = "0.15.0"
-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"
+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"
dependencies = [
"bindgen 0.72.1",
"cfg-if 1.0.4",
diff --git a/crates/screenpipe-audio/Cargo.toml b/crates/screenpipe-audio/Cargo.toml
index 8738c7f0e..ee5f0e46d 100644
--- a/crates/screenpipe-audio/Cargo.toml
+++ b/crates/screenpipe-audio/Cargo.toml
@@ -49,7 +49,7 @@ hf-hub = { workspace = true }
# 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/screenpipe/whisper-rs.git", rev = "97e4070", features = ["tracing_backend"] }
+whisper-rs = { git = "https://github.com/EzraEllette/whisper-rs.git", rev = "b649c3fccc8dcee4512c2778b049e64aa2d15978", features = ["tracing_backend"] }
# Log
log = { workspace = true }