summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-28 12:28:27 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit2b76b47c8a087b81be139b552d9a41bb2006dcd3 (patch)
treeafadf20ee86877f1125cec171a78fec9c42fac35 /build.zig
parent4b53a39743dc5962e985fcf059a1222538d57b3f (diff)
downloadpardes-2b76b47c8a087b81be139b552d9a41bb2006dcd3.tar.gz
pardes-2b76b47c8a087b81be139b552d9a41bb2006dcd3.zip
fixing some crashes
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig12
1 files changed, 11 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index c62ee222..a4d530f1 100644
--- a/build.zig
+++ b/build.zig
@@ -314,10 +314,20 @@ pub fn build(b: *std.Build) void {
// consumed, and the defaults otherwise drag ghostty's app graph into the
// build — gtk4 header translation via host pkg-config for linux targets,
// the Xcode app graph (iOS SDK, xcodebuild) on darwin hosts.
+ // NEVER hand ghostty `.Debug`: that flips its `slow_runtime_safety`, which
+ // walks the whole PageList after every mutation and PANICS the app on a
+ // transient state its own next lines repair — `PageList.resizeCols` grows
+ // rows BEFORE it moves a history viewport pin back into the active area,
+ // so widening a window whose scrollback holds wrapped lines dies with
+ // "PageList integrity check failed: ViewportPinInsufficientRows". Those
+ // checks are a ghostty-development tool (upstream ships them off); Zig's
+ // own safety checks come from OUR optimize mode and are unaffected, since
+ // ghostty-vt is a module compiled into this binary. See reflow.snap.
+ const ghostty_optimize: std.builtin.OptimizeMode = if (optimize == .Debug) .ReleaseSafe else optimize;
const ghostty_dep = if (is_emscripten)
b.lazyDependency("ghostty", .{ .simd = false })
else
- b.lazyDependency("ghostty", .{ .target = target, .optimize = optimize, .simd = ghostty_simd, .@"app-runtime" = .none, .@"emit-xcframework" = false });
+ b.lazyDependency("ghostty", .{ .target = target, .optimize = ghostty_optimize, .simd = ghostty_simd, .@"app-runtime" = .none, .@"emit-xcframework" = false });
if (ghostty_dep) |dep| {
const ghostty_vt = dep.module("ghostty-vt");
ghostty_vt_for_snap = ghostty_vt;