From c8386c6d3ab98433f5e48d8713efe37850012386 Mon Sep 17 00:00:00 2001 From: Afonsop Date: Tue, 15 Sep 2026 18:54:44 +0100 Subject: [PATCH] build: make the Trunk web-worker hook work on Windows Trunk passes TRUNK_STAGING_DIR as an extended-length path (\?\C:\...) on Windows, which MSYS sh tools cannot stat, so post_build failed and the whole web build aborted. Strip the prefix with sed before use; Linux CI paths are unaffected. (cherry picked from commit e3c86eca295d4c98316d4b1d8eae36a1c6469bc8) --- scripts/build-web-worker.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/build-web-worker.sh b/scripts/build-web-worker.sh index 7a278ed7d..2c96d5448 100644 --- a/scripts/build-web-worker.sh +++ b/scripts/build-web-worker.sh @@ -2,7 +2,11 @@ set -eu cargo build --locked --release --target wasm32-unknown-unknown --package ocs_web_worker -worker_out="${TRUNK_STAGING_DIR:?}/worker_pkg" +# On Windows, Trunk passes an extended-length path (\\?\C:\...) that MSYS sh +# tools cannot handle; strip the prefix so local web builds work there too. +# CI (Linux) paths never carry the prefix and pass through unchanged. +staging=$(printf '%s\n' "${TRUNK_STAGING_DIR:?}" | sed 's|^\\\\?\\||') +worker_out="${staging:?}/worker_pkg" mkdir -p "$worker_out" wasm-bindgen \ --target web \