Skip to content

Commit d40c01e

Browse files
Rick Valdesclaude
andcommitted
Build on bun 1.3.13 to fix the Windows TUI (OpenTUI FFI crash)
`utmstack` crashed at startup on Windows with: Failed to initialize OpenTUI render library: bun:ffi dlopen() is not available in this build (TinyCC is disabled) Root cause is Bun issue #30717: a regression that landed in bun 1.3.14 (the Rust rewrite) drops the extraction step for FFI native libraries embedded via `with: {type:"file"}` in `bun build --compile` output. OpenTUI — opencode's renderer — loads its native library exactly that way, so the compiled binary cannot dlopen it. On macOS/Linux a fallback masks it; on Windows, where TinyCC is also disabled in compiled binaries, both paths fail and the TUI won't start. 1.3.14 is the latest Bun release and the fix (PR #30720) is in no release, so the only path is to build on 1.3.13, the last release before the regression. Verified on a real Windows 11 ARM64 machine: the 1.3.14 build exits immediately with the FFI error; the 1.3.13 build gets past renderer init and runs. macOS arm64 rebuilt on 1.3.13 and TUI-smoke-tested — no regression. Pins packageManager and CI setup-bun to 1.3.13. Adds a BUILD_TARGETS env filter to build.ts so a single platform can be built for testing without the full matrix. I had not tested the interactive TUI on Windows before the first release — only the MCP end-to-end and the CLI's headless `run` path on macOS. That gap is what let this ship. The release workflow's verify step still only checks --version; a TUI smoke test in CI is a follow-up worth doing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b454843 commit d40c01e

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/utmstack-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- uses: oven-sh/setup-bun@v2
4848
with:
49-
bun-version: 1.3.14
49+
bun-version: 1.3.13
5050

5151
- name: Resolve version
5252
id: version

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "AI-powered development tool",
55
"private": true,
66
"type": "module",
7-
"packageManager": "bun@1.3.14",
7+
"packageManager": "bun@1.3.13",
88
"scripts": {
99
"dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts",
1010
"dev:desktop": "bun --cwd packages/desktop dev",

packages/opencode/script/build.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,15 @@ const allTargets: {
116116
},
117117
]
118118

119-
const targets = singleFlag
119+
// BUILD_TARGETS=win32-arm64,linux-x64 restricts the build to specific targets
120+
// (matched as "<os>-<arch>[-baseline][-<abi>]"). Used for testing one platform
121+
// without a full matrix build.
122+
const onlyTargets = process.env.BUILD_TARGETS?.split(",").map((x) => x.trim()).filter(Boolean)
123+
const targetKey = (t) =>
124+
`${t.os}-${t.arch}${t.avx2 === false ? "-baseline" : ""}${t.abi ? "-" + t.abi : ""}`
125+
const targets = onlyTargets
126+
? allTargets.filter((item) => onlyTargets.includes(targetKey(item)))
127+
: singleFlag
120128
? allTargets.filter((item) => {
121129
if (item.os !== process.platform || item.arch !== process.arch) {
122130
return false

0 commit comments

Comments
 (0)