From 1886d9c28837c4dcb0c2e634ab85d04ac1c44c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Tue, 19 May 2026 01:46:17 +0800 Subject: [PATCH] Keep Windows sidecar builds on the runner work drive Windows GitHub runners keep the checkout and Bun install cache on different drives, which can trip Bun's baseline compile-target extraction before Tauri packaging starts. Point desktop sidecar builds at the runner temp cache so dev and release workflows can still use the Windows x64 baseline runtime needed for older CPUs. Constraint: Bun upstream still has an open Windows cross-drive extraction issue for compile target downloads. Rejected: Revert to bun-windows-x64 | would reintroduce the older-CPU Illegal Instruction failure class. Confidence: high Scope-risk: narrow Directive: Keep desktop dev and release sidecar build cache handling aligned until Bun's Windows extraction fix is released and verified in Actions. Tested: bun test scripts/pr/release-workflow.test.ts; cd desktop && bun run test -- --run scripts/build-sidecars.test.ts; bun run check:policy; cd desktop && BUN_INSTALL_CACHE_DIR=/tmp/cc-haha-bun-install-cache TAURI_ENV_TARGET_TRIPLE=x86_64-pc-windows-msvc bun run build:sidecars Not-tested: GitHub Actions Windows runner rerun after push. --- .github/workflows/build-desktop-dev.yml | 1 + .github/workflows/release-desktop.yml | 1 + scripts/pr/release-workflow.test.ts | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.github/workflows/build-desktop-dev.yml b/.github/workflows/build-desktop-dev.yml index 517bb161..e973700b 100644 --- a/.github/workflows/build-desktop-dev.yml +++ b/.github/workflows/build-desktop-dev.yml @@ -126,6 +126,7 @@ jobs: - name: Build sidecars working-directory: desktop env: + BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }} run: bun run build:sidecars diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 74952d01..e10b1ef2 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -158,6 +158,7 @@ jobs: - name: Build sidecars working-directory: desktop env: + BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }} run: bun run build:sidecars diff --git a/scripts/pr/release-workflow.test.ts b/scripts/pr/release-workflow.test.ts index 13d848aa..b1a0c0d6 100644 --- a/scripts/pr/release-workflow.test.ts +++ b/scripts/pr/release-workflow.test.ts @@ -10,4 +10,23 @@ describe('release desktop workflow', () => { expect(workflow).not.toContain('needs: quality-preflight') expect(workflow).toContain('name: Build (${{ matrix.label }})') }) + + test('desktop build workflows keep Bun compile cache on the runner work drive', () => { + for (const workflowPath of [ + '.github/workflows/build-desktop-dev.yml', + '.github/workflows/release-desktop.yml', + ]) { + const workflow = readFileSync(workflowPath, 'utf8') + const buildSidecarsStep = workflow.match( + /- name: Build sidecars[\s\S]*?run: bun run build:sidecars/, + )?.[0] + + expect(buildSidecarsStep, workflowPath).toContain( + 'BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache', + ) + expect(buildSidecarsStep, workflowPath).toContain( + 'TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}', + ) + } + }) })