Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: restrict Windows-specific code to x86_64 and update scripts

Louisd26422024578
diff --git a/package.json b/package.json
index 1c59a191a..9c201edfc 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,7 @@
"test:e2e:darwin": "echo 'E2E tests are not supported on macOS yet due to WebDriver limitations'",
"test:e2e": "run-script-os",
"dev:web": "yarn workspace @janhq/web-app dev",
- "dev:tauri": "CLEAN=true yarn build:icon && yarn copy:assets:tauri && tauri dev",
+ "dev:tauri": "yarn build:icon && yarn copy:assets:tauri && tauri dev",
"copy:assets:tauri": "cpx \"pre-install/*.tgz\" \"src-tauri/resources/pre-install/\"",
"download:lib": "node ./scripts/download-lib.mjs",
"download:bin": "node ./scripts/download-bin.mjs",
diff --git a/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/cleanup.rs b/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/cleanup.rs
index 853969dd5..c6b1b5c81 100644
--- a/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/cleanup.rs
+++ b/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/cleanup.rs
@@ -29,7 +29,7 @@ pub async fn cleanup_processes(state: State<'_, AppState>) {
}
}
- #[cfg(windows)]
+ #[cfg(all(windows, target_arch = "x86_64"))]
{
use windows_sys::Win32::System::Console::{GenerateConsoleCtrlEvent, CTRL_C_EVENT};
use windows_sys::Win32::Foundation::BOOL;
diff --git a/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs b/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
index 1daa97c7e..62f422f43 100644
--- a/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
+++ b/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
@@ -133,7 +133,7 @@ pub async fn load_llama_model(
// Optional: Redirect stdio if needed (e.g., for logging within Jan)
// command.stdout(Stdio::piped());
// command.stderr(Stdio::piped());
- #[cfg(windows)]
+ #[cfg(all(windows, target_arch = "x86_64"))]
{
command.creation_flags(CREATE_NEW_PROCESS_GROUP);
}
@@ -196,7 +196,7 @@ pub async fn unload_llama_model(
}
}
- #[cfg(windows)]
+ #[cfg(all(windows, target_arch = "x86_64"))]
{
use windows_sys::Win32::System::Console::{GenerateConsoleCtrlEvent, CTRL_C_EVENT};
use windows_sys::Win32::Foundation::BOOL;
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 175745a9d..26c9629e7 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -6,7 +6,7 @@
"build": {
"frontendDist": "../web-app/dist",
"devUrl": "http://localhost:1420",
- "beforeDevCommand": "cross-env IS_TAURI=true yarn dev:web",
+ "beforeDevCommand": "cross-env IS_TAURI=true CLEAN=true yarn dev:web",
"beforeBuildCommand": "cross-env IS_TAURI=true yarn build:web"
},
"app": {
@@ -90,10 +90,7 @@
"resources/lib/",
"binaries/**/*"
],
- "externalBin": [
- "resources/bin/bun",
- "resources/bin/uv"
- ],
+ "externalBin": ["resources/bin/bun", "resources/bin/uv"],
"linux": {
"appimage": {
"bundleMediaFramework": false,