Skip to content

fix(build): guide users when zig is missing - #2281

Open
LosEcher wants to merge 1 commit into
herdrdev:masterfrom
LosEcher:fix/zig-missing-error-hint
Open

fix(build): guide users when zig is missing#2281
LosEcher wants to merge 1 commit into
herdrdev:masterfrom
LosEcher:fix/zig-missing-error-hint

Conversation

@LosEcher

@LosEcher LosEcher commented Aug 4, 2026

Copy link
Copy Markdown

Problem

When zig is not installed (or not on PATH and ZIG is unset), the libghostty-vt build script panics with a bare NotFound error that gives no hint about what to install:

thread 'main' panicked at build.rs:77:10:
failed to execute zig build for vendored libghostty-vt: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Fix

build.rs now distinguishes ErrorKind::NotFound and reports:

  • that Zig 0.15.2 is required to build the vendored libghostty-vt,
  • how to install it (brew install zig@0.15 on macOS, https://ziglang.org/download/ elsewhere),
  • that the ZIG environment variable can point at the zig binary.

Other execution errors keep the previous message with the underlying error appended.

Validation

  • cargo build (with a working zig 0.15.2) succeeds.
  • Without zig on PATH: build now fails with the descriptive message above.
  • cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings, maintenance script tests, and cargo nextest run (3030 tests) all pass locally.

Note: on this machine one plugins test initially failed due to a sandboxed home directory (~/.config / ~/.local/state not writable); with XDG_CONFIG_HOME/XDG_STATE_HOME pointed at a writable cache dir the full suite passes. CI on master is green.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a3866393-2862-4f38-a79a-9074ff478a4d

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8b138 and 02bdf37.

📒 Files selected for processing (1)
  • build.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • build.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The build script now borrows the Zig executable path when creating the command. It reports separate diagnostics for missing Zig executables and other process-launch failures.

Changes

Zig build handling

Layer / File(s) Summary
Command launch and diagnostics
build.rs
The Zig command borrows the executable path. Process-launch errors distinguish a missing executable from other execution errors.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 02bdf

This localized build-message change guides users to install Zig or configure the ZIG path without changing successful build behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: improving guidance when the Zig executable is missing during the build.
Description check ✅ Passed The description directly explains the missing-Zig problem, the diagnostic fix, installation guidance, ZIG configuration, and validation results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 4, 2026
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

The PR improves build-time guidance when the Zig process cannot be launched while preserving the existing error reporting for other process-launch failures.

  • Retains the configured Zig executable name for inclusion in diagnostics.
  • Provides the required Zig version, installation guidance, and ZIG override instructions when process launch returns NotFound.
  • Preserves the underlying OS error for other launch failures.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
build.rs Improves diagnostics around launching Zig for the vendored libghostty-vt build; no follow-up-eligible issue was identified.

Reviews (2): Last reviewed commit: "fix(build): guide users when zig is miss..." | Re-trigger Greptile

@LosEcher

LosEcher commented Aug 4, 2026

Copy link
Copy Markdown
Author

The failing check is check (macos-latest): it failed on api::server::pane_graphics_stream::tests::inactive_owner_cancels_idle_stream_and_dispatches_close with canceled idle stream should dispatch a close: Timeout.

This is an async timeout test in the pane graphics stream — unrelated to this build.rs change (which only alters the error message emitted when the zig executable cannot be found; the happy-path build command is unchanged). Locally the full suite passes (3030/3030). Could a maintainer re-run the macOS job to confirm it is a flake? I can't re-run it as an external contributor.

@ogulcancelik

Copy link
Copy Markdown
Collaborator

@LosEcher the implementation review is clean. please rebase onto current master and rerun checks and both review bots.

build.rs now reports how to install Zig 0.15.2 (brew install zig@0.15
on macOS, ziglang.org elsewhere) and mentions the ZIG environment
variable instead of panicking with a bare NotFound error.
@LosEcher
LosEcher force-pushed the fix/zig-missing-error-hint branch from 42dfae8 to 02bdf37 Compare August 25, 2026 14:51
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants