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

Get rid of old libs if ollama is preinstalled (#652)

Neptuneb32e0d3f2967
diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.js
index 29e5577a4..d64e36e4b 100644
--- a/screenpipe-app-tauri/scripts/pre_build.js
+++ b/screenpipe-app-tauri/scripts/pre_build.js
@@ -627,6 +627,34 @@ async function installOllamaSidecar() {
&& await fs.exists(path.join(ollamaDir, "ollama-x86_64-apple-darwin"))) ||
(platform !== 'macos' && await fs.exists(path.join(ollamaDir, ollamaExe)))) {
console.log('ollama sidecar already exists. skipping installation.');
+
+ // Remove older library versions to save storage
+ const libDir = path.join(ollamaDir, 'lib', 'ollama');
+ const oldLibs = [
+ 'cublas64_11.dll',
+ 'cublasLt64_11.dll',
+ 'cudart64_110.dll',
+ 'ggml_cuda_v11.dll',
+ 'rocblas',
+ 'rocblas.dll',
+ 'ggml_rocm.dll'
+ ];
+
+ for (const lib of oldLibs) {
+ try {
+ const libPath = path.join(libDir, lib);
+ const stat = await fs.stat(libPath);
+ if (stat.isDirectory()) {
+ await fs.rm(libPath, { recursive: true, force: true });
+ } else {
+ await fs.unlink(libPath);
+ }
+ console.log(`removed old library: ${lib}`);
+ } catch (error) {
+ console.warn(`failed to remove ${lib}:`, error.message);
+ }
+ }
+
return;
}