Skip to content

Commit

Permalink
fix: optimise build
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Nov 8, 2024
1 parent 879c001 commit 0171fe1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 32 deletions.
27 changes: 1 addition & 26 deletions screenpipe-app-tauri/scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ if (platform == 'windows') {
'ffmpeg/doc',
'ffmpeg/presets',
'ffmpeg/licenses',
'ffmpeg/include',
path.join(onnxRuntimeName, 'docs'),
path.join(onnxRuntimeName, 'examples'),
path.join(onnxRuntimeName, 'LICENSE'),
Expand Down Expand Up @@ -628,32 +629,6 @@ async function installOllamaSidecar() {
(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;
}
Expand Down
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.9.21"
version = "0.9.22"
description = ""
authors = ["you"]
license = ""
Expand Down
16 changes: 12 additions & 4 deletions screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
"ollama"
],
"resources": {
"ffmpeg\\bin\\*": "./",
"ffmpeg\\bin\\ffmpeg.exe": "./",
"ffmpeg\\bin\\ffprobe.exe": "./",
"ffmpeg\\bin\\*.dll": "./",
"ffmpeg\\lib\\*": "./",
"onnxruntime*\\lib\\*.dll": "./",
"lib\\ollama\\*": "./"
"onnxruntime*\\lib\\onnxruntime.dll": "./",
"onnxruntime*\\lib\\onnxruntime_providers_cuda.dll": "./",
"onnxruntime*\\lib\\onnxruntime_providers_shared.dll": "./",
"lib\\ollama\\cublas64_12.dll": "./",
"lib\\ollama\\cublasLt64_12.dll": "./",
"lib\\ollama\\cudart64_12.dll": "./",
"lib\\ollama\\runners\\cuda_v12\\**": "./runners/cuda_v12/",
"lib\\ollama\\runners\\cpu_avx2\\**": "./runners/cpu_avx2/"
}
}
}
}

2 comments on commit 0171fe1

@tribhuwan-kumar
Copy link
Contributor

@tribhuwan-kumar tribhuwan-kumar commented on 0171fe1 Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@louis030195

PS C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri> bun tauri dev
$ echo 'Warning: did you run bun scripts/pre_build.js and ALL other instructions carefully listed in https://docs.screenpi.pe/docs/getting-started ?' && tauri dev
Warning: did you run bun scripts/pre_build.js and ALL other instructions carefully listed in https://docs.screenpi.pe/docs/getting-started ?
    Running BeforeDevCommand (`bun run dev`)
$ next dev
  ▲ Next.js 14.2.4
  - Local:        http://localhost:3000

 ✓ Starting...
    Info Watching C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri for changes...
   Compiling screenpipe-app v0.9.22 (C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri)
error: failed to run custom build command for `screenpipe-app v0.9.22 (C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri)`

Caused by:
  process didn't exit successfully: `C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri\target\debug\build\screenpipe-app-8f43bb00ca688de5\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rerun-if-changed=tauri.conf.json
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-cfg=desktop
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rerun-if-changed=C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri\tauri.windows.conf.json
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=pe
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=screenpi
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev
  cargo:PERMISSION_FILES_PATH=C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri\target\debug\build\screenpipe-app-37a98d6aa9f6599b\out\app-manifest\__app__-permission-files
  cargo:rerun-if-changed=capabilities
  cargo:rustc-env=TAURI_ENV_TARGET_TRIPLE=x86_64-pc-windows-msvc
  cargo:rerun-if-changed=screenpipe-x86_64-pc-windows-msvc.exe
  cargo:rerun-if-changed=bun-x86_64-pc-windows-msvc.exe
  cargo:rerun-if-changed=ollama-x86_64-pc-windows-msvc.exe
  cargo:rerun-if-changed=ffmpeg\bin\avcodec-61.dll
  cargo:rerun-if-changed=ffmpeg\bin\avdevice-61.dll
  cargo:rerun-if-changed=ffmpeg\bin\avfilter-10.dll
  cargo:rerun-if-changed=ffmpeg\bin\avformat-61.dll
  cargo:rerun-if-changed=ffmpeg\bin\avutil-59.dll
  cargo:rerun-if-changed=ffmpeg\bin\postproc-58.dll
  cargo:rerun-if-changed=ffmpeg\bin\swresample-5.dll
  cargo:rerun-if-changed=ffmpeg\bin\swscale-8.dll
  cargo:rerun-if-changed=ffmpeg\lib\avcodec-61.def
  cargo:rerun-if-changed=ffmpeg\lib\avcodec.lib
  cargo:rerun-if-changed=ffmpeg\lib\avdevice-61.def
  cargo:rerun-if-changed=ffmpeg\lib\avdevice.lib
  cargo:rerun-if-changed=ffmpeg\lib\avfilter-10.def
  cargo:rerun-if-changed=ffmpeg\lib\avfilter.lib
  cargo:rerun-if-changed=ffmpeg\lib\avformat-61.def
  cargo:rerun-if-changed=ffmpeg\lib\avformat.lib
  cargo:rerun-if-changed=ffmpeg\lib\avutil-59.def
  cargo:rerun-if-changed=ffmpeg\lib\avutil.lib
  cargo:rerun-if-changed=ffmpeg\lib\libavcodec.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libavdevice.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libavfilter.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libavformat.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libavutil.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libpostproc.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libswresample.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\libswscale.dll.a
  cargo:rerun-if-changed=ffmpeg\lib\postproc-58.def
  cargo:rerun-if-changed=ffmpeg\lib\postproc.lib
  cargo:rerun-if-changed=ffmpeg\lib\swresample-5.def
  cargo:rerun-if-changed=ffmpeg\lib\swresample.lib
  cargo:rerun-if-changed=ffmpeg\lib\swscale-8.def
  cargo:rerun-if-changed=ffmpeg\lib\swscale.lib
  cargo:rerun-if-changed=lib\ollama\cublas64_12.dll
  cargo:rerun-if-changed=onnxruntime-win-x64-gpu-1.19.2\lib\onnxruntime.dll
  cargo:rerun-if-changed=ffmpeg\bin\ffmpeg.exe
  glob pattern lib\ollama\runners\cuda_v12\** path not found or didn't match any files.
error: script "dev" exited with code 255
error: script "tauri" exited with code 101

maybe there is something wrong with glob patterns.

ps: this fix this, idk how windows is weird!

            "lib\\ollama\\runners\\cuda_v12\\*": "./runners/cuda_v12/",
            "lib\\ollama\\runners\\cpu_avx2\\*": "./runners/cpu_avx2/"

@louis030195
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tribhuwan-kumar thx

i'm trying hard to release since yesterday but windows is stuck at this https://github.com/mediar-ai/screenpipe/actions/runs/11735592238/job/32693495120

which usually means you need to remove files from the installation, trying to remove AMD gpu stuff (since nobody asked for it yet)

Please sign in to comment.