From aab08d565252df954973d9c020798e7f2523b9b9 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Tue, 20 Oct 2026 22:15:15 +0400 Subject: [PATCH] fix: sync build on Windows --- scripts/sync-test-harness.mjs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/sync-test-harness.mjs b/scripts/sync-test-harness.mjs index ed3c87d8..2f7b7adf 100755 --- a/scripts/sync-test-harness.mjs +++ b/scripts/sync-test-harness.mjs @@ -150,6 +150,17 @@ async function startS3(bin) { return proc; } +// tsrs ships binaries for macOS arm64 and Linux only. Where it cannot run +// (Windows), tsc builds the same config. +function donutSyncBuildCommand(syncDir) { + try { + execSync("pnpm exec tsrs --version", { cwd: syncDir, stdio: "ignore" }); + return "pnpm build"; + } catch { + return "pnpm exec tsc -p tsconfig.build.json --incremental false"; + } +} + async function buildDonutSync() { log("Building donut-sync..."); // An incremental build silently skips emit when @@ -160,7 +171,7 @@ async function buildDonutSync() { force: true, }); await rm(path.join(syncDir, "dist"), { recursive: true, force: true }); - execSync("pnpm build", { + execSync(donutSyncBuildCommand(syncDir), { cwd: syncDir, stdio: process.env.VERBOSE ? "inherit" : "ignore", });