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: windows build

Louis Beaumont6f922f5db2c6
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 2b754d0ec..984e99b01 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -270,6 +270,19 @@ jobs:
docker-images: true
swap-storage: true
+ - name: Free Disk Space (Windows)
+ if: matrix.args == '--target x86_64-pc-windows-msvc'
+ run: |
+ # Remove unnecessary Windows components
+ Get-ChildItem -Path "C:\Windows\SoftwareDistribution\Download\" -Force | Remove-Item -Force -Recurse
+ Remove-Item -Path "C:\Windows\Temp\*" -Force -Recurse
+ # Clean npm cache
+ npm cache clean --force
+ # Clean cargo cache
+ cargo cache --autoclean
+ # Remove unused Windows features
+ dism.exe /online /cleanup-image /startcomponentcleanup /resetbase
+
- name: Build
uses: tauri-apps/tauri-action@v0
env:
@@ -296,6 +309,11 @@ jobs:
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ matrix.args == '--target x86_64-pc-windows-msvc' && '16' || matrix.platform == 'ubuntu-22.04' && '1' || '16' }}
# Enable incremental compilation for Windows
CARGO_INCREMENTAL: ${{ matrix.args == '--target x86_64-pc-windows-msvc' && '1' || '0' }}
+ # Windows specific optimizations (only applied when building for Windows)
+ CARGO_PROFILE_RELEASE_STRIP: ${{ matrix.args == '--target x86_64-pc-windows-msvc' && 'symbols' || '' }}
+ CARGO_PROFILE_RELEASE_PANIC: ${{ matrix.args == '--target x86_64-pc-windows-msvc' && 'abort' || '' }}
+ CARGO_PROFILE_RELEASE_INCREMENTAL: ${{ matrix.args == '--target x86_64-pc-windows-msvc' && 'false' || '' }}
+ RUSTFLAGS: ${{ matrix.args == '--target x86_64-pc-windows-msvc' && '-C target-feature=+crt-static -C link-arg=/LTCG' || '' }}
with:
args: ${{ matrix.tauri-args }}
projectPath: "./screenpipe-app-tauri"
diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.js
index 8ddd754f6..29e5577a4 100644
--- a/screenpipe-app-tauri/scripts/pre_build.js
+++ b/screenpipe-app-tauri/scripts/pre_build.js
@@ -3,10 +3,10 @@ import fs from 'fs/promises'
import os from 'os'
import path from 'path'
-const isDevMode = process.env.SCREENPIPE_APP_DEV === 'true' ||
- process.argv.includes('--dev') ||
- process.env.CARGO_PROFILE_DEV_DEBUG === 'true' ||
- false;
+const isDevMode = process.env.SCREENPIPE_APP_DEV === 'true' ||
+ process.argv.includes('--dev') ||
+ process.env.CARGO_PROFILE_DEV_DEBUG === 'true' ||
+ false;
const originalCWD = process.cwd()
// Change CWD to src-tauri
@@ -343,6 +343,25 @@ if (platform == 'windows') {
// Setup vcpkg packages with environment variables set inline
await $`SystemDrive=${process.env.SYSTEMDRIVE} SystemRoot=${process.env.SYSTEMROOT} windir=${process.env.WINDIR} C:\\vcpkg\\vcpkg.exe install ${config.windows.vcpkgPackages}`.quiet()
+
+ // Clean up unnecessary files
+ const cleanupPaths = [
+ 'ffmpeg/doc',
+ 'ffmpeg/presets',
+ 'ffmpeg/licenses',
+ path.join(onnxRuntimeName, 'docs'),
+ path.join(onnxRuntimeName, 'examples'),
+ path.join(onnxRuntimeName, 'LICENSE'),
+ ];
+
+ for (const cleanupPath of cleanupPaths) {
+ try {
+ await fs.rm(cleanupPath, { recursive: true, force: true });
+ console.log(`cleaned up ${cleanupPath}`);
+ } catch (error) {
+ console.warn(`failed to clean up ${cleanupPath}:`, error.message);
+ }
+ }
}
async function getMostRecentBinaryPath(targetArch, paths) {
@@ -384,8 +403,8 @@ if (platform == 'macos') {
}
// Check if we're doing a universal build
- const isUniversal = process.env.CARGO_BUILD_TARGET === undefined &&
- process.platform === 'darwin';
+ const isUniversal = process.env.CARGO_BUILD_TARGET === undefined &&
+ process.platform === 'darwin';
if (isUniversal) return ['arm64', 'x86_64'];
// Default to host architecture
@@ -404,12 +423,12 @@ if (platform == 'macos') {
console.log(`skipping ${arch} (not in target architectures)`);
continue;
}
-
+
if (process.env['SKIP_SCREENPIPE_SETUP']) {
console.log(`skipping ${arch} setup (SKIP_SCREENPIPE_SETUP=true)`);
continue;
}
-
+
console.log(`setting up screenpipe bin for ${arch}...`);
if (arch === 'arm64') {
@@ -434,7 +453,7 @@ if (platform == 'macos') {
const existingRpaths = [];
let match;
const outputStr = String(otoolOutput);
-
+
while ((match = rpathRegex.exec(outputStr)) !== null) {
existingRpaths.push(match[1]);
}
@@ -470,7 +489,7 @@ if (platform == 'macos') {
const dylib = 'libscreenpipe_arm64.dylib';
const dyLibSrc = path.join(cwd, 'screenpipe-vision', 'lib', dylib);
const dyLibDest = path.join(cwd, '..', 'Frameworks', dylib);
-
+
if (await fs.exists(dyLibSrc)) {
await fs.copyFile(dyLibSrc, dyLibDest);
console.log(`copied ${dylib} to Frameworks directory`);
@@ -500,7 +519,7 @@ if (platform == 'macos') {
if (mostRecentPath) {
await $`cp ${mostRecentPath} screenpipe-x86_64-apple-darwin`;
console.log(`Copied most recent x86_64 screenpipe binary from ${mostRecentPath}`);
-
+
try {
// hard code the dylib
if (await fs.exists('screenpipe-x86_64-apple-darwin') && !isDevMode) {
@@ -614,7 +633,7 @@ async function installOllamaSidecar() {
// For our self-hosted runners
if (platform === 'windows' && await fs.exists('C:\\ollama\\')) {
console.log('ollama sidecar already exists. skipping installation.');
- await fs.cp('C:\\ollama\\', ollamaDir, {recursive: true});
+ await fs.cp('C:\\ollama\\', ollamaDir, { recursive: true });
await fs.rename(path.join(ollamaDir, 'ollama.exe'), path.join(ollamaDir, ollamaExe));
return;
}
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 623c3a22f..b00030040 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.9.10"
+version = "0.9.11"
description = ""
authors = ["you"]
license = ""
diff --git a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
index 76601a68c..b6e8f6c17 100644
--- a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
+++ b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
@@ -12,4 +12,4 @@
"lib\\ollama\\*": "./"
}
}
-}
+}
\ No newline at end of file
diff --git a/screenpipe-server/Cargo.toml b/screenpipe-server/Cargo.toml
index 44c564d86..4eacdf8c6 100644
--- a/screenpipe-server/Cargo.toml
+++ b/screenpipe-server/Cargo.toml
@@ -46,7 +46,6 @@ thiserror="1"
#opentelemetry
opentelemetry = "0.21"
-opentelemetry-appender-tracing = "0.2"
opentelemetry-otlp = {version="0.14", features=["http-proto","reqwest-rustls","tokio","reqwest-client"]}
opentelemetry_sdk = {version="0.21",default-features = false,features=["rt-tokio"]}
opentelemetry-semantic-conventions = "0.13"
@@ -100,9 +99,6 @@ uuid = "1.5.0"
tempfile = "3.3.0"
-# video cache
-glob = "0.3.1"
-lru = "0.12.5"
url = { version = "2.2.0", optional = true }