fix: résoudre python-embed relativement à l'exe + copier runtime dans output dir
CI / lint (push) Successful in 30s
CI / security (push) Successful in 16s
CI / test (push) Successful in 29s
CI / build (push) Successful in 8s
CI / e2e (push) Failing after 42s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
CI / lint (push) Successful in 30s
CI / security (push) Successful in 16s
CI / test (push) Successful in 29s
CI / build (push) Successful in 8s
CI / e2e (push) Failing after 42s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
- main.rs: utiliser current_exe().parent() au lieu de ./ relatif au cwd - build-windows.bat: étape 5b qui copie python-embed/ et backend/ dans target/release
This commit is contained in:
+9
-2
@@ -10,10 +10,17 @@ struct BackendProcess(Mutex<Option<Child>>);
|
||||
// ── Sidecar : spawn Python backend ──────────────────────────────────────────
|
||||
|
||||
fn spawn_backend() -> Result<Child, String> {
|
||||
// Resolve python-embed relative to the executable, not cwd
|
||||
let exe_dir = std::env::current_exe()
|
||||
.map_err(|e| format!("Cannot get exe path: {}", e))?
|
||||
.parent()
|
||||
.ok_or("Cannot get exe parent dir")?
|
||||
.to_path_buf();
|
||||
|
||||
let python = if cfg!(target_os = "windows") {
|
||||
"./python-embed/python.exe"
|
||||
exe_dir.join("python-embed").join("python.exe")
|
||||
} else {
|
||||
"./python-embed/bin/python3"
|
||||
exe_dir.join("python-embed").join("bin").join("python3")
|
||||
};
|
||||
|
||||
let child = Command::new(python)
|
||||
|
||||
Reference in New Issue
Block a user