Repository navigation
cmux-tui: pass the zig target on a native windows-gnu host - #12416
Conversation
ghostty-vt-sys forwards `-Dtarget` to `zig build` only when the cargo
target differs from the host. On a native `x86_64-pc-windows-gnu`
toolchain the two match, so zig receives no target and falls back to its
Windows default, the msvc ABI:
zig build-lib ... -target native-native-msvc ...
error: failed to find libc installation: WindowsSdkNotFound
That machine has no Visual Studio, which is the reason its Rust host is
windows-gnu in the first place, so the msvc fallback can never succeed
and `cargo build -p cmux-tui` fails before any crate compiles.
CI does not hit this: its Windows runners build from an msvc host to a
gnu target, so `target != host` holds and the target is forwarded.
`zig_target_for_rust_target` already maps `x86_64-pc-windows-gnu` to
`x86_64-windows-gnu`; this just lets the native case use it. The file
already branches on `target.contains("windows-gnu")` a few lines later
for the MinGW archive name.
Verified on Windows 11 (Rust 1.95.0 gnu host, zig 0.16.0, MSYS2
mingw-w64 gcc 16.2.0 + lld 22.1.8):
- before: zig build fails with WindowsSdkNotFound
- after: `cargo build -p cmux-tui` finishes, and the binary runs -
`cmux server start` comes up, `workspace create` spawns
PowerShell through ConPTY, and `terminal write` + `screen read`
round-trip its output
- `cargo fmt -p ghostty-vt-sys -- --check` is clean
Only the native windows-gnu case changes. Native macOS, Linux and
windows-msvc builds pass no target as before, and every cross-compile
still takes the `target != host` branch.
|
@Somuuuu007 is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe build script now passes ChangesWindows GNU target propagation
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The target propagation change is verified for native Windows GNU builds and does not introduce an outstanding merge-blocking risk. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge receipt for |
|
Merged, thanks @Somuuuu007 :) |
82c26b3 ci: take the gui token in the app-host shard's restore, not at job start (manaflow-ai#15012) 3761671 iOS: fix stale team nightly floor expectation in What's New copy test (manaflow-ai#14917) 5e19a98 docs: focus custom sidebar tabs by surfaceId in the actions example (manaflow-ai#15002) 294ee6e sidebar: Strip inline Markdown from notification previews (manaflow-ai#12030) ceb3030 Keep detached workspace process titles updateable (manaflow-ai#4947) 8be7364 test: kill hosted test shells before freeing their terminals (manaflow-ai#14957) da291df cmux-tui: do not query the host terminal when the reply cannot be read (manaflow-ai#12419) 98767c8 ci: keep earlier reviewed CLA policies valid for branches behind main (manaflow-ai#15008) 7167b77 feat(custom-sidebars): fixedSize and reactive frame specs for JS sidebars (manaflow-ai#14845) 716bbb5 Fix notification hook descriptor inheritance (manaflow-ai#11649) 03b191d cmux-tui: pass the zig target on a native windows-gnu host (manaflow-ai#12416) c9a6a0e docs: load the deep review protocol only when needed (manaflow-ai#15007) e5af879 Match pane indicator strokes and the file path header to shared chrome metrics (manaflow-ai#14982) 0def9e1 Show one fixed subtitle for each Settings row and fix localized labels (manaflow-ai#14883) 1921636 ci: route picker-less macOS lanes to the owned minis for trusted events (manaflow-ai#14794) # Conflicts: # .github/workflows/app-host-test-rerun.yml # .github/workflows/auth-refresh-tests.yml # .github/workflows/ci-health-report.yml # .github/workflows/ci-macos.yml # .github/workflows/ci-owned-pool-rescue.yml # .github/workflows/ci-repo-variables.yml # .github/workflows/cloud-command-deadlines.yml # .github/workflows/cloud-machine-tests.yml # .github/workflows/cloud-task-local-tests.yml # .github/workflows/cmux-tui.yml # .github/workflows/iroh-v2.yml # .github/workflows/relay-tls.yml # .github/workflows/reload-build.yml # .github/workflows/remote-daemon.yml # .github/workflows/resolve-dispatch-ref.yml # .github/workflows/terminal-hang-diagnostics.yml
What's broken
ghostty-vt-sys/build.rsforwards-Dtargettozig buildonly when the cargo target differs from the host:On a native
x86_64-pc-windows-gnutoolchain the two match, so zig gets no target and falls back to its Windows default, the msvc ABI:A machine with no Visual Studio is exactly why its Rust host is
windows-gnuto begin with, so the msvc fallback can never succeed.cargo build -p cmux-tuifails before any crate compiles.CI doesn't hit this: its Windows runners build from an msvc host to a gnu target, so
target != hostholds and the target is forwarded.Fix
Forward the target on a native windows-gnu host too.
zig_target_for_rust_targetalready mapsx86_64-pc-windows-gnu→x86_64-windows-gnu; this just lets the native case reach it. The file already branches ontarget.contains("windows-gnu")a few lines down for the MinGW archive name, so the shape matches what's there.Verification
Windows 11, Rust 1.95.0 (gnu host), zig 0.16.0, MSYS2 mingw-w64 gcc 16.2.0 + lld 22.1.8.
Before: zig build fails with
WindowsSdkNotFound.After:
cargo build -p cmux-tuifinishes, and the binary actually works:cargo fmt -p ghostty-vt-sys -- --checkis clean.Blast radius
Only the native windows-gnu case changes:
Note on the docs
cmux-tui/docs/getting-started.mdsays Windows support via ConPTY is planned for phase 2, andcmux-tui-artifacts.ymlcarries "no Windows PTY backend yet". With this build fix the PTY path already works throughportable-pty'sConPtySystem— the round-trip above is a real PowerShell child. Happy to send a docs update separately if that reading is right.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes
cmux-tuibuilds on native Windows GNU hosts by passing the zig target even when not cross-compiling.ghostty-vt-sysforwarded-Dtargetonly when the Cargo target differed from the host, so a nativex86_64-pc-windows-gnutoolchain got no target and zig fell back to the msvc ABI, failing withWindowsSdkNotFound.Written for commit 5a0009a. Summary will update on new commits.
Summary by CodeRabbit
Changelog
Fixed: cmux-tui builds on a native Windows GNU host