forked from BloopAI/bloop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pre-built
ort
, fix builds on Windows (BloopAI#231)
* Fix building on Windows Some key changes include: - Using the pre-built `onnxruntime` library - Patching `esaxx-rs` to avoid statically linking crt - Disabling telemetry on Windows builds at runtime - Moving the `model` folder to `apps/desktop/src-tauri` as the symlinked folder does not work in Windows - Move `config.json` to a `config/` subdirectory, as tauri ignores it on Windows otherwise This overrides the previous `ort` branch, so the two upstream branches still need to be unified, as it is not possible to have differing crate sources per target. * Add `npm start` script * Add ctags and qdrant Windows binaries * Add Windows cert thumbprint and timestamp URL * Remove indirect npm build scripts * Dynamically load ORT at runtime * Remove build.sh in favor of npm scripts * Remove lib folder and onnxruntime artifacts, clean up Windows bin files * Clean up windows cfg blocks, simplify disabling telemetry * Move model to apps/desktop/src-tauri Windows does not play well with symlinks, so we swap the symlink and source directory, so that the tauri app can build successfully. * Revert identifier to ai.bloop.bloop * Copy dylibs in Docker build stage * Update helm chart to pass --dylib-dir * Rename dylibs in image to dylib * Move telemetry logic to ort::EnvBuilder * Fix flakes * Fix deps task * Remove dependencies.yml --------- Co-authored-by: rsdy <p@symmetree.dev>
- Loading branch information
1 parent
be535ff
commit 96cffe4
Showing
194 changed files
with
203 additions
and
924 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
server/bleep/bleep.db* | ||
apps/desktop/src-tauri/dylibs/*.so | ||
apps/desktop/src-tauri/dylibs/*.dylib | ||
apps/desktop/src-tauri/dylibs/*.dll |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,41 @@ | ||
use std::{ | ||
env, fs, | ||
path::{Path, PathBuf}, | ||
thread, | ||
time::Duration, | ||
}; | ||
|
||
fn main() { | ||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
let profile_dir = out_dir | ||
// "target/.../build/bloop-hash" | ||
.parent() | ||
.unwrap() | ||
// "target/.../build" | ||
.parent() | ||
.unwrap() | ||
// "target/.../" | ||
.parent() | ||
.unwrap(); | ||
|
||
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); | ||
|
||
let dylib_name = match target_os.as_str() { | ||
"linux" => Some("libonnxruntime.so"), | ||
"macos" => Some("libonnxruntime.dylib"), | ||
"windows" => None, | ||
other => panic!("unknown OS {other}"), | ||
}; | ||
|
||
if let Some(dylib_name) = dylib_name { | ||
let dylib_path = profile_dir.join(dylib_name); | ||
|
||
while !dylib_path.exists() { | ||
thread::sleep(Duration::from_millis(500)); | ||
} | ||
|
||
fs::copy(dylib_path, Path::new(".").join("dylibs").join(dylib_name)).unwrap(); | ||
} | ||
|
||
tauri_build::build() | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Empty file.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.