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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
perf(ci): remove Windows release bottlenecks
Ezra Ellette915683501d2a
diff --git a/.github/actions/setup-persistent-windows-cache/action.yml b/.github/actions/setup-persistent-windows-cache/action.ymlindex de7fdbfec..2be8a3fc7 100644--- a/.github/actions/setup-persistent-windows-cache/action.yml+++ b/.github/actions/setup-persistent-windows-cache/action.yml@@ -30,6 +30,7 @@ runs:$cacheRoot = 'S:\screenpipe-cache'$persistentTarget = "$cacheRoot\targets-v3\$env:SCREENPIPE_RELEASE_FLAVOR\$env:SCREENPIPE_RELEASE_TARGET"+ $persistentNodeModules = "$cacheRoot\node-modules-v1\$env:SCREENPIPE_RELEASE_FLAVOR\$env:SCREENPIPE_RELEASE_TARGET"$workspaceTarget = "$env:GITHUB_WORKSPACE\apps\screenpipe-app-tauri\src-tauri\target"$workspaceNodeModules = "$env:GITHUB_WORKSPACE\apps\screenpipe-app-tauri\node_modules"$workspaceTauri = "$env:GITHUB_WORKSPACE\apps\screenpipe-app-tauri\.tauri"@@ -42,15 +43,14 @@ runs:"$cacheRoot\bun","$cacheRoot\native-deps",$persistentTarget,- "$cacheRoot\tauri-v2\$env:SCREENPIPE_RELEASE_FLAVOR\$env:SCREENPIPE_RELEASE_TARGET",- "$cacheRoot\signed-binaries-v2"+ $persistentNodeModules,+ "$cacheRoot\tauri-v2\$env:SCREENPIPE_RELEASE_FLAVOR\$env:SCREENPIPE_RELEASE_TARGET") | ForEach-Object { New-Item -ItemType Directory -Force -Path $_ | Out-Null }# Bundle output is release-specific. Compiler outputs and downloads stay warm.Remove-Item "$persistentTarget\$env:SCREENPIPE_RELEASE_TARGET\release\bundle" -Recurse -Force -ErrorAction SilentlyContinue- Remove-Item $workspaceNodeModules -Recurse -Force -ErrorAction SilentlyContinue- foreach ($path in @($workspaceTarget, $workspaceTauri, $shortTarget)) {+ foreach ($path in @($workspaceTarget, $workspaceNodeModules, $workspaceTauri, $shortTarget)) {if (-not (Test-Path $path)) { continue }$item = Get-Item $path -Forceif ($item.Attributes -band [IO.FileAttributes]::ReparsePoint) {@@ -65,6 +65,8 @@ runs:if ($LASTEXITCODE -ne 0) { throw 'failed to create persistent short target junction' }cmd /c mklink /J $workspaceTarget $shortTargetif ($LASTEXITCODE -ne 0) { throw 'failed to attach workspace target junction' }+ cmd /c mklink /J $workspaceNodeModules $persistentNodeModules+ if ($LASTEXITCODE -ne 0) { throw 'failed to attach persistent node_modules junction' }cmd /c mklink /J $workspaceTauri "$cacheRoot\tauri-v2\$env:SCREENPIPE_RELEASE_FLAVOR\$env:SCREENPIPE_RELEASE_TARGET"if ($LASTEXITCODE -ne 0) { throw 'failed to attach persistent Tauri cache' }@@ -75,8 +77,7 @@ runs:"SCCACHE_DIR=$cacheRoot\sccache",'RUSTC_WRAPPER=sccache',"BUN_INSTALL_CACHE_DIR=$cacheRoot\bun",- "SCREENPIPE_NATIVE_CACHE_DIR=$cacheRoot\native-deps",- "SCREENPIPE_SIGNED_BINARY_CACHE_DIR=$cacheRoot\signed-binaries-v2"+ "SCREENPIPE_NATIVE_CACHE_DIR=$cacheRoot\native-deps") | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append"$cacheRoot\cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Appenddiff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.ymlindex d2ff6b0fe..ae6fa2136 100644--- a/.github/workflows/release-app.yml+++ b/.github/workflows/release-app.yml@@ -1098,8 +1098,9 @@ jobs:ESIGNER_PASSWORD: ${{ secrets.ESIGNER_PASSWORD }}ESIGNER_TOTP_SECRET: ${{ secrets.ESIGNER_TOTP_SECRET }}ESIGNER_CREDENTIAL_ID: ${{ secrets.ESIGNER_CREDENTIAL_ID }}- # Optimize for build speed on Windows- CARGO_PROFILE_RELEASE_LTO: thin+ # Final Windows links are a release bottleneck; ThinLTO added minutes+ # while runtime dependencies already ship optimized code.+ CARGO_PROFILE_RELEASE_LTO: "false"CARGO_PROFILE_RELEASE_OPT_LEVEL: "2"CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"# Enable incremental compilation for Windowsdiff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.ymlindex 5acd42333..fbe9981b9 100644--- a/.github/workflows/release-enterprise.yml+++ b/.github/workflows/release-enterprise.yml@@ -326,7 +326,8 @@ jobs:ESIGNER_PASSWORD: ${{ secrets.ESIGNER_PASSWORD }}ESIGNER_TOTP_SECRET: ${{ secrets.ESIGNER_TOTP_SECRET }}ESIGNER_CREDENTIAL_ID: ${{ secrets.ESIGNER_CREDENTIAL_ID }}- CARGO_PROFILE_RELEASE_LTO: thin+ # Match Consumer: avoid paying ThinLTO on every versioned app link.+ CARGO_PROFILE_RELEASE_LTO: "false"CARGO_PROFILE_RELEASE_OPT_LEVEL: "2"CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"CARGO_INCREMENTAL: "true"diff --git a/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1 b/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1index 99a0b4096..d8a6a993f 100644--- a/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1+++ b/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1@@ -12,8 +12,6 @@ param([string]$FilePath)-$ErrorActionPreference = 'Stop'-# Skip if credentials aren't set (local dev builds)if (-not $env:ESIGNER_USERNAME -or -not $env:ESIGNER_PASSWORD) {Write-Host "Skipping code signing (no credentials): $FilePath"@@ -70,78 +68,6 @@ if (-not ($signableExts -contains $ext)) {$requiresExeAlias = $true}-function Test-ScreenpipeAuthenticodeSignature {- param(- [Parameter(Mandatory=$true)]- [string]$Path- )-- try {- $signature = Get-AuthenticodeSignature $Path -ErrorAction Stop- if ($signature.Status -eq 'Valid') {- return $true- }- Write-Host "WARN: Authenticode status is $($signature.Status): $Path"- } catch {- # Windows ARM64 hosted runners can find Get-AuthenticodeSignature while- # failing to autoload Microsoft.PowerShell.Security. The workflow already- # locates signtool.exe for Tauri, so use the SDK verifier as a fallback.- Write-Host "WARN: Get-AuthenticodeSignature unavailable: $($_.Exception.Message)"- $signtoolPath = $env:TAURI_WINDOWS_SIGNTOOL_PATH- if (-not $signtoolPath) {- $signtoolCommand = Get-Command signtool.exe -ErrorAction SilentlyContinue- if ($signtoolCommand) {- $signtoolPath = $signtoolCommand.Source- }- }-- if ($signtoolPath -and (Test-Path $signtoolPath)) {- & $signtoolPath verify /pa /all $Path | Out-Host- if ($LASTEXITCODE -eq 0) {- return $true- }- Write-Host "WARN: signtool verification failed with exit $LASTEXITCODE`: $Path"- } else {- Write-Host "WARN: PowerShell verifier unavailable and signtool.exe not found"- }- }-- return $false-}--$originalFilePath = $FilePath-$signatureCacheFile = $null-if ($env:SCREENPIPE_SIGNED_BINARY_CACHE_DIR -and $env:ESIGNER_CREDENTIAL_ID) {- New-Item -ItemType Directory -Force -Path $env:SCREENPIPE_SIGNED_BINARY_CACHE_DIR | Out-Null- $fileHashAlgorithm = [System.Security.Cryptography.SHA256]::Create()- $fileStream = [System.IO.File]::OpenRead($originalFilePath)- try {- $unsignedHash = ([BitConverter]::ToString($fileHashAlgorithm.ComputeHash($fileStream))).Replace('-', '').ToLowerInvariant()- } finally {- $fileStream.Dispose()- $fileHashAlgorithm.Dispose()- }- $cacheIdentity = "v1|$env:ESIGNER_CREDENTIAL_ID|$unsignedHash"- $sha256 = [System.Security.Cryptography.SHA256]::Create()- try {- $cacheKeyBytes = [System.Text.Encoding]::UTF8.GetBytes($cacheIdentity)- $signatureCacheKey = ([BitConverter]::ToString($sha256.ComputeHash($cacheKeyBytes))).Replace('-', '').ToLowerInvariant()- } finally {- $sha256.Dispose()- }- $signatureCacheFile = Join-Path $env:SCREENPIPE_SIGNED_BINARY_CACHE_DIR "$signatureCacheKey.exe"-- if (Test-Path -LiteralPath $signatureCacheFile) {- if (Test-ScreenpipeAuthenticodeSignature -Path $signatureCacheFile) {- Copy-Item -LiteralPath $signatureCacheFile -Destination $originalFilePath -Force- Write-Host "Reused verified signed binary: $originalFilePath"- exit 0- }- Write-Host "WARN: removing invalid signed binary cache entry: $signatureCacheFile"- Remove-Item -LiteralPath $signatureCacheFile -Force- }-}-$jarFile = Get-ChildItem $env:CODESIGNTOOL_PATH -Recurse -Filter "code_sign_tool*.jar" | Select-Object -First 1$javaFile = Get-ChildItem $env:CODESIGNTOOL_PATH -Recurse -Filter "java.exe" | Select-Object -First 1@@ -150,6 +76,7 @@ if (-not $jarFile -or -not $javaFile) {exit 1}+$originalFilePath = $FilePath$temporarySigningCopy = $nullif ($requiresExeAlias) {$temporarySigningCopy = "$FilePath.signing.exe"@@ -265,8 +192,40 @@ if (-not $signed) {exit 1}-if (-not (Test-ScreenpipeAuthenticodeSignature -Path $signedFile)) {- Write-Host "ERROR: signed output failed Authenticode verification: $signedFile"+$signatureValid = $false+$signatureStatus = "unknown"+try {+ $signature = Get-AuthenticodeSignature $signedFile -ErrorAction Stop+ $signatureStatus = $signature.Status+ $signatureValid = ($signature.Status -eq 'Valid')+} catch {+ # Windows ARM64 hosted runners can find Get-AuthenticodeSignature while+ # failing to autoload Microsoft.PowerShell.Security. The workflow already+ # locates signtool.exe for Tauri, so use the SDK verifier as a fallback.+ Write-Host "WARN: Get-AuthenticodeSignature unavailable: $($_.Exception.Message)"+ $signtoolPath = $env:TAURI_WINDOWS_SIGNTOOL_PATH+ if (-not $signtoolPath) {+ $signtoolCommand = Get-Command signtool.exe -ErrorAction SilentlyContinue+ if ($signtoolCommand) {+ $signtoolPath = $signtoolCommand.Source+ }+ }++ if ($signtoolPath -and (Test-Path $signtoolPath)) {+ & $signtoolPath verify /pa /all $signedFile+ if ($LASTEXITCODE -eq 0) {+ $signatureValid = $true+ $signatureStatus = "Valid (signtool fallback)"+ } else {+ $signatureStatus = "signtool exit $LASTEXITCODE"+ }+ } else {+ $signatureStatus = "PowerShell verifier unavailable and signtool.exe not found"+ }+}++if (-not $signatureValid) {+ Write-Host "ERROR: signed output failed Authenticode verification (status=$signatureStatus): $signedFile"if (Test-Path $signedDir) {Remove-Item $signedDir -Recurse -Force}@@ -277,17 +236,6 @@ if (-not (Test-ScreenpipeAuthenticodeSignature -Path $signedFile)) {}Copy-Item $signedFile $originalFilePath -Force-if ($signatureCacheFile) {- $temporaryCacheFile = "$signatureCacheFile.$([Guid]::NewGuid().ToString('N')).tmp"- try {- Copy-Item $signedFile $temporaryCacheFile -Force- Move-Item $temporaryCacheFile $signatureCacheFile -Force- } finally {- if (Test-Path -LiteralPath $temporaryCacheFile) {- Remove-Item -LiteralPath $temporaryCacheFile -Force- }- }-}Remove-Item $signedDir -Recurse -Forceif ($temporarySigningCopy -and (Test-Path $temporarySigningCopy)) {Remove-Item $temporarySigningCopy -Forcediff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.jsonindex 8998cbc74..b2c9ded38 100644--- a/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json@@ -6,7 +6,8 @@"headerImage": "assets/nsis-header.bmp","sidebarImage": "assets/nsis-sidebar.bmp","installerIcon": "icons/icon.ico",- "installerHooks": "windows/hooks.nsh"+ "installerHooks": "windows/hooks.nsh",+ "compression": "zlib"}},"externalBin": [