Commit e4dea3f
fix(build): isolate subshell+redirect to bash helper for Windows
Bun Shell on Windows doesn't reliably handle `( ... ) > file` (subshell
with stdout redirect) -- see oven-sh/bun#11066, #11968. The four such
constructs in `package.json`'s `build`:
( git rev-parse HEAD 2>/dev/null || true ) > {browse,design,make-pdf}/dist/.version
(rm -f .*.bun-build || true)
silently break the `&&` chain mid-build on Windows. Symptoms: stale
binaries with no `.version` stamp, leftover `.bun-build` temp files,
and the post-build `chmod` step never runs.
Move the four constructs into a new `scripts/stamp-versions.sh` -- same
shell syntax, but invoked via `bash` so they never enter Bun Shell.
Matches the existing pattern in `browse/scripts/build-node-server.sh`
(which exists for a related bun-on-Windows reason).
Update `test/build-script-shell-compat.test.ts` (D-1460): the assertion
now accepts inline subshells OR a reference to `scripts/stamp-versions.sh`,
with a file-existence guard so a rename/move can't silently break
stamping. The anti-brace-group constraint is preserved.
Verified on Windows 11 (bun 1.3.11): `bun run build` completes, all 5
binaries are rebuilt + `.version` stamped + temp files cleaned.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 026751e commit e4dea3f
3 files changed
Lines changed: 40 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
33 | 42 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
37 | 47 | | |
38 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
39 | 52 | | |
40 | 53 | | |
0 commit comments