Skip to content

Commit 2cf7a14

Browse files
committed
fix: use ghostty fork with Windows stdout fix, re-enable native Windows build
1 parent da85f9e commit 2cf7a14

File tree

2 files changed

+55
-9
lines changed

2 files changed

+55
-9
lines changed

.github/workflows/build-windows.yml

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,58 @@ env:
99
ZIG_VERSION: 0.15.2
1010

1111
jobs:
12-
# NOTE: Native Windows builds are temporarily disabled due to a ghostty dependency issue:
13-
# https://github.com/ghostty-org/ghostty/issues/10147
14-
# The ghostty code generators crash on Windows because they call stdout.end()
15-
# which tries to truncate stdout (not supported on Windows console handles).
16-
#
17-
# For now, we cross-compile from macOS and test on Windows.
18-
# The cross-compiled binaries work correctly (2879/2888 tests pass).
12+
build-native-windows:
13+
name: Windows - Native Build and Test
14+
runs-on: windows-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Bun
20+
uses: oven-sh/setup-bun@v2
21+
with:
22+
bun-version: latest
23+
24+
- name: Setup Zig
25+
uses: goto-bus-stop/setup-zig@v2
26+
with:
27+
version: ${{ env.ZIG_VERSION }}
28+
29+
- name: Install dependencies
30+
run: bun install
31+
32+
# Workaround for Zig 0.15.2 bug on Windows (https://github.com/ziglang/zig/issues/25805)
33+
# When cwd and cache path are on different drives, build fails
34+
# Setting cache dir explicitly to be on the same drive as the source
35+
- name: Build native with Zig (Windows only)
36+
working-directory: packages/core/src/zig
37+
run: zig build -Doptimize=ReleaseFast --cache-dir .zig-cache --global-cache-dir .zig-cache
38+
39+
- name: Copy native binaries to node_modules
40+
working-directory: packages/core
41+
run: bun scripts/build.ts --native --skip-zig-build
42+
43+
- name: Verify Windows binary exists
44+
shell: pwsh
45+
run: |
46+
if (!(Test-Path "packages/core/node_modules/@opentui/core-win32-x64/opentui.dll")) {
47+
Write-Error "Windows x64 binary missing!"
48+
exit 1
49+
}
50+
Write-Host "Windows x64 binary exists"
51+
Get-ChildItem "packages/core/node_modules/@opentui/core-win32-x64/"
52+
53+
- name: Run native tests
54+
working-directory: packages/core/src/zig
55+
run: zig build test --summary all --cache-dir .zig-cache --global-cache-dir .zig-cache
56+
57+
- name: Build lib
58+
working-directory: packages/core
59+
run: bun run build:lib
60+
61+
- name: Run JS tests
62+
working-directory: packages/core
63+
run: bun run test:js
1964

2065
build-on-macos:
2166
name: macOS - Cross-compile for Windows

packages/core/src/zig/build.zig.zon

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
.hash = "uucode-0.1.0-ZZjBPvoGQACkgWDKIrtI8CQcSXIufU3Kvty-pIfh02i2",
1010
},
1111
.ghostty = .{
12-
.url = "git+https://github.com/ghostty-org/ghostty.git#1c2db85aa41c7d929cb23b408229e297dce2758a",
13-
.hash = "ghostty-1.3.0-dev-5UdBC6IDPgQ28qiPT4e-lWQJav95I4XjR9ddmEsv-dyp",
12+
// Using fork with Windows fix: https://github.com/ghostty-org/ghostty/issues/10147
13+
.url = "git+https://github.com/remorses/ghostty.git#fd725490a14e4500b6676d9f4d67f6a566006bd0",
14+
.hash = "ghostty-1.3.0-dev-5UdBC1YFPgTu_jyuC0G4FGOhjsKgATa1Eqi5MY02ycYh",
1415
},
1516
},
1617
.paths = .{

0 commit comments

Comments
 (0)