From 19e13c775c18134c14a313e34afd9ccc1adc5dce Mon Sep 17 00:00:00 2001 From: AropJoe Date: Sat, 10 Oct 2026 06:39:21 +0100 Subject: [PATCH] Installers: leave out ONNX Runtime's CUDA add-on, which Linux installs pulled in --- .github/workflows/installers.yml | 3 +++ scripts/after-pack.cjs | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 1656d31..c239eef 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -32,7 +32,10 @@ jobs: with: node-version: 22 cache: npm + # onnxruntime-node would download its NVIDIA (CUDA) add-on on Linux, hundreds of MB Duct never uses. - run: npm ci + env: + ONNXRUNTIME_NODE_INSTALL: skip - run: npm run build - run: node scripts/check-runtime-deps.mjs - run: npx electron-builder ${{ matrix.args }} --publish never diff --git a/scripts/after-pack.cjs b/scripts/after-pack.cjs index 945c13c..0507031 100644 --- a/scripts/after-pack.cjs +++ b/scripts/after-pack.cjs @@ -17,8 +17,11 @@ exports.default = async function afterPack(context) { for (const napi of readdirSync(bin)) { for (const os of readdirSync(join(bin, napi))) { for (const cpu of readdirSync(join(bin, napi, os))) { - if (os === platform && cpu === arch) kept++ - else rmSync(join(bin, napi, os, cpu), { recursive: true, force: true }) + if (os === platform && cpu === arch) { + kept++ + // GPU add-ons (CUDA, TensorRT): transcription runs on the CPU. + for (const f of readdirSync(join(bin, napi, os, cpu))) if (/providers_(cuda|tensorrt|rocm)/i.test(f)) rmSync(join(bin, napi, os, cpu, f), { force: true }) + } else rmSync(join(bin, napi, os, cpu), { recursive: true, force: true }) } if (!readdirSync(join(bin, napi, os)).length) rmSync(join(bin, napi, os), { recursive: true, force: true }) }