From 5a430d73ff0003c90293466fe1a33806ad807c75 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Sun, 19 Jul 2026 20:55:59 +0200 Subject: [PATCH] build(cef): compile via pnpm tauri:cef build instead of raw cargo --- .github/workflows/tauri-build.yml | 9 +-------- scripts/tauri.js | 25 +++++++------------------ 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index 07f82e6f8..41e2b1211 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -234,17 +234,10 @@ jobs: done # --- Linux: CEF runtime, packaged as deb / rpm / AppImage --- - - name: Build frontend - if: matrix.cef - shell: bash - run: pnpm build - - name: Build CEF binary if: matrix.cef shell: bash - run: | - cargo build --release --features cef --no-default-features \ - --manifest-path src-tauri/Cargo.toml + run: pnpm tauri:cef build - name: Build native packages if: matrix.cef diff --git a/scripts/tauri.js b/scripts/tauri.js index 3f035477d..e1c6c2ad7 100644 --- a/scripts/tauri.js +++ b/scripts/tauri.js @@ -9,10 +9,10 @@ * Examples: * script/tauri cef dev --verbose * script/tauri cef dev -- --verbose - * Both will run: cargo tauri dev --features cef -- --verbose --no-default-features + * Both will run: tauri dev --features cef -- --verbose --no-default-features */ -import { spawn } from 'child_process'; +import { run } from '@tauri-apps/cli'; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; import process from 'node:process'; @@ -57,24 +57,13 @@ if (!tauriArgs.includes('--')) { } tauriArgs.push('--no-default-features'); -const args = ['tauri', cmd, ...tauriArgs]; +const args = [cmd, ...tauriArgs]; -const command = 'cargo'; +process.chdir(join(__dirname, '..')); -logger.info(`${dim('Running:')} ${command} ${args.join(' ')}`); +logger.info(`${dim('Running:')} tauri ${args.join(' ')}`); -// Spawn the tauri process -const proc = spawn(command, args, { - stdio: 'inherit', - shell: false, - cwd: join(__dirname, '..'), -}); - -proc.on('error', (error) => { - logger.error(`Failed to start process: ${error.message}`); +run(args, 'tauri').catch((error) => { + logger.error(`Failed to run tauri: ${error?.message ?? error}`); process.exit(1); }); - -proc.on('exit', (code) => { - process.exit(code ?? 0); -});