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:
@@ -53,7 +53,17 @@ if errorlevel 1 (
|
|||||||
)
|
)
|
||||||
echo ✅ Build successful
|
echo ✅ Build successful
|
||||||
|
|
||||||
REM ── 6. Signer (optionnel) ─────────────────────────────────────
|
REM ── 5b. Copier python-embed à côté de l'exécutable pour le dev ─────
|
||||||
|
echo [5b/6] Copying python-embed to output dir...
|
||||||
|
set "OUTDIR=target\x86_64-pc-windows-msvc\release"
|
||||||
|
if exist "%OUTDIR%\python-embed" rmdir /s /q "%OUTDIR%\python-embed"
|
||||||
|
xcopy /E /I /Q "python-embed" "%OUTDIR%\python-embed"
|
||||||
|
REM Copier aussi le backend Python
|
||||||
|
if not exist "%OUTDIR%\backend" mkdir "%OUTDIR%\backend"
|
||||||
|
xcopy /E /I /Q "..\backend" "%OUTDIR%\backend"
|
||||||
|
echo ✅ Runtime copied
|
||||||
|
|
||||||
|
REM ── 6. Résultats ───────────────────────────────────────────────────
|
||||||
echo [6/6] Results:
|
echo [6/6] Results:
|
||||||
dir /b target\release\bundle\msi\*.msi 2>nul
|
dir /b target\release\bundle\msi\*.msi 2>nul
|
||||||
dir /b target\release\bundle\nsis\*.exe 2>nul
|
dir /b target\release\bundle\nsis\*.exe 2>nul
|
||||||
|
|||||||
+9
-2
@@ -10,10 +10,17 @@ struct BackendProcess(Mutex<Option<Child>>);
|
|||||||
// ── Sidecar : spawn Python backend ──────────────────────────────────────────
|
// ── Sidecar : spawn Python backend ──────────────────────────────────────────
|
||||||
|
|
||||||
fn spawn_backend() -> Result<Child, String> {
|
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") {
|
let python = if cfg!(target_os = "windows") {
|
||||||
"./python-embed/python.exe"
|
exe_dir.join("python-embed").join("python.exe")
|
||||||
} else {
|
} else {
|
||||||
"./python-embed/bin/python3"
|
exe_dir.join("python-embed").join("bin").join("python3")
|
||||||
};
|
};
|
||||||
|
|
||||||
let child = Command::new(python)
|
let child = Command::new(python)
|
||||||
|
|||||||
Reference in New Issue
Block a user