diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5366646b..bd9b26414 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -686,4 +686,4 @@ jobs: file: src/build/docker/debian/Dockerfile build-args: | DISTRO_VERSION=12 - ZIG_VERSION=0.13.0 + ZIG_VERSION=0.14.0 diff --git a/PACKAGING.md b/PACKAGING.md index 6a4c01b6f..234a86770 100644 --- a/PACKAGING.md +++ b/PACKAGING.md @@ -48,7 +48,7 @@ To find the version of Zig required to build Ghostty, check the `required_zig` constant in `build.zig`. You don't need to know Zig to extract this information. This version will always be an official released version of Zig. -For example, at the time of writing this document, Ghostty requires Zig 0.13.0. +For example, at the time of writing this document, Ghostty requires Zig 0.14.0. ## Building Ghostty diff --git a/build.zig b/build.zig index f2fa9c233..280f15de9 100644 --- a/build.zig +++ b/build.zig @@ -3,7 +3,7 @@ const builtin = @import("builtin"); const buildpkg = @import("src/build/main.zig"); comptime { - buildpkg.requireZig("0.13.0"); + buildpkg.requireZig("0.14.0"); } pub fn build(b: *std.Build) !void { @@ -50,7 +50,7 @@ pub fn build(b: *std.Build) !void { // As such, these build steps are lacking. For example, the Darwin // build only produces an xcframework. if (config.app_runtime == .none) { - if (config.target.result.isDarwin()) darwin: { + if (config.target.result.os.tag.isDarwin()) darwin: { if (!config.emit_xcframework) break :darwin; // Build the xcframework diff --git a/build.zig.zon b/build.zig.zon index 4e69cb393..5c13e4dcf 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,59 +1,61 @@ .{ - .name = "ghostty", + .name = .ghostty, .version = "1.1.3", .paths = .{""}, + .fingerprint = 0x64407a2a0b4147e5, .dependencies = .{ // Zig libs .libxev = .{ // mitchellh/libxev - .url = "https://github.com/mitchellh/libxev/archive/8943932a668f338cb2c500f6e1a7396bacd8b55d.tar.gz", - .hash = "1220a67b584c9499154de8c96851ed8e92315452cb2027c06e2d7d07a39c6f900d1a", + .url = "https://github.com/mitchellh/libxev/archive/3df9337a9e84450a58a2c4af434ec1a036f7b494.tar.gz", + .hash = "libxev-0.0.0-86vtc-ziEgDbLP0vihUn1MhsxNKY4GJEga6BEr7oyHpz", }, .mach_glfw = .{ // mitchellh/mach-glfw - .url = "https://deps.files.ghostty.org/mach_glfw-12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62.tar.gz", - .hash = "12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62", + .url = "https://github.com/mitchellh/mach-glfw/archive/d84bc11b0601cdad71035a0e9cf21572d76aa0d2.zip", + .hash = "mach_glfw-0.2.0-EJSQm2M9BQCiYGTd9VcKjg2DhSD7WT4kS-MfX68ORRT_", .lazy = true, }, .vaxis = .{ // rockorager/libvaxis - .url = "git+https://github.com/rockorager/libvaxis#2237a7059eae99e9f132dd5acd1555e49d6c7d93", - .hash = "1220f5aec880d4f430cc1597ede88f1530da69e39a4986080e976b0c7b919c2ebfeb", + .url = "git+https://github.com/rockorager/libvaxis#1e24e0dfb509e974e1c8713bcd119d0ae032a8c7", + .hash = "vaxis-0.1.0-BWNV_MHyCAARemSCSwwc3sA1etNgv7ge0BCIXspX6CZv", }, .z2d = .{ // vancluever/z2d - .url = "https://deps.files.ghostty.org/z2d-12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a.tar.gz", - .hash = "12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a", + .url = "https://github.com/vancluever/z2d/archive/1e89605a624940c310c7a1d81b46a7c5c05919e3.tar.gz", + .hash = "z2d-0.6.0-j5P_HvLdCABu-dXpCeRM7Uk4m16vULg1980lMNCQj4_C", }, .zig_objc = .{ // mitchellh/zig-objc - .url = "https://deps.files.ghostty.org/zig_objc-1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634.tar.gz", - .hash = "1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634", + .url = "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz", + .hash = "zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt", }, .zig_js = .{ // mitchellh/zig-js .url = "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz", - .hash = "12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc", + .hash = "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ", }, .ziglyph = .{ .url = "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz", - .hash = "12207831bce7d4abce57b5a98e8f3635811cfefd160bca022eb91fe905d36a02cf25", + .hash = "ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf", }, .zig_wayland = .{ // codeberg ifreund/zig-wayland - .url = "https://deps.files.ghostty.org/zig-wayland-fbfe3b4ac0b472a27b1f1a67405436c58cbee12d.tar.gz", - .hash = "12209ca054cb1919fa276e328967f10b253f7537c4136eb48f3332b0f7cf661cad38", + .url = "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz", + .hash = "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy", }, .zf = .{ // natecraddock/zf - .url = "https://deps.files.ghostty.org/zf-1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8.tar.gz", - .hash = "1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8", + .url = "https://github.com/natecraddock/zf/archive/03176fcf23fda543cc02a8675e92c1fe3b1ee2eb.tar.gz", + .hash = "zf-0.10.3-OIRy8bKIAACV6JaNNncXA68Nw2BUAD9JVfQdzjyoZQ-J", }, .gobject = .{ - // ianprime0509/zig-gobject - .url = "https://deps.files.ghostty.org/gobject-12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d.tar.zst", - .hash = "12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d", + // https://github.com/jcollie/ghostty-gobject based on zig_gobject + // Temporary until we generate them at build time automatically. + .url = "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-11-16-1/ghostty-gobject-0.14.0-2025-03-11-16-1.tar.gz", + .hash = "gobject-0.2.0-Skun7H6DlQDWCiNQtdE5TXYcCvx7MyjW01OQe5M_n_jV", }, // C libs @@ -81,22 +83,22 @@ // Wayland .wayland = .{ .url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz", - .hash = "12202cdac858abc52413a6c6711d5026d2d3c8e13f95ca2c327eade0736298bb021f", + .hash = "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t", }, .wayland_protocols = .{ .url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz", - .hash = "12201a57c6ce0001aa034fa80fba3e1cd2253c560a45748f4f4dd21ff23b491cddef", + .hash = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S", }, .plasma_wayland_protocols = .{ .url = "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz", - .hash = "12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566", + .hash = "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs", }, // Other .apple_sdk = .{ .path = "./pkg/apple-sdk" }, .iterm2_themes = .{ .url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/e21d5ffd19605741d0e3e19d7c5a8c6c25648673.tar.gz", - .hash = "122071ad56fd984afb4f94d441b6ea3e21f1741a0e026b02860d9a46110fac2cd109", + .hash = "N-V-__8AAABBKARxrVb9mEr7T5TUQbbqPiHxdBoOAmsChg2a", }, }, } diff --git a/build.zig.zon.nix b/build.zig.zon.nix index f9d237d4d..3f29ad693 100644 --- a/build.zig.zon.nix +++ b/build.zig.zon.nix @@ -5,7 +5,7 @@ fetchurl, fetchgit, runCommandLocal, - zig_0_13, + zig_0_14, name ? "zig-packages", }: with builtins; @@ -16,7 +16,7 @@ with lib; let }: runCommandLocal name { - nativeBuildInputs = [zig_0_13]; + nativeBuildInputs = [zig_0_14]; } '' hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})" @@ -84,103 +84,103 @@ with lib; let in linkFarm name [ { - name = "1220a67b584c9499154de8c96851ed8e92315452cb2027c06e2d7d07a39c6f900d1a"; + name = "libxev-0.0.0-86vtc-ziEgDbLP0vihUn1MhsxNKY4GJEga6BEr7oyHpz"; path = fetchZigArtifact { name = "libxev"; - url = "https://github.com/mitchellh/libxev/archive/8943932a668f338cb2c500f6e1a7396bacd8b55d.tar.gz"; - hash = "sha256-TGooUoby2J8PyzbdKHwdEXnu7f2g4T2/TUHj/ktBsN4="; + url = "https://github.com/mitchellh/libxev/archive/3df9337a9e84450a58a2c4af434ec1a036f7b494.tar.gz"; + hash = "sha256-oKZqA9d79jHnp/HsqJWQE33Ffn5Ee5G4VnlQepQuY4o="; }; } { - name = "12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62"; + name = "mach_glfw-0.2.0-EJSQm2M9BQCiYGTd9VcKjg2DhSD7WT4kS-MfX68ORRT_"; path = fetchZigArtifact { name = "mach_glfw"; - url = "https://deps.files.ghostty.org/mach_glfw-12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62.tar.gz"; - hash = "sha256-HhXIvWUS8/CHWY4VXPG2ZEo+we8XOn3o5rYJCQ1n8Nk="; + url = "https://github.com/mitchellh/mach-glfw/archive/d84bc11b0601cdad71035a0e9cf21572d76aa0d2.zip"; + hash = "sha256-Sh1DvCmawdN+a2JEhNP3wTX43/i5FDlDVOIx7Um/d0U="; }; } { - name = "1220736fa4ba211162c7a0e46cc8fe04d95921927688bff64ab5da7420d098a7272d"; + name = "glfw-0.0.0-bOgnngiqGQCt5HJK25zx1lf9emPYDNtEuQPYmrTCdOoN"; path = fetchZigArtifact { name = "glfw"; - url = "https://github.com/mitchellh/glfw/archive/b552c6ec47326b94015feddb36058ea567b87159.tar.gz"; - hash = "sha256-IeBVAOQmtyFqVxzuXPek1onuPwIamcOyYtxqKpPEQjU="; + url = "git+https://github.com/der-teufel-programming/glfw.git#206deaa2485703ac700d0f3020a8854282aecdbb"; + hash = "sha256-GFeN4J4ZpKvQV8Gw6fxJ+KSpzzdjIYBbO/fTZ0Ooiuk="; }; } { - name = "12202adbfecdad671d585c9a5bfcbd5cdf821726779430047742ce1bf94ad67d19cb"; + name = "N-V-__8AABHMqAWYuRdIlflwi8gksPnlUMQBiSxAqQAAZFms"; path = fetchZigArtifact { name = "xcode_frameworks"; - url = "https://github.com/mitchellh/xcode-frameworks/archive/69801c154c39d7ae6129ea1ba8fe1afe00585fc8.tar.gz"; - hash = "sha256-mP/I2coL57UJm/3+4Q8sPAgQwk8V4zM+S4VBBTrX2To="; + url = "https://pkg.machengine.org/xcode-frameworks/9a45f3ac977fd25dff77e58c6de1870b6808c4a7.tar.gz"; + hash = "sha256-jWMT0p7klpkgX9GOUNAhrR2e6Ej7MobbqT5ZxJrNQoM="; }; } { - name = "122004bfd4c519dadfb8e6281a42fc34fd1aa15aea654ea8a492839046f9894fa2cf"; + name = "N-V-__8AAAIGzwDju1iAEUEqIbBeI3K4JhQ0vBdNzmETnIRQ"; path = fetchZigArtifact { name = "vulkan_headers"; - url = "https://github.com/mitchellh/vulkan-headers/archive/04c8a0389d5a0236a96312988017cd4ce27d8041.tar.gz"; - hash = "sha256-K+zrRudgHFukOM6En1StRYRMNYkeRk+qHTXvrXaG+FU="; + url = "https://pkg.machengine.org/vulkan-headers/53e3ee66a78b97075863135b429956f225b149a5.tar.gz"; + hash = "sha256-kXOn43ntsvxnufobQO0xfzg1cg0R97BmFOU3WRqFsH0="; }; } { - name = "1220b3164434d2ec9db146a40bf3a30f490590d68fa8529776a3138074f0da2c11ca"; + name = "N-V-__8AAJfbCQBWPD1WA6AuYSk8LAIj4Bo_KY-2Br8NEIKT"; path = fetchZigArtifact { name = "wayland_headers"; - url = "https://github.com/mitchellh/wayland-headers/archive/5f991515a29f994d87b908115a2ab0b899474bd1.tar.gz"; - hash = "sha256-uFilLZinKkZt6RdVTV3lUmJpzpswDdFva22FvwU/XQI="; + url = "https://pkg.machengine.org/wayland-headers/7c53e7483c3cfb5c6780ae542c9f5cfa712a826a.tar.gz"; + hash = "sha256-uGIvMyp+xR1jQXTDr6RqYl40Ukiw9l3fW1t6XpYztPY="; }; } { - name = "122089c326186c84aa2fd034b16abc38f3ebf4862d9ae106dc1847ac44f557b36465"; + name = "N-V-__8AACbnQQDnnaLV79Xp3YtkU_g6nseVNOLiA7MzF2a4"; path = fetchZigArtifact { name = "x11_headers"; - url = "https://github.com/mitchellh/x11-headers/archive/2ffbd62d82ff73ec929dd8de802bc95effa0ef88.tar.gz"; - hash = "sha256-EhV2bmTY/OMYN1wEul35gD0hQgS/Al262jO3pVr0O+c="; + url = "https://pkg.machengine.org/x11-headers/29aefb525d5c08b05b0351e34b1623854a138c21.tar.gz"; + hash = "sha256-UsbWkOmedS4ygY9C1g7OiPVnTcXzfGKdXImmztYAAiI="; }; } { - name = "1220f5aec880d4f430cc1597ede88f1530da69e39a4986080e976b0c7b919c2ebfeb"; + name = "vaxis-0.1.0-BWNV_MHyCAARemSCSwwc3sA1etNgv7ge0BCIXspX6CZv"; path = fetchZigArtifact { name = "vaxis"; - url = "git+https://github.com/rockorager/libvaxis#2237a7059eae99e9f132dd5acd1555e49d6c7d93"; - hash = "sha256-ZzLNJOsXzyBhkdUhbET30RoU2T9xKYsBUQz2NAjK/G8="; + url = "git+https://github.com/rockorager/libvaxis#1e24e0dfb509e974e1c8713bcd119d0ae032a8c7"; + hash = "sha256-6p9aSklLTPV9epzGkXBg5SQfjxfTT+/SYLFPiM04VF0="; }; } { - name = "1220dd654ef941fc76fd96f9ec6adadf83f69b9887a0d3f4ee5ac0a1a3e11be35cf5"; + name = "zigimg-0.1.0-lly-O-NTEABwkjg9_WM4uLQr_TtL-7jp375PsZJyugGN"; path = fetchZigArtifact { name = "zigimg"; - url = "git+https://github.com/zigimg/zigimg#3a667bdb3d7f0955a5a51c8468eac83210c1439e"; - hash = "sha256-oLf3YH3yeg4ikVO/GahMCDRMTU31AHkfSnF4rt7xTKo="; + url = "git+https://github.com/TUSF/zigimg#5102e09be233d372e9e05f4cb2ffbefba30bc1c0"; + hash = "sha256-0HYK5A8Jlx1WD1hdU07r+m2AXl6UuazFiZd7P3uh/wY="; }; } { - name = "122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40"; + name = "zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM"; path = fetchZigArtifact { name = "zg"; - url = "https://codeberg.org/atman/zg/archive/v0.13.2.tar.gz"; - hash = "sha256-2x9hT7bYq9KJYWLVOf21a+QvTG/F7HWT+YK15IMRzNY="; + url = "git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc"; + hash = "sha256-fo3l6cjkrr/godElTGnQzalBsasN7J73IDIRmw7v1gA="; }; } { - name = "12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a"; + name = "z2d-0.6.0-j5P_HvLdCABu-dXpCeRM7Uk4m16vULg1980lMNCQj4_C"; path = fetchZigArtifact { name = "z2d"; - url = "https://deps.files.ghostty.org/z2d-12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a.tar.gz"; - hash = "sha256-P0UJ54RO/vVyDa+UkBl+QEOjzoMMEFSOTexQP/uBXfc="; + url = "https://github.com/vancluever/z2d/archive/1e89605a624940c310c7a1d81b46a7c5c05919e3.tar.gz"; + hash = "sha256-PEKVSUZ6teRbDyhFPWSiuBSe40pgr0kVRivIY8Cn8HQ="; }; } { - name = "1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634"; + name = "zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt"; path = fetchZigArtifact { name = "zig_objc"; - url = "https://deps.files.ghostty.org/zig_objc-1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634.tar.gz"; - hash = "sha256-H+HIbh2T23uzrsg9/1/vl9Ir1HCAa2pzeTx6zktJH9Q="; + url = "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz"; + hash = "sha256-zn1tR6xhSmDla4UJ3t+Gni4Ni3R8deSK3tEe7DGzNXw="; }; } { - name = "12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc"; + name = "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ"; path = fetchZigArtifact { name = "zig_js"; url = "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz"; @@ -188,7 +188,7 @@ in }; } { - name = "12207831bce7d4abce57b5a98e8f3635811cfefd160bca022eb91fe905d36a02cf25"; + name = "ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf"; path = fetchZigArtifact { name = "ziglyph"; url = "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz"; @@ -196,39 +196,39 @@ in }; } { - name = "12209ca054cb1919fa276e328967f10b253f7537c4136eb48f3332b0f7cf661cad38"; + name = "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy"; path = fetchZigArtifact { name = "zig_wayland"; - url = "https://deps.files.ghostty.org/zig-wayland-fbfe3b4ac0b472a27b1f1a67405436c58cbee12d.tar.gz"; - hash = "sha256-RtAystqK/GRYIquTK1KfD7rRSCrfuzAvCD1Z9DE1ldc="; + url = "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz"; + hash = "sha256-E77GZ15APYbbO1WzmuJi8eG9/iQFbc2CgkNBxjCLUhk="; }; } { - name = "1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8"; + name = "zf-0.10.3-OIRy8bKIAACV6JaNNncXA68Nw2BUAD9JVfQdzjyoZQ-J"; path = fetchZigArtifact { name = "zf"; - url = "https://deps.files.ghostty.org/zf-1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8.tar.gz"; - hash = "sha256-/oLryY3VQfjbtQi+UP+n6FJTVA/YxIetjO+6Ovrh6/E="; + url = "https://github.com/natecraddock/zf/archive/03176fcf23fda543cc02a8675e92c1fe3b1ee2eb.tar.gz"; + hash = "sha256-HqS2NFUuTQkltFsQlZz4HYHgfhEUEkZY83NnCW2x5Sg="; }; } { - name = "1220c72c1697dd9008461ead702997a15d8a1c5810247f02e7983b9f74c6c6e4c087"; + name = "vaxis-0.1.0-BWNV_K3yCACrTy3A5cbZElLyICx5a2O2EzPxmgVRcbKJ"; path = fetchZigArtifact { name = "vaxis"; - url = "git+https://github.com/rockorager/libvaxis/?ref=main#dc0a228a5544988d4a920cfb40be9cd28db41423"; - hash = "sha256-QWN4jOrA91KlbqmeEHHJ4HTnCC9nmfxt8DHUXJpAzLI="; + url = "git+https://github.com/rockorager/libvaxis/?ref=main#6a37605dde55898dcca4769dd3eb1e333959c209"; + hash = "sha256-5DW2V2bVsHtSw7UMGvJ+P0FpXIf5kTNjrq2SMqU6FIk="; }; } { - name = "12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d"; + name = "gobject-0.2.0-Skun7H6DlQDWCiNQtdE5TXYcCvx7MyjW01OQe5M_n_jV"; path = fetchZigArtifact { name = "gobject"; - url = "https://deps.files.ghostty.org/gobject-12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d.tar.zst"; - hash = "sha256-UU97kNv/bZzQPKz1djhEDLapLguvfBpFfWVb6FthtcI="; + url = "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-11-16-1/ghostty-gobject-0.14.0-2025-03-11-16-1.tar.gz"; + hash = "sha256-eMmS9oysZheHwSCCvmOUSDJmP9zN7cAr6qqDIbz6EmY="; }; } { - name = "12202cdac858abc52413a6c6711d5026d2d3c8e13f95ca2c327eade0736298bb021f"; + name = "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t"; path = fetchZigArtifact { name = "wayland"; url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz"; @@ -236,7 +236,7 @@ in }; } { - name = "12201a57c6ce0001aa034fa80fba3e1cd2253c560a45748f4f4dd21ff23b491cddef"; + name = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S"; path = fetchZigArtifact { name = "wayland_protocols"; url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz"; @@ -244,7 +244,7 @@ in }; } { - name = "12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566"; + name = "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs"; path = fetchZigArtifact { name = "plasma_wayland_protocols"; url = "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz"; @@ -252,7 +252,7 @@ in }; } { - name = "122071ad56fd984afb4f94d441b6ea3e21f1741a0e026b02860d9a46110fac2cd109"; + name = "N-V-__8AAABBKARxrVb9mEr7T5TUQbbqPiHxdBoOAmsChg2a"; path = fetchZigArtifact { name = "iterm2_themes"; url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/e21d5ffd19605741d0e3e19d7c5a8c6c25648673.tar.gz"; @@ -260,7 +260,7 @@ in }; } { - name = "1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402"; + name = "N-V-__8AAH0GaQC8a52s6vfIxg88OZgFgEW6DFxfSK4lX_l3"; path = fetchZigArtifact { name = "imgui"; url = "https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz"; @@ -268,7 +268,7 @@ in }; } { - name = "1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d"; + name = "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub"; path = fetchZigArtifact { name = "freetype"; url = "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz"; @@ -276,7 +276,7 @@ in }; } { - name = "1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66"; + name = "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD"; path = fetchZigArtifact { name = "libpng"; url = "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz"; @@ -284,7 +284,7 @@ in }; } { - name = "1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb"; + name = "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o"; path = fetchZigArtifact { name = "zlib"; url = "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz"; @@ -292,7 +292,7 @@ in }; } { - name = "12201149afb3326c56c05bb0a577f54f76ac20deece63aa2f5cd6ff31a4fa4fcb3b7"; + name = "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v"; path = fetchZigArtifact { name = "fontconfig"; url = "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz"; @@ -300,23 +300,23 @@ in }; } { - name = "122032442d95c3b428ae8e526017fad881e7dc78eab4d558e9a58a80bfbd65a64f7d"; + name = "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK"; path = fetchZigArtifact { name = "libxml2"; - url = "https://github.com/GNOME/libxml2/archive/refs/tags/v2.11.5.tar.gz"; + url = "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz"; hash = "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU="; }; } { - name = "12203eff4829ad8afdd828eb323d48e5ba8dbb44d224e9e314d4ab1533c2bec20f4b"; + name = "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr"; path = fetchZigArtifact { name = "gtk4_layer_shell"; - url = "https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v1.1.0.tar.gz"; + url = "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz"; hash = "sha256-mChCgSYKXu9bT2OlXxbEv2p4ihAgptsDfssPcfozaYg="; }; } { - name = "1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122"; + name = "N-V-__8AAKa0rgW4WI8QbJlq8QJJv6CSxvsvNfussVBe9Heg"; path = fetchZigArtifact { name = "harfbuzz"; url = "https://deps.files.ghostty.org/harfbuzz-1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122.tar.gz"; @@ -324,15 +324,15 @@ in }; } { - name = "12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b"; + name = "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE"; path = fetchZigArtifact { name = "highway"; - url = "https://deps.files.ghostty.org/highway-12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b.tar.gz"; - hash = "sha256-NUqLRTm1iOcLmOxwhEJz4/J0EwLEw3e8xOgbPRhm98k="; + url = "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz"; + hash = "sha256-h9T4iT704I8iSXNgj/6/lCaKgTgLp5wS6IQZaMgKohI="; }; } { - name = "1220f870c853529233ea64a108acaaa81f8d06d7ff4b66c76930be7d78d508aff7a2"; + name = "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-"; path = fetchZigArtifact { name = "gettext"; url = "https://deps.files.ghostty.org/gettext-0.24.tar.gz"; @@ -340,7 +340,7 @@ in }; } { - name = "1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb"; + name = "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c"; path = fetchZigArtifact { name = "oniguruma"; url = "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz"; @@ -348,7 +348,7 @@ in }; } { - name = "1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e"; + name = "N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG"; path = fetchZigArtifact { name = "sentry"; url = "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz"; @@ -356,15 +356,15 @@ in }; } { - name = "12207fd37bb8251919c112dcdd8f616a491857b34a451f7e4486490077206dc2a1ea"; + name = "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ"; path = fetchZigArtifact { name = "breakpad"; - url = "https://github.com/getsentry/breakpad/archive/b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz"; + url = "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz"; hash = "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk="; }; } { - name = "1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641"; + name = "N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH"; path = fetchZigArtifact { name = "utfcpp"; url = "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz"; @@ -372,7 +372,7 @@ in }; } { - name = "122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd"; + name = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs"; path = fetchZigArtifact { name = "wuffs"; url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz"; @@ -380,7 +380,7 @@ in }; } { - name = "12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806"; + name = "N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc"; path = fetchZigArtifact { name = "pixels"; url = "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz"; @@ -388,7 +388,7 @@ in }; } { - name = "12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1"; + name = "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy"; path = fetchZigArtifact { name = "glslang"; url = "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz"; @@ -396,7 +396,7 @@ in }; } { - name = "1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da"; + name = "N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv"; path = fetchZigArtifact { name = "spirv_cross"; url = "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz"; diff --git a/build.zig.zon.txt b/build.zig.zon.txt index b6b52ef52..fb71f4a7a 100644 --- a/build.zig.zon.txt +++ b/build.zig.zon.txt @@ -1,17 +1,20 @@ -git+https://github.com/rockorager/libvaxis#2237a7059eae99e9f132dd5acd1555e49d6c7d93 -git+https://github.com/rockorager/libvaxis/?ref=main#dc0a228a5544988d4a920cfb40be9cd28db41423 -git+https://github.com/zigimg/zigimg#3a667bdb3d7f0955a5a51c8468eac83210c1439e -https://codeberg.org/atman/zg/archive/v0.13.2.tar.gz +git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc +git+https://github.com/TUSF/zigimg#5102e09be233d372e9e05f4cb2ffbefba30bc1c0 +git+https://github.com/der-teufel-programming/glfw.git#206deaa2485703ac700d0f3020a8854282aecdbb +git+https://github.com/rockorager/libvaxis#1e24e0dfb509e974e1c8713bcd119d0ae032a8c7 +git+https://github.com/rockorager/libvaxis/?ref=main#6a37605dde55898dcca4769dd3eb1e333959c209 +https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz +https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz https://deps.files.ghostty.org/gettext-0.24.tar.gz https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz -https://deps.files.ghostty.org/gobject-12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d.tar.zst +https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz https://deps.files.ghostty.org/harfbuzz-1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122.tar.gz -https://deps.files.ghostty.org/highway-12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b.tar.gz +https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz -https://deps.files.ghostty.org/mach_glfw-12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62.tar.gz +https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz @@ -21,20 +24,17 @@ https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0 https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz -https://deps.files.ghostty.org/z2d-12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a.tar.gz -https://deps.files.ghostty.org/zf-1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8.tar.gz -https://deps.files.ghostty.org/zig-wayland-fbfe3b4ac0b472a27b1f1a67405436c58cbee12d.tar.gz https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz -https://deps.files.ghostty.org/zig_objc-1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634.tar.gz https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz -https://github.com/GNOME/libxml2/archive/refs/tags/v2.11.5.tar.gz -https://github.com/getsentry/breakpad/archive/b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz +https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-11-16-1/ghostty-gobject-0.14.0-2025-03-11-16-1.tar.gz https://github.com/mbadolato/iTerm2-Color-Schemes/archive/e21d5ffd19605741d0e3e19d7c5a8c6c25648673.tar.gz -https://github.com/mitchellh/glfw/archive/b552c6ec47326b94015feddb36058ea567b87159.tar.gz -https://github.com/mitchellh/libxev/archive/8943932a668f338cb2c500f6e1a7396bacd8b55d.tar.gz -https://github.com/mitchellh/vulkan-headers/archive/04c8a0389d5a0236a96312988017cd4ce27d8041.tar.gz -https://github.com/mitchellh/wayland-headers/archive/5f991515a29f994d87b908115a2ab0b899474bd1.tar.gz -https://github.com/mitchellh/x11-headers/archive/2ffbd62d82ff73ec929dd8de802bc95effa0ef88.tar.gz -https://github.com/mitchellh/xcode-frameworks/archive/69801c154c39d7ae6129ea1ba8fe1afe00585fc8.tar.gz -https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v1.1.0.tar.gz +https://github.com/mitchellh/libxev/archive/3df9337a9e84450a58a2c4af434ec1a036f7b494.tar.gz +https://github.com/mitchellh/mach-glfw/archive/d84bc11b0601cdad71035a0e9cf21572d76aa0d2.zip +https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz +https://github.com/natecraddock/zf/archive/03176fcf23fda543cc02a8675e92c1fe3b1ee2eb.tar.gz +https://github.com/vancluever/z2d/archive/1e89605a624940c310c7a1d81b46a7c5c05919e3.tar.gz +https://pkg.machengine.org/vulkan-headers/53e3ee66a78b97075863135b429956f225b149a5.tar.gz +https://pkg.machengine.org/wayland-headers/7c53e7483c3cfb5c6780ae542c9f5cfa712a826a.tar.gz +https://pkg.machengine.org/x11-headers/29aefb525d5c08b05b0351e34b1623854a138c21.tar.gz +https://pkg.machengine.org/xcode-frameworks/9a45f3ac977fd25dff77e58c6de1870b6808c4a7.tar.gz diff --git a/build.zig.zon2json-lock b/build.zig.zon2json-lock index 463bba939..74fa1c12a 100644 --- a/build.zig.zon2json-lock +++ b/build.zig.zon2json-lock @@ -1,200 +1,200 @@ { - "1220a67b584c9499154de8c96851ed8e92315452cb2027c06e2d7d07a39c6f900d1a": { + "libxev-0.0.0-86vtc-ziEgDbLP0vihUn1MhsxNKY4GJEga6BEr7oyHpz": { "name": "libxev", - "url": "https://github.com/mitchellh/libxev/archive/8943932a668f338cb2c500f6e1a7396bacd8b55d.tar.gz", - "hash": "sha256-TGooUoby2J8PyzbdKHwdEXnu7f2g4T2/TUHj/ktBsN4=" + "url": "https://github.com/mitchellh/libxev/archive/3df9337a9e84450a58a2c4af434ec1a036f7b494.tar.gz", + "hash": "sha256-oKZqA9d79jHnp/HsqJWQE33Ffn5Ee5G4VnlQepQuY4o=" }, - "12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62": { + "mach_glfw-0.2.0-EJSQm2M9BQCiYGTd9VcKjg2DhSD7WT4kS-MfX68ORRT_": { "name": "mach_glfw", - "url": "https://deps.files.ghostty.org/mach_glfw-12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62.tar.gz", - "hash": "sha256-HhXIvWUS8/CHWY4VXPG2ZEo+we8XOn3o5rYJCQ1n8Nk=" + "url": "https://github.com/mitchellh/mach-glfw/archive/d84bc11b0601cdad71035a0e9cf21572d76aa0d2.zip", + "hash": "sha256-Sh1DvCmawdN+a2JEhNP3wTX43/i5FDlDVOIx7Um/d0U=" }, - "1220736fa4ba211162c7a0e46cc8fe04d95921927688bff64ab5da7420d098a7272d": { + "glfw-0.0.0-bOgnngiqGQCt5HJK25zx1lf9emPYDNtEuQPYmrTCdOoN": { "name": "glfw", - "url": "https://github.com/mitchellh/glfw/archive/b552c6ec47326b94015feddb36058ea567b87159.tar.gz", - "hash": "sha256-IeBVAOQmtyFqVxzuXPek1onuPwIamcOyYtxqKpPEQjU=" + "url": "git+https://github.com/der-teufel-programming/glfw.git#206deaa2485703ac700d0f3020a8854282aecdbb", + "hash": "sha256-GFeN4J4ZpKvQV8Gw6fxJ+KSpzzdjIYBbO/fTZ0Ooiuk=" }, - "12202adbfecdad671d585c9a5bfcbd5cdf821726779430047742ce1bf94ad67d19cb": { + "N-V-__8AABHMqAWYuRdIlflwi8gksPnlUMQBiSxAqQAAZFms": { "name": "xcode_frameworks", - "url": "https://github.com/mitchellh/xcode-frameworks/archive/69801c154c39d7ae6129ea1ba8fe1afe00585fc8.tar.gz", - "hash": "sha256-mP/I2coL57UJm/3+4Q8sPAgQwk8V4zM+S4VBBTrX2To=" + "url": "https://pkg.machengine.org/xcode-frameworks/9a45f3ac977fd25dff77e58c6de1870b6808c4a7.tar.gz", + "hash": "sha256-jWMT0p7klpkgX9GOUNAhrR2e6Ej7MobbqT5ZxJrNQoM=" }, - "122004bfd4c519dadfb8e6281a42fc34fd1aa15aea654ea8a492839046f9894fa2cf": { + "N-V-__8AAAIGzwDju1iAEUEqIbBeI3K4JhQ0vBdNzmETnIRQ": { "name": "vulkan_headers", - "url": "https://github.com/mitchellh/vulkan-headers/archive/04c8a0389d5a0236a96312988017cd4ce27d8041.tar.gz", - "hash": "sha256-K+zrRudgHFukOM6En1StRYRMNYkeRk+qHTXvrXaG+FU=" + "url": "https://pkg.machengine.org/vulkan-headers/53e3ee66a78b97075863135b429956f225b149a5.tar.gz", + "hash": "sha256-kXOn43ntsvxnufobQO0xfzg1cg0R97BmFOU3WRqFsH0=" }, - "1220b3164434d2ec9db146a40bf3a30f490590d68fa8529776a3138074f0da2c11ca": { + "N-V-__8AAJfbCQBWPD1WA6AuYSk8LAIj4Bo_KY-2Br8NEIKT": { "name": "wayland_headers", - "url": "https://github.com/mitchellh/wayland-headers/archive/5f991515a29f994d87b908115a2ab0b899474bd1.tar.gz", - "hash": "sha256-uFilLZinKkZt6RdVTV3lUmJpzpswDdFva22FvwU/XQI=" + "url": "https://pkg.machengine.org/wayland-headers/7c53e7483c3cfb5c6780ae542c9f5cfa712a826a.tar.gz", + "hash": "sha256-uGIvMyp+xR1jQXTDr6RqYl40Ukiw9l3fW1t6XpYztPY=" }, - "122089c326186c84aa2fd034b16abc38f3ebf4862d9ae106dc1847ac44f557b36465": { + "N-V-__8AACbnQQDnnaLV79Xp3YtkU_g6nseVNOLiA7MzF2a4": { "name": "x11_headers", - "url": "https://github.com/mitchellh/x11-headers/archive/2ffbd62d82ff73ec929dd8de802bc95effa0ef88.tar.gz", - "hash": "sha256-EhV2bmTY/OMYN1wEul35gD0hQgS/Al262jO3pVr0O+c=" + "url": "https://pkg.machengine.org/x11-headers/29aefb525d5c08b05b0351e34b1623854a138c21.tar.gz", + "hash": "sha256-UsbWkOmedS4ygY9C1g7OiPVnTcXzfGKdXImmztYAAiI=" }, - "1220f5aec880d4f430cc1597ede88f1530da69e39a4986080e976b0c7b919c2ebfeb": { + "vaxis-0.1.0-BWNV_MHyCAARemSCSwwc3sA1etNgv7ge0BCIXspX6CZv": { "name": "vaxis", - "url": "git+https://github.com/rockorager/libvaxis#2237a7059eae99e9f132dd5acd1555e49d6c7d93", - "hash": "sha256-ZzLNJOsXzyBhkdUhbET30RoU2T9xKYsBUQz2NAjK/G8=" + "url": "git+https://github.com/rockorager/libvaxis#1e24e0dfb509e974e1c8713bcd119d0ae032a8c7", + "hash": "sha256-6p9aSklLTPV9epzGkXBg5SQfjxfTT+/SYLFPiM04VF0=" }, - "1220dd654ef941fc76fd96f9ec6adadf83f69b9887a0d3f4ee5ac0a1a3e11be35cf5": { + "zigimg-0.1.0-lly-O-NTEABwkjg9_WM4uLQr_TtL-7jp375PsZJyugGN": { "name": "zigimg", - "url": "git+https://github.com/zigimg/zigimg#3a667bdb3d7f0955a5a51c8468eac83210c1439e", - "hash": "sha256-oLf3YH3yeg4ikVO/GahMCDRMTU31AHkfSnF4rt7xTKo=" + "url": "git+https://github.com/TUSF/zigimg#5102e09be233d372e9e05f4cb2ffbefba30bc1c0", + "hash": "sha256-0HYK5A8Jlx1WD1hdU07r+m2AXl6UuazFiZd7P3uh/wY=" }, - "122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40": { + "zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM": { "name": "zg", - "url": "https://codeberg.org/atman/zg/archive/v0.13.2.tar.gz", - "hash": "sha256-2x9hT7bYq9KJYWLVOf21a+QvTG/F7HWT+YK15IMRzNY=" + "url": "git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc", + "hash": "sha256-fo3l6cjkrr/godElTGnQzalBsasN7J73IDIRmw7v1gA=" }, - "12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a": { + "z2d-0.6.0-j5P_HvLdCABu-dXpCeRM7Uk4m16vULg1980lMNCQj4_C": { "name": "z2d", - "url": "https://deps.files.ghostty.org/z2d-12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a.tar.gz", - "hash": "sha256-P0UJ54RO/vVyDa+UkBl+QEOjzoMMEFSOTexQP/uBXfc=" + "url": "https://github.com/vancluever/z2d/archive/1e89605a624940c310c7a1d81b46a7c5c05919e3.tar.gz", + "hash": "sha256-PEKVSUZ6teRbDyhFPWSiuBSe40pgr0kVRivIY8Cn8HQ=" }, - "1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634": { + "zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt": { "name": "zig_objc", - "url": "https://deps.files.ghostty.org/zig_objc-1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634.tar.gz", - "hash": "sha256-H+HIbh2T23uzrsg9/1/vl9Ir1HCAa2pzeTx6zktJH9Q=" + "url": "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz", + "hash": "sha256-zn1tR6xhSmDla4UJ3t+Gni4Ni3R8deSK3tEe7DGzNXw=" }, - "12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc": { + "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ": { "name": "zig_js", "url": "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz", "hash": "sha256-fyNeCVbC9UAaKJY6JhAZlT0A479M/AKYMPIWEZbDWD0=" }, - "12207831bce7d4abce57b5a98e8f3635811cfefd160bca022eb91fe905d36a02cf25": { + "ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf": { "name": "ziglyph", "url": "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz", "hash": "sha256-cse98+Ft8QUjX+P88yyYfaxJOJGQ9M7Ymw7jFxDz89k=" }, - "12209ca054cb1919fa276e328967f10b253f7537c4136eb48f3332b0f7cf661cad38": { + "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy": { "name": "zig_wayland", - "url": "https://deps.files.ghostty.org/zig-wayland-fbfe3b4ac0b472a27b1f1a67405436c58cbee12d.tar.gz", - "hash": "sha256-RtAystqK/GRYIquTK1KfD7rRSCrfuzAvCD1Z9DE1ldc=" + "url": "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz", + "hash": "sha256-E77GZ15APYbbO1WzmuJi8eG9/iQFbc2CgkNBxjCLUhk=" }, - "1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8": { + "zf-0.10.3-OIRy8bKIAACV6JaNNncXA68Nw2BUAD9JVfQdzjyoZQ-J": { "name": "zf", - "url": "https://deps.files.ghostty.org/zf-1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8.tar.gz", - "hash": "sha256-/oLryY3VQfjbtQi+UP+n6FJTVA/YxIetjO+6Ovrh6/E=" + "url": "https://github.com/natecraddock/zf/archive/03176fcf23fda543cc02a8675e92c1fe3b1ee2eb.tar.gz", + "hash": "sha256-HqS2NFUuTQkltFsQlZz4HYHgfhEUEkZY83NnCW2x5Sg=" }, - "1220c72c1697dd9008461ead702997a15d8a1c5810247f02e7983b9f74c6c6e4c087": { + "vaxis-0.1.0-BWNV_K3yCACrTy3A5cbZElLyICx5a2O2EzPxmgVRcbKJ": { "name": "vaxis", - "url": "git+https://github.com/rockorager/libvaxis/?ref=main#dc0a228a5544988d4a920cfb40be9cd28db41423", - "hash": "sha256-QWN4jOrA91KlbqmeEHHJ4HTnCC9nmfxt8DHUXJpAzLI=" + "url": "git+https://github.com/rockorager/libvaxis/?ref=main#6a37605dde55898dcca4769dd3eb1e333959c209", + "hash": "sha256-5DW2V2bVsHtSw7UMGvJ+P0FpXIf5kTNjrq2SMqU6FIk=" }, - "12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d": { + "gobject-0.2.0-Skun7H6DlQDWCiNQtdE5TXYcCvx7MyjW01OQe5M_n_jV": { "name": "gobject", - "url": "https://deps.files.ghostty.org/gobject-12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d.tar.zst", - "hash": "sha256-UU97kNv/bZzQPKz1djhEDLapLguvfBpFfWVb6FthtcI=" + "url": "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-11-16-1/ghostty-gobject-0.14.0-2025-03-11-16-1.tar.gz", + "hash": "sha256-eMmS9oysZheHwSCCvmOUSDJmP9zN7cAr6qqDIbz6EmY=" }, - "12202cdac858abc52413a6c6711d5026d2d3c8e13f95ca2c327eade0736298bb021f": { + "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t": { "name": "wayland", "url": "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz", "hash": "sha256-6kGR1o5DdnflHzqs3ieCmBAUTpMdOXoyfcYDXiw5xQ0=" }, - "12201a57c6ce0001aa034fa80fba3e1cd2253c560a45748f4f4dd21ff23b491cddef": { + "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S": { "name": "wayland_protocols", "url": "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz", "hash": "sha256-XO3K3egbdeYPI+XoO13SuOtO+5+Peb16NH0UiusFMPg=" }, - "12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566": { + "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs": { "name": "plasma_wayland_protocols", "url": "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz", "hash": "sha256-XFi6IUrNjmvKNCbcCLAixGqN2Zeymhs+KLrfccIN9EE=" }, - "122071ad56fd984afb4f94d441b6ea3e21f1741a0e026b02860d9a46110fac2cd109": { + "N-V-__8AAABBKARxrVb9mEr7T5TUQbbqPiHxdBoOAmsChg2a": { "name": "iterm2_themes", "url": "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/e21d5ffd19605741d0e3e19d7c5a8c6c25648673.tar.gz", "hash": "sha256-pyoGlKOWdZVbjGoxPP+CZ6zwil8O12gMOlzX0BJEfAc=" }, - "1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402": { + "N-V-__8AAH0GaQC8a52s6vfIxg88OZgFgEW6DFxfSK4lX_l3": { "name": "imgui", "url": "https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz", "hash": "sha256-oF/QHgTPEat4Hig4fGIdLkIPHmBEyOJ6JeYD6pnveGA=" }, - "1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d": { + "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub": { "name": "freetype", "url": "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz", "hash": "sha256-QnIB9dUVFnDQXB9bRb713aHy592XHvVPD+qqf/0quQw=" }, - "1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66": { + "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD": { "name": "libpng", "url": "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz", "hash": "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo=" }, - "1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb": { + "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o": { "name": "zlib", "url": "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz", "hash": "sha256-F+iIY/NgBnKrSRgvIXKBtvxNPHYr3jYZNeQ2qVIU0Fw=" }, - "12201149afb3326c56c05bb0a577f54f76ac20deece63aa2f5cd6ff31a4fa4fcb3b7": { + "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v": { "name": "fontconfig", "url": "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz", "hash": "sha256-O6LdkhWHGKzsXKrxpxYEO1qgVcJ7CB2RSvPMtA3OilU=" }, - "122032442d95c3b428ae8e526017fad881e7dc78eab4d558e9a58a80bfbd65a64f7d": { + "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK": { "name": "libxml2", - "url": "https://github.com/GNOME/libxml2/archive/refs/tags/v2.11.5.tar.gz", + "url": "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz", "hash": "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU=" }, - "12203eff4829ad8afdd828eb323d48e5ba8dbb44d224e9e314d4ab1533c2bec20f4b": { + "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr": { "name": "gtk4_layer_shell", - "url": "https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v1.1.0.tar.gz", + "url": "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz", "hash": "sha256-mChCgSYKXu9bT2OlXxbEv2p4ihAgptsDfssPcfozaYg=" }, - "1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122": { + "N-V-__8AAKa0rgW4WI8QbJlq8QJJv6CSxvsvNfussVBe9Heg": { "name": "harfbuzz", "url": "https://deps.files.ghostty.org/harfbuzz-1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122.tar.gz", "hash": "sha256-nxygiYE7BZRK0c6MfgGCEwJtNdybq0gKIeuHaDg5ZVY=" }, - "12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b": { + "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE": { "name": "highway", - "url": "https://deps.files.ghostty.org/highway-12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b.tar.gz", - "hash": "sha256-NUqLRTm1iOcLmOxwhEJz4/J0EwLEw3e8xOgbPRhm98k=" + "url": "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz", + "hash": "sha256-h9T4iT704I8iSXNgj/6/lCaKgTgLp5wS6IQZaMgKohI=" }, - "1220f870c853529233ea64a108acaaa81f8d06d7ff4b66c76930be7d78d508aff7a2": { + "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-": { "name": "gettext", "url": "https://deps.files.ghostty.org/gettext-0.24.tar.gz", "hash": "sha256-yRhQPVk9cNr0hE0XWhPYFq+stmfAb7oeydzVACwVGLc=" }, - "1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb": { + "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c": { "name": "oniguruma", "url": "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz", "hash": "sha256-ABqhIC54RI9MC/GkjHblVodrNvFtks4yB+zP1h2Z8qA=" }, - "1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e": { + "N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG": { "name": "sentry", "url": "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz", "hash": "sha256-KsZJfMjWGo0xCT5HrduMmyxFsWsHBbszSoNbZCPDGN8=" }, - "12207fd37bb8251919c112dcdd8f616a491857b34a451f7e4486490077206dc2a1ea": { + "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ": { "name": "breakpad", - "url": "https://github.com/getsentry/breakpad/archive/b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz", + "url": "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz", "hash": "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk=" }, - "1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641": { + "N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH": { "name": "utfcpp", "url": "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz", "hash": "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8=" }, - "122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd": { + "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs": { "name": "wuffs", "url": "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz", "hash": "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM=" }, - "12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806": { + "N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc": { "name": "pixels", "url": "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz", "hash": "sha256-Veg7FtCRCCUCvxSb9FfzH0IJLFmCZQ4/+657SIcb8Ro=" }, - "12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1": { + "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy": { "name": "glslang", "url": "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz", "hash": "sha256-FKLtu1Ccs+UamlPj9eQ12/WXFgS0uDPmPmB26MCpl7U=" }, - "1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da": { + "N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv": { "name": "spirv_cross", "url": "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz", "hash": "sha256-tStvz8Ref6abHwahNiwVVHNETizAmZVVaxVsU7pmV+M=" diff --git a/flake.lock b/flake.lock index 1faef3308..c70ee4d8e 100644 --- a/flake.lock +++ b/flake.lock @@ -52,11 +52,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1738136902, - "narHash": "sha256-pUvLijVGARw4u793APze3j6mU1Zwdtz7hGkGGkD87qw=", + "lastModified": 1741708242, + "narHash": "sha256-cNRqdQD4sZpN7JLqxVOze4+WsWTmv2DGH0wNCOVwrWc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9a5db3142ce450045840cc8d832b13b8a2018e0c", + "rev": "b62d2a95c72fb068aecd374a7262b37ed92df82b", "type": "github" }, "original": { @@ -102,11 +102,11 @@ ] }, "locked": { - "lastModified": 1738239110, - "narHash": "sha256-Y5i9mQ++dyIQr+zEPNy+KIbc5wjPmfllBrag3cHZgcE=", + "lastModified": 1741702955, + "narHash": "sha256-Emk3VnNByigCBlBN34IH2cMrsUqIhdex02uw9TSDsN0=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "1a8fb6f3a04724519436355564b95fce5e272504", + "rev": "1152ce759114a94134081270affd970ae1b957ed", "type": "github" }, "original": { @@ -121,20 +121,20 @@ "flake-utils" ], "nixpkgs": [ - "nixpkgs-stable" + "nixpkgs-unstable" ] }, "locked": { - "lastModified": 1741368279, - "narHash": "sha256-WTaC8HmnIq6O71iK0g9as404BbmS+YyEP5qS85m2JBY=", + "lastModified": 1741816255, + "narHash": "sha256-SJQMnm1vwXy8Td2qp/omjybn+4xZ/MDdZHeK6aa2nb0=", "owner": "jcollie", "repo": "zig2nix", - "rev": "672971b5b6911de21446ad4fc76dee677922eda0", + "rev": "c2a24405298373123e12ca81805e436da648aaf5", "type": "github" }, "original": { "owner": "jcollie", - "ref": "672971b5b6911de21446ad4fc76dee677922eda0", + "ref": "c2a24405298373123e12ca81805e436da648aaf5", "repo": "zig2nix", "type": "github" } diff --git a/flake.nix b/flake.nix index d1be42b15..317a910fd 100644 --- a/flake.nix +++ b/flake.nix @@ -26,9 +26,9 @@ }; zig2nix = { - url = "github:jcollie/zig2nix?ref=672971b5b6911de21446ad4fc76dee677922eda0"; + url = "github:jcollie/zig2nix?ref=c2a24405298373123e12ca81805e436da648aaf5"; inputs = { - nixpkgs.follows = "nixpkgs-stable"; + nixpkgs.follows = "nixpkgs-unstable"; flake-utils.follows = "flake-utils"; }; }; @@ -49,7 +49,7 @@ pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; in { devShell.${system} = pkgs-stable.callPackage ./nix/devShell.nix { - zig = zig.packages.${system}."0.13.0"; + zig = zig.packages.${system}."0.14.0"; wraptest = pkgs-stable.callPackage ./nix/wraptest.nix {}; zig2nix = zig2nix; }; @@ -61,10 +61,10 @@ revision = self.shortRev or self.dirtyShortRev or "dirty"; }; in rec { - deps = pkgs-stable.callPackage ./build.zig.zon.nix {}; - ghostty-debug = pkgs-stable.callPackage ./nix/package.nix (mkArgs "Debug"); - ghostty-releasesafe = pkgs-stable.callPackage ./nix/package.nix (mkArgs "ReleaseSafe"); - ghostty-releasefast = pkgs-stable.callPackage ./nix/package.nix (mkArgs "ReleaseFast"); + deps = pkgs-unstable.callPackage ./build.zig.zon.nix {}; + ghostty-debug = pkgs-unstable.callPackage ./nix/package.nix (mkArgs "Debug"); + ghostty-releasesafe = pkgs-unstable.callPackage ./nix/package.nix (mkArgs "ReleaseSafe"); + ghostty-releasefast = pkgs-unstable.callPackage ./nix/package.nix (mkArgs "ReleaseFast"); ghostty = ghostty-releasefast; default = ghostty; @@ -77,14 +77,14 @@ module: let vm = import ./nix/vm/create.nix { inherit system module; - nixpkgs = nixpkgs-stable; + nixpkgs = nixpkgs-unstable; overlay = self.overlays.debug; }; - program = pkgs-stable.writeShellScript "run-ghostty-vm" '' + program = pkgs-unstable.writeShellScript "run-ghostty-vm" '' SHARED_DIR=$(pwd) export SHARED_DIR - ${pkgs-stable.lib.getExe vm.config.system.build.vm} "$@" + ${pkgs-unstable.lib.getExe vm.config.system.build.vm} "$@" ''; in { type = "app"; diff --git a/nix/build-support/check-zig-cache.sh b/nix/build-support/check-zig-cache.sh index bbe1a3eb9..f86fa7397 100755 --- a/nix/build-support/check-zig-cache.sh +++ b/nix/build-support/check-zig-cache.sh @@ -70,7 +70,7 @@ elif [ "$1" != "--update" ]; then help exit 1 else - jq -r '.[] .url' "$BUILD_ZIG_ZON_LOCK" | sort > "$BUILD_ZIG_ZON_TXT" + jq -r '.[] .url' "$BUILD_ZIG_ZON_LOCK" | LANG=C sort > "$BUILD_ZIG_ZON_TXT" mv "$WORK_DIR/build.zig.zon.nix" "$BUILD_ZIG_ZON_NIX" echo -e "\nOK: build.zig.zon.nix updated." exit 0 diff --git a/nix/devShell.nix b/nix/devShell.nix index b4d901af3..67821f896 100644 --- a/nix/devShell.nix +++ b/nix/devShell.nix @@ -200,5 +200,9 @@ in # and we need iOS too. unset SDKROOT unset DEVELOPER_DIR + + # We need to remove "xcrun" from the PATH. It is injected by + # some dependency but we need to rely on system Xcode tools + export PATH=$(echo "$PATH" | awk -v RS=: -v ORS=: '$0 !~ /xcrun/ || $0 == "/usr/bin" {print}' | sed 's/:$//') ''); } diff --git a/nix/package.nix b/nix/package.nix index 76ed0ae54..62d722d5e 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -24,7 +24,7 @@ git, ncurses, pkg-config, - zig_0_13, + zig_0_14, pandoc, revision ? "dirty", optimize ? "Debug", @@ -45,7 +45,7 @@ # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653 is # ultimately acted on and has made its way to a nixpkgs implementation, this # can probably be removed in favor of that. - zig_hook = zig_0_13.hook.overrideAttrs { + zig_hook = zig_0_14.hook.overrideAttrs { zig_default_flags = "-Dcpu=baseline -Doptimize=${optimize} --color off"; }; in diff --git a/pkg/apple-sdk/build.zig.zon b/pkg/apple-sdk/build.zig.zon index 226c3b088..4fa12c234 100644 --- a/pkg/apple-sdk/build.zig.zon +++ b/pkg/apple-sdk/build.zig.zon @@ -1,5 +1,7 @@ .{ - .name = "apple-sdk", + .name = .apple_sdk, .version = "0.1.0", .dependencies = .{}, + .fingerprint = 0xdde52860f7c464d2, + .paths = .{""}, } diff --git a/pkg/breakpad/build.zig b/pkg/breakpad/build.zig index 1c1bb3e51..a42227e64 100644 --- a/pkg/breakpad/build.zig +++ b/pkg/breakpad/build.zig @@ -14,9 +14,9 @@ pub fn build(b: *std.Build) !void { lib.linkLibCpp(); lib.addIncludePath(upstream.path("src")); lib.addIncludePath(b.path("vendor")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } var flags = std.ArrayList([]const u8).init(b.allocator); @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) !void { .flags = flags.items, }); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { lib.addCSourceFiles(.{ .root = upstream.path(""), .files = common_apple, diff --git a/pkg/breakpad/build.zig.zon b/pkg/breakpad/build.zig.zon index edb36e594..a6c7eda82 100644 --- a/pkg/breakpad/build.zig.zon +++ b/pkg/breakpad/build.zig.zon @@ -1,11 +1,12 @@ .{ - .name = "breakpad", + .name = .breakpad, .version = "0.1.0", + .fingerprint = 0xfe9f9e4c76d5f962, .paths = .{""}, .dependencies = .{ .breakpad = .{ - .url = "https://github.com/getsentry/breakpad/archive/b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz", - .hash = "12207fd37bb8251919c112dcdd8f616a491857b34a451f7e4486490077206dc2a1ea", + .url = "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz", + .hash = "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/cimgui/build.zig b/pkg/cimgui/build.zig index 4b5d56963..72fa085ea 100644 --- a/pkg/cimgui/build.zig +++ b/pkg/cimgui/build.zig @@ -76,9 +76,9 @@ pub fn build(b: *std.Build) !void { .flags = flags.items, }); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { if (!target.query.isNative()) { - try @import("apple_sdk").addPaths(b, &lib.root_module); + try @import("apple_sdk").addPaths(b, lib.root_module); try @import("apple_sdk").addPaths(b, module); } lib.addCSourceFile(.{ diff --git a/pkg/cimgui/build.zig.zon b/pkg/cimgui/build.zig.zon index d5d90b132..2d62f6e84 100644 --- a/pkg/cimgui/build.zig.zon +++ b/pkg/cimgui/build.zig.zon @@ -1,6 +1,7 @@ .{ - .name = "cimgui", + .name = .cimgui, .version = "1.90.6", // -docking branch + .fingerprint = 0x49726f5f8acbc90d, .paths = .{""}, .dependencies = .{ // This should be kept in sync with the submodule in the cimgui source @@ -8,7 +9,7 @@ .imgui = .{ // ocornut/imgui .url = "https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz", - .hash = "1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402", + .hash = "N-V-__8AAH0GaQC8a52s6vfIxg88OZgFgEW6DFxfSK4lX_l3", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/fontconfig/build.zig.zon b/pkg/fontconfig/build.zig.zon index 36b51288b..d1d89cf43 100644 --- a/pkg/fontconfig/build.zig.zon +++ b/pkg/fontconfig/build.zig.zon @@ -1,10 +1,12 @@ .{ - .name = "fontconfig", + .name = .fontconfig, .version = "2.14.2", + .fingerprint = 0x4a79a5a40c6d6d8, + .paths = .{""}, .dependencies = .{ .fontconfig = .{ .url = "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz", - .hash = "12201149afb3326c56c05bb0a577f54f76ac20deece63aa2f5cd6ff31a4fa4fcb3b7", + .hash = "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v", }, .freetype = .{ .path = "../freetype" }, diff --git a/pkg/fontconfig/common.zig b/pkg/fontconfig/common.zig index 44c583f94..6ad6f5685 100644 --- a/pkg/fontconfig/common.zig +++ b/pkg/fontconfig/common.zig @@ -84,7 +84,7 @@ pub const Property = enum { pub fn cval(self: Property) [:0]const u8 { @setEvalBranchQuota(10_000); - inline for (@typeInfo(Property).Enum.fields) |field| { + inline for (@typeInfo(Property).@"enum".fields) |field| { if (self == @field(Property, field.name)) { // Build our string in a comptime context so it is a binary // constant and not stack allocated. diff --git a/pkg/freetype/build.zig b/pkg/freetype/build.zig index 6ff4f4340..594788b0c 100644 --- a/pkg/freetype/build.zig +++ b/pkg/freetype/build.zig @@ -69,9 +69,9 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu }); lib.linkLibC(); lib.addIncludePath(upstream.path("include")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } module.addIncludePath(upstream.path("include")); diff --git a/pkg/freetype/build.zig.zon b/pkg/freetype/build.zig.zon index 581666dd9..20529edff 100644 --- a/pkg/freetype/build.zig.zon +++ b/pkg/freetype/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "freetype", + .name = .freetype, .version = "2.13.2", + .fingerprint = 0xac2059b6f7bbfe0a, .paths = .{""}, .dependencies = .{ // freetype/freetype .freetype = .{ .url = "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz", - .hash = "1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d", + .hash = "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/glslang/build.zig b/pkg/glslang/build.zig index 35cffc01e..629490aa4 100644 --- a/pkg/glslang/build.zig +++ b/pkg/glslang/build.zig @@ -16,7 +16,7 @@ pub fn build(b: *std.Build) !void { module.addIncludePath(upstream.path("")); module.addIncludePath(b.path("override")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); try apple_sdk.addPaths(b, module); } @@ -53,9 +53,9 @@ fn buildGlslang( lib.linkLibCpp(); lib.addIncludePath(upstream.path("")); lib.addIncludePath(b.path("override")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } var flags = std.ArrayList([]const u8).init(b.allocator); diff --git a/pkg/glslang/build.zig.zon b/pkg/glslang/build.zig.zon index 091276502..cbcb08e5d 100644 --- a/pkg/glslang/build.zig.zon +++ b/pkg/glslang/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "glslang", + .name = .glslang, .version = "14.2.0", + .fingerprint = 0x274a35558e2e504, .paths = .{""}, .dependencies = .{ // KhronosGroup/glslang .glslang = .{ .url = "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz", - .hash = "12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1", + .hash = "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/gtk4-layer-shell/build.zig b/pkg/gtk4-layer-shell/build.zig index d1717e927..9ad12d7ab 100644 --- a/pkg/gtk4-layer-shell/build.zig +++ b/pkg/gtk4-layer-shell/build.zig @@ -111,6 +111,16 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu b.fmt("-DGTK_LAYER_SHELL_MAJOR={}", .{version.major}), b.fmt("-DGTK_LAYER_SHELL_MINOR={}", .{version.minor}), b.fmt("-DGTK_LAYER_SHELL_MICRO={}", .{version.patch}), + + // Zig 0.14 regression: this is required because building with + // ubsan results in unknown symbols. Bundling the ubsan/compiler + // RT doesn't help. I'm not sure what the root cause is but I + // suspect its related to this: + // https://github.com/ziglang/zig/issues/23052 + // + // We can remove this in the future for Zig updates and see + // if our binaries run in debug on NixOS. + "-fno-sanitize=undefined", }, }); diff --git a/pkg/gtk4-layer-shell/build.zig.zon b/pkg/gtk4-layer-shell/build.zig.zon index 40f5c56d8..b9b895524 100644 --- a/pkg/gtk4-layer-shell/build.zig.zon +++ b/pkg/gtk4-layer-shell/build.zig.zon @@ -1,15 +1,16 @@ .{ - .name = "gtk4-layer-shell", + .name = .gtk4_layer_shell, .version = "1.1.0", + .fingerprint = 0x4b96f9483c6feeb1, .paths = .{""}, .dependencies = .{ .gtk4_layer_shell = .{ - .url = "https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v1.1.0.tar.gz", - .hash = "12203eff4829ad8afdd828eb323d48e5ba8dbb44d224e9e314d4ab1533c2bec20f4b", + .url = "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz", + .hash = "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr", }, .wayland_protocols = .{ .url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz", - .hash = "12201a57c6ce0001aa034fa80fba3e1cd2253c560a45748f4f4dd21ff23b491cddef", + .hash = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S", }, }, } diff --git a/pkg/harfbuzz/build.zig b/pkg/harfbuzz/build.zig index 5b7d86408..4f20ccbfd 100644 --- a/pkg/harfbuzz/build.zig +++ b/pkg/harfbuzz/build.zig @@ -95,8 +95,8 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu lib.addIncludePath(upstream.path("src")); module.addIncludePath(upstream.path("src")); - if (target.result.isDarwin()) { - try apple_sdk.addPaths(b, &lib.root_module); + if (target.result.os.tag.isDarwin()) { + try apple_sdk.addPaths(b, lib.root_module); try apple_sdk.addPaths(b, module); } diff --git a/pkg/harfbuzz/build.zig.zon b/pkg/harfbuzz/build.zig.zon index 41f2b4e4f..fd6d24025 100644 --- a/pkg/harfbuzz/build.zig.zon +++ b/pkg/harfbuzz/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "harfbuzz", + .name = .harfbuzz, .version = "8.4.0", + .fingerprint = 0xbd60917cd18865d8, .paths = .{""}, .dependencies = .{ // harfbuzz/harfbuzz .harfbuzz = .{ .url = "https://deps.files.ghostty.org/harfbuzz-1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122.tar.gz", - .hash = "1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122", + .hash = "N-V-__8AAKa0rgW4WI8QbJlq8QJJv6CSxvsvNfussVBe9Heg", }, .freetype = .{ .path = "../freetype" }, diff --git a/pkg/highway/build.zig b/pkg/highway/build.zig index 93d76876b..c72ca355f 100644 --- a/pkg/highway/build.zig +++ b/pkg/highway/build.zig @@ -21,9 +21,9 @@ pub fn build(b: *std.Build) !void { lib.addIncludePath(upstream.path("")); module.addIncludePath(upstream.path("")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); try apple_sdk.addPaths(b, module); } @@ -76,6 +76,7 @@ pub fn build(b: *std.Build) !void { .root = upstream.path(""), .flags = flags.items, .files = &.{ + "hwy/abort.cc", "hwy/aligned_allocator.cc", "hwy/nanobenchmark.cc", "hwy/per_target.cc", diff --git a/pkg/highway/build.zig.zon b/pkg/highway/build.zig.zon index da631f93d..8fc05641e 100644 --- a/pkg/highway/build.zig.zon +++ b/pkg/highway/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "highway", - .version = "1.1.0", + .name = .highway, + .version = "1.2.0", + .fingerprint = 0xdbcf1a7425023274, .paths = .{""}, .dependencies = .{ // google/highway .highway = .{ - .url = "https://deps.files.ghostty.org/highway-12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b.tar.gz", - .hash = "12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b", + .url = "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz", + .hash = "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/libintl/build.zig b/pkg/libintl/build.zig index de7ba2b47..e10a97cf4 100644 --- a/pkg/libintl/build.zig +++ b/pkg/libintl/build.zig @@ -42,9 +42,9 @@ pub fn build(b: *std.Build) !void { lib.addIncludePath(upstream.path("gettext-runtime/intl")); lib.addIncludePath(upstream.path("gettext-runtime/intl/gnulib-lib")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } lib.addCSourceFiles(.{ diff --git a/pkg/libintl/build.zig.zon b/pkg/libintl/build.zig.zon index 216bf1bbb..24ee85f43 100644 --- a/pkg/libintl/build.zig.zon +++ b/pkg/libintl/build.zig.zon @@ -1,11 +1,12 @@ .{ - .name = "libintl", + .name = .libintl, .version = "0.24.0", + .fingerprint = 0x16434c723ba7278a, .paths = .{""}, .dependencies = .{ .gettext = .{ .url = "https://deps.files.ghostty.org/gettext-0.24.tar.gz", - .hash = "1220f870c853529233ea64a108acaaa81f8d06d7ff4b66c76930be7d78d508aff7a2", + .hash = "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/libpng/build.zig b/pkg/libpng/build.zig index 753084f62..c5928a667 100644 --- a/pkg/libpng/build.zig +++ b/pkg/libpng/build.zig @@ -15,9 +15,9 @@ pub fn build(b: *std.Build) !void { if (target.result.os.tag == .linux) { lib.linkSystemLibrary("m"); } - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } // For dynamic linking, we prefer dynamic linking and to search by diff --git a/pkg/libpng/build.zig.zon b/pkg/libpng/build.zig.zon index be37d8c09..e06703f62 100644 --- a/pkg/libpng/build.zig.zon +++ b/pkg/libpng/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "libpng", + .name = .libpng, .version = "1.6.43", + .fingerprint = 0xb7a09eb437ca8a79, .paths = .{""}, .dependencies = .{ // glennrp/libpng .libpng = .{ .url = "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz", - .hash = "1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66", + .hash = "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD", }, .zlib = .{ .path = "../zlib" }, diff --git a/pkg/libxml2/build.zig b/pkg/libxml2/build.zig index 7db637774..7effdd134 100644 --- a/pkg/libxml2/build.zig +++ b/pkg/libxml2/build.zig @@ -66,7 +66,7 @@ pub fn build(b: *std.Build) !void { // it to the `LIBXML_{field}_ENABLED` C define where field is uppercased. inline for (std.meta.fields(Options)) |field| { const opt = b.option(bool, field.name, "Configure flag") orelse - @as(*const bool, @ptrCast(field.default_value.?)).*; + @as(*const bool, @ptrCast(field.default_value_ptr.?)).*; if (opt) { var nameBuf: [32]u8 = undefined; const name = std.ascii.upperString(&nameBuf, field.name); diff --git a/pkg/libxml2/build.zig.zon b/pkg/libxml2/build.zig.zon index 5776b429e..3f6906a50 100644 --- a/pkg/libxml2/build.zig.zon +++ b/pkg/libxml2/build.zig.zon @@ -1,10 +1,12 @@ .{ - .name = "libxml2", + .name = .libxml2, .version = "2.11.5", + .fingerprint = 0xf268267b0b8b040d, + .paths = .{""}, .dependencies = .{ .libxml2 = .{ - .url = "https://github.com/GNOME/libxml2/archive/refs/tags/v2.11.5.tar.gz", - .hash = "122032442d95c3b428ae8e526017fad881e7dc78eab4d558e9a58a80bfbd65a64f7d", + .url = "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz", + .hash = "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK", }, }, } diff --git a/pkg/macos/build.zig b/pkg/macos/build.zig index a154b24fa..fcc1a2226 100644 --- a/pkg/macos/build.zig +++ b/pkg/macos/build.zig @@ -21,7 +21,7 @@ pub fn build(b: *std.Build) !void { var flags = std.ArrayList([]const u8).init(b.allocator); defer flags.deinit(); lib.addCSourceFile(.{ - .file = b.path("os/log.c"), + .file = b.path("os/zig_log.c"), .flags = flags.items, }); lib.addCSourceFile(.{ @@ -38,7 +38,7 @@ pub fn build(b: *std.Build) !void { module.linkFramework("Carbon", .{}); } - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { module.linkFramework("CoreFoundation", .{}); module.linkFramework("CoreGraphics", .{}); module.linkFramework("CoreText", .{}); @@ -46,7 +46,7 @@ pub fn build(b: *std.Build) !void { module.linkFramework("QuartzCore", .{}); if (!target.query.isNative()) { - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); try apple_sdk.addPaths(b, module); } } diff --git a/pkg/macos/os/log.c b/pkg/macos/os/zig_log.c similarity index 100% rename from pkg/macos/os/log.c rename to pkg/macos/os/zig_log.c diff --git a/pkg/oniguruma/build.zig b/pkg/oniguruma/build.zig index da7c90674..889a04edd 100644 --- a/pkg/oniguruma/build.zig +++ b/pkg/oniguruma/build.zig @@ -68,9 +68,9 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu lib.addIncludePath(upstream.path("src")); module.addIncludePath(upstream.path("src")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } lib.addConfigHeader(b.addConfigHeader(.{ @@ -88,10 +88,10 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu .HAVE_SYS_TYPES_H = true, .HAVE_UNISTD_H = true, .HAVE_INTTYPES_H = true, - .SIZEOF_INT = t.c_type_byte_size(.int), - .SIZEOF_LONG = t.c_type_byte_size(.long), - .SIZEOF_LONG_LONG = t.c_type_byte_size(.longlong), - .SIZEOF_VOIDP = t.ptrBitWidth() / t.c_type_bit_size(.char), + .SIZEOF_INT = t.cTypeByteSize(.int), + .SIZEOF_LONG = t.cTypeByteSize(.long), + .SIZEOF_LONG_LONG = t.cTypeByteSize(.longlong), + .SIZEOF_VOIDP = t.ptrBitWidth() / t.cTypeBitSize(.char), })); var flags = std.ArrayList([]const u8).init(b.allocator); diff --git a/pkg/oniguruma/build.zig.zon b/pkg/oniguruma/build.zig.zon index b1ba96dc8..7c9075f4e 100644 --- a/pkg/oniguruma/build.zig.zon +++ b/pkg/oniguruma/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "oniguruma", + .name = .oniguruma, .version = "6.9.9", + .fingerprint = 0xe3b537b18c5785a8, .paths = .{""}, .dependencies = .{ // kkos/oniguruma .oniguruma = .{ .url = "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz", - .hash = "1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb", + .hash = "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/opengl/Buffer.zig b/pkg/opengl/Buffer.zig index 6b6a95a5d..3e55410b7 100644 --- a/pkg/opengl/Buffer.zig +++ b/pkg/opengl/Buffer.zig @@ -115,12 +115,12 @@ pub const Binding = struct { ptr: *const anyopaque, } { return switch (@typeInfo(@TypeOf(data))) { - .Pointer => |ptr| switch (ptr.size) { - .One => .{ + .pointer => |ptr| switch (ptr.size) { + .one => .{ .size = @sizeOf(ptr.child), .ptr = data, }, - .Slice => .{ + .slice => .{ .size = @intCast(@sizeOf(ptr.child) * data.len), .ptr = data.ptr, }, diff --git a/pkg/opengl/glad.zig b/pkg/opengl/glad.zig index c9f792a63..79a2e4d6b 100644 --- a/pkg/opengl/glad.zig +++ b/pkg/opengl/glad.zig @@ -25,7 +25,7 @@ pub fn load(getProcAddress: anytype) !c_int { @TypeOf(null) => c.gladLoaderLoadGLContext(&context), // try as-is. If this introduces a compiler error, then add a new case. - else => c.gladLoadGLContext(&context, getProcAddress), + else => c.gladLoadGLContext(&context, @ptrCast(getProcAddress)), }; if (res == 0) return error.GLInitFailed; return res; diff --git a/pkg/sentry/build.zig b/pkg/sentry/build.zig index 855490c0a..37fd772a9 100644 --- a/pkg/sentry/build.zig +++ b/pkg/sentry/build.zig @@ -23,9 +23,9 @@ pub fn build(b: *std.Build) !void { lib.linkLibC(); lib.addIncludePath(upstream.path("include")); lib.addIncludePath(upstream.path("src")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); try apple_sdk.addPaths(b, module); } diff --git a/pkg/sentry/build.zig.zon b/pkg/sentry/build.zig.zon index 8d1162cb4..96a39f05a 100644 --- a/pkg/sentry/build.zig.zon +++ b/pkg/sentry/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "sentry", + .name = .sentry, .version = "0.7.8", + .fingerprint = 0xd177b4a12f6b3b79, .paths = .{""}, .dependencies = .{ // getsentry/sentry-native .sentry = .{ .url = "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz", - .hash = "1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e", + .hash = "N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/simdutf/build.zig b/pkg/simdutf/build.zig index 1532e4a33..859653443 100644 --- a/pkg/simdutf/build.zig +++ b/pkg/simdutf/build.zig @@ -1,8 +1,8 @@ const std = @import("std"); pub fn build(b: *std.Build) !void { - const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); + const target = b.standardTargetOptions(.{}); const lib = b.addStaticLibrary(.{ .name = "simdutf", @@ -12,9 +12,9 @@ pub fn build(b: *std.Build) !void { lib.linkLibCpp(); lib.addIncludePath(b.path("vendor")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } var flags = std.ArrayList([]const u8).init(b.allocator); diff --git a/pkg/simdutf/build.zig.zon b/pkg/simdutf/build.zig.zon index 63c5f41b5..cd81c841e 100644 --- a/pkg/simdutf/build.zig.zon +++ b/pkg/simdutf/build.zig.zon @@ -1,6 +1,7 @@ .{ - .name = "simdutf", + .name = .simdutf, .version = "5.2.8", + .fingerprint = 0x7494ad640528a0d, .paths = .{""}, .dependencies = .{ .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/spirv-cross/build.zig b/pkg/spirv-cross/build.zig index 8281a5df1..c7d0d2039 100644 --- a/pkg/spirv-cross/build.zig +++ b/pkg/spirv-cross/build.zig @@ -42,9 +42,9 @@ fn buildSpirvCross( }); lib.linkLibC(); lib.linkLibCpp(); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } var flags = std.ArrayList([]const u8).init(b.allocator); diff --git a/pkg/spirv-cross/build.zig.zon b/pkg/spirv-cross/build.zig.zon index dedf5e964..a7ad7133d 100644 --- a/pkg/spirv-cross/build.zig.zon +++ b/pkg/spirv-cross/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "spirv-cross", + .name = .spirv_cross, .version = "13.1.1", + .fingerprint = 0x7ea1d8312b06cca, .paths = .{""}, .dependencies = .{ // KhronosGroup/SPIRV-Cross .spirv_cross = .{ .url = "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz", - .hash = "1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da", + .hash = "N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/utfcpp/build.zig b/pkg/utfcpp/build.zig index f148acbba..4720d5323 100644 --- a/pkg/utfcpp/build.zig +++ b/pkg/utfcpp/build.zig @@ -14,9 +14,9 @@ pub fn build(b: *std.Build) !void { lib.linkLibCpp(); lib.addIncludePath(upstream.path("")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } var flags = std.ArrayList([]const u8).init(b.allocator); diff --git a/pkg/utfcpp/build.zig.zon b/pkg/utfcpp/build.zig.zon index 795a02749..bd696ac41 100644 --- a/pkg/utfcpp/build.zig.zon +++ b/pkg/utfcpp/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "utfcpp", + .name = .utfcpp, .version = "4.0.5", + .fingerprint = 0xcd99aeb2334ae11a, .paths = .{""}, .dependencies = .{ // nemtrif/utfcpp .utfcpp = .{ .url = "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz", - .hash = "1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641", + .hash = "N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/wuffs/build.zig b/pkg/wuffs/build.zig index 438f714d3..a98300bd1 100644 --- a/pkg/wuffs/build.zig +++ b/pkg/wuffs/build.zig @@ -13,7 +13,7 @@ pub fn build(b: *std.Build) !void { .link_libc = true, }); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); try apple_sdk.addPaths(b, module); } diff --git a/pkg/wuffs/build.zig.zon b/pkg/wuffs/build.zig.zon index caa28f1c6..3e766b635 100644 --- a/pkg/wuffs/build.zig.zon +++ b/pkg/wuffs/build.zig.zon @@ -1,17 +1,18 @@ .{ - .name = "wuffs", + .name = .wuffs, .version = "0.0.0", + .fingerprint = 0x67c0c059de921c4f, .dependencies = .{ // google/wuffs .wuffs = .{ .url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz", - .hash = "122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd", + .hash = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs", }, // make-github-pseudonymous-again/pixels .pixels = .{ .url = "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz", - .hash = "12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806", + .hash = "N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/pkg/zlib/build.zig b/pkg/zlib/build.zig index 10a937a36..b58e94980 100644 --- a/pkg/zlib/build.zig +++ b/pkg/zlib/build.zig @@ -13,9 +13,9 @@ pub fn build(b: *std.Build) !void { }); lib.linkLibC(); lib.addIncludePath(upstream.path("")); - if (target.result.isDarwin()) { + if (target.result.os.tag.isDarwin()) { const apple_sdk = @import("apple_sdk"); - try apple_sdk.addPaths(b, &lib.root_module); + try apple_sdk.addPaths(b, lib.root_module); } lib.installHeadersDirectory( diff --git a/pkg/zlib/build.zig.zon b/pkg/zlib/build.zig.zon index 43176352a..551d87040 100644 --- a/pkg/zlib/build.zig.zon +++ b/pkg/zlib/build.zig.zon @@ -1,12 +1,13 @@ .{ - .name = "zlib", + .name = .zlib, .version = "1.3.1", + .fingerprint = 0x73887d3aef823f9e, .paths = .{""}, .dependencies = .{ // madler/zlib .zlib = .{ .url = "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz", - .hash = "1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb", + .hash = "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o", }, .apple_sdk = .{ .path = "../apple-sdk" }, diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 5b2111cef..43d15f813 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -52,7 +52,7 @@ parts: rm -rf $CRAFT_PART_SRC/* if [[ -n $arch ]]; then - curl -LO --retry-connrefused --retry 10 https://ziglang.org/download/0.13.0/zig-linux-$arch-0.13.0.tar.xz + curl -LO --retry-connrefused --retry 10 https://ziglang.org/download/0.14.0/zig-linux-$arch-0.14.0.tar.xz else echo "Unsupported arch" exit 1 diff --git a/src/Command.zig b/src/Command.zig index 6e30eae13..a810b16ce 100644 --- a/src/Command.zig +++ b/src/Command.zig @@ -193,11 +193,11 @@ fn startPosix(self: *Command, arena: Allocator) !void { } fn startWindows(self: *Command, arena: Allocator) !void { - const application_w = try std.unicode.utf8ToUtf16LeWithNull(arena, self.path); - const cwd_w = if (self.cwd) |cwd| try std.unicode.utf8ToUtf16LeWithNull(arena, cwd) else null; + const application_w = try std.unicode.utf8ToUtf16LeAllocZ(arena, self.path); + const cwd_w = if (self.cwd) |cwd| try std.unicode.utf8ToUtf16LeAllocZ(arena, cwd) else null; const command_line_w = if (self.args.len > 0) b: { const command_line = try windowsCreateCommandLine(arena, self.args); - break :b try std.unicode.utf8ToUtf16LeWithNull(arena, command_line); + break :b try std.unicode.utf8ToUtf16LeAllocZ(arena, command_line); } else null; const env_w = if (self.env) |env_map| try createWindowsEnvBlock(arena, env_map) else null; @@ -392,7 +392,7 @@ pub fn expandPath(alloc: Allocator, cmd: []const u8) !?[]u8 { const PATH = switch (builtin.os.tag) { .windows => blk: { const win_path = std.process.getenvW(std.unicode.utf8ToUtf16LeStringLiteral("PATH")) orelse return null; - const path = try std.unicode.utf16leToUtf8Alloc(alloc, win_path); + const path = try std.unicode.utf16LeToUtf8Alloc(alloc, win_path); break :blk path; }, else => std.posix.getenvZ("PATH") orelse return null, diff --git a/src/Surface.zig b/src/Surface.zig index 10e8428e1..2111b010b 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -24,7 +24,7 @@ const global_state = &@import("global.zig").state; const oni = @import("oniguruma"); const crash = @import("crash/main.zig"); const unicode = @import("unicode/main.zig"); -const renderer = @import("renderer.zig"); +const rendererpkg = @import("renderer.zig"); const termio = @import("termio.zig"); const objc = @import("objc"); const imgui = @import("imgui"); @@ -36,13 +36,13 @@ const configpkg = @import("config.zig"); const input = @import("input.zig"); const App = @import("App.zig"); const internal_os = @import("os/main.zig"); -const inspector = @import("inspector/main.zig"); +const inspectorpkg = @import("inspector/main.zig"); const SurfaceMouse = @import("surface_mouse.zig"); const log = std.log.scoped(.surface); // The renderer implementation to use. -const Renderer = renderer.Renderer; +const Renderer = rendererpkg.Renderer; /// Minimum window size in cells. This is used to prevent the window from /// being resized to a size that is too small to be useful. These defaults @@ -70,10 +70,10 @@ font_metrics: font.Metrics, renderer: Renderer, /// The render state -renderer_state: renderer.State, +renderer_state: rendererpkg.State, /// The renderer thread manager -renderer_thread: renderer.Thread, +renderer_thread: rendererpkg.Thread, /// The actual thread renderer_thr: std.Thread, @@ -113,10 +113,10 @@ io_thread: termio.Thread, io_thr: std.Thread, /// Terminal inspector -inspector: ?*inspector.Inspector = null, +inspector: ?*inspectorpkg.Inspector = null, /// All our sizing information. -size: renderer.Size, +size: rendererpkg.Size, /// The configuration derived from the main config. We "derive" it so that /// we don't have a shared pointer hanging around that we need to worry about @@ -339,7 +339,7 @@ const DerivedConfig = struct { self.arena.deinit(); } - fn scaledPadding(self: *const DerivedConfig, x_dpi: f32, y_dpi: f32) renderer.Padding { + fn scaledPadding(self: *const DerivedConfig, x_dpi: f32, y_dpi: f32) rendererpkg.Padding { const padding_top: u32 = padding_top: { const padding_top: f32 = @floatFromInt(self.window_padding_top); break :padding_top @intFromFloat(@floor(padding_top * y_dpi / 72)); @@ -431,8 +431,8 @@ pub fn init( ); // Build our size struct which has all the sizes we need. - const size: renderer.Size = size: { - var size: renderer.Size = .{ + const size: rendererpkg.Size = size: { + var size: rendererpkg.Size = .{ .screen = screen: { const surface_size = try rt_surface.getSize(); break :screen .{ @@ -445,7 +445,7 @@ pub fn init( .padding = .{}, }; - const explicit: renderer.Padding = derived_config.scaledPadding( + const explicit: rendererpkg.Padding = derived_config.scaledPadding( x_dpi, y_dpi, ); @@ -475,7 +475,7 @@ pub fn init( errdefer alloc.destroy(mutex); // Create the renderer thread - var render_thread = try renderer.Thread.init( + var render_thread = try rendererpkg.Thread.init( alloc, config, rt_surface, @@ -611,7 +611,7 @@ pub fn init( // Start our renderer thread self.renderer_thr = try std.Thread.spawn( .{}, - renderer.Thread.threadMain, + rendererpkg.Thread.threadMain, .{&self.renderer_thread}, ); self.renderer_thr.setName("renderer") catch {}; @@ -736,9 +736,9 @@ pub fn activateInspector(self: *Surface) !void { if (self.inspector != null) return; // Setup the inspector - const ptr = try self.alloc.create(inspector.Inspector); + const ptr = try self.alloc.create(inspectorpkg.Inspector); errdefer self.alloc.destroy(ptr); - ptr.* = try inspector.Inspector.init(self); + ptr.* = try inspectorpkg.Inspector.init(self); self.inspector = ptr; // Put the inspector onto the render state @@ -1091,7 +1091,7 @@ fn mouseRefreshLinks( } /// Called when our renderer health state changes. -fn updateRendererHealth(self: *Surface, health: renderer.Health) void { +fn updateRendererHealth(self: *Surface, health: rendererpkg.Health) void { log.warn("renderer health status change status={}", .{health}); _ = self.rt_app.performAction( .{ .surface = self }, @@ -1163,7 +1163,7 @@ pub fn updateConfig( // We need to store our configs in a heap-allocated pointer so that // our messages aren't huge. - var renderer_message = try renderer.Message.initChangeConfig(self.alloc, config); + var renderer_message = try rendererpkg.Message.initChangeConfig(self.alloc, config); errdefer renderer_message.deinit(); var termio_config_ptr = try self.alloc.create(termio.Termio.DerivedConfig); errdefer self.alloc.destroy(termio_config_ptr); @@ -1497,7 +1497,7 @@ fn setSelection(self: *Surface, sel_: ?terminal.Selection) !void { /// Change the cell size for the terminal grid. This can happen as /// a result of changing the font size at runtime. -fn setCellSize(self: *Surface, size: renderer.CellSize) !void { +fn setCellSize(self: *Surface, size: rendererpkg.CellSize) !void { // Update our cell size within our size struct self.size.cell = size; self.balancePaddingIfNeeded(); @@ -1573,7 +1573,7 @@ pub fn sizeCallback(self: *Surface, size: apprt.SurfaceSize) !void { crash.sentry.thread_state = self.crashThreadState(); defer crash.sentry.thread_state = null; - const new_screen_size: renderer.ScreenSize = .{ + const new_screen_size: rendererpkg.ScreenSize = .{ .width = size.width, .height = size.height, }; @@ -1586,7 +1586,7 @@ pub fn sizeCallback(self: *Surface, size: apprt.SurfaceSize) !void { try self.resize(new_screen_size); } -fn resize(self: *Surface, size: renderer.ScreenSize) !void { +fn resize(self: *Surface, size: rendererpkg.ScreenSize) !void { // Save our screen size self.size.screen = size; self.balancePaddingIfNeeded(); @@ -1667,7 +1667,7 @@ pub fn preeditCallback(self: *Surface, preedit_: ?[]const u8) !void { var it = view.iterator(); // Allocate the codepoints slice - const Codepoint = renderer.State.Preedit.Codepoint; + const Codepoint = rendererpkg.State.Preedit.Codepoint; var codepoints: std.ArrayListUnmanaged(Codepoint) = .{}; defer codepoints.deinit(self.alloc); while (it.nextCodepoint()) |cp| { @@ -1734,7 +1734,7 @@ pub fn keyCallback( defer crash.sentry.thread_state = null; // Setup our inspector event if we have an inspector. - var insp_ev: ?inspector.key.Event = if (self.inspector != null) ev: { + var insp_ev: ?inspectorpkg.key.Event = if (self.inspector != null) ev: { var copy = event; copy.utf8 = ""; if (event.utf8.len > 0) copy.utf8 = try self.alloc.dupe(u8, event.utf8); @@ -1898,7 +1898,7 @@ pub fn keyCallback( fn maybeHandleBinding( self: *Surface, event: input.KeyEvent, - insp_ev: ?*inspector.key.Event, + insp_ev: ?*inspectorpkg.key.Event, ) !?InputEffect { switch (event.action) { // Release events never trigger a binding but we need to check if @@ -2106,7 +2106,7 @@ fn endKeySequence( fn encodeKey( self: *Surface, event: input.KeyEvent, - insp_ev: ?*inspector.key.Event, + insp_ev: ?*inspectorpkg.key.Event, ) !?termio.Message.WriteReq { // Build up our encoder. Under different modes and // inputs there are many keybindings that result in no encoding @@ -2749,7 +2749,7 @@ fn mouseReport( const final: u8 = if (action == .release) 'm' else 'M'; // The position has to be adjusted to the terminal space. - const coord: renderer.Coordinate.Terminal = (renderer.Coordinate{ + const coord: rendererpkg.Coordinate.Terminal = (rendererpkg.Coordinate{ .surface = .{ .x = pos.x, .y = pos.y, @@ -3819,7 +3819,7 @@ pub fn colorSchemeCallback(self: *Surface, scheme: apprt.ColorScheme) !void { pub fn posToViewport(self: Surface, xpos: f64, ypos: f64) terminal.point.Coordinate { // Get our grid cell - const coord: renderer.Coordinate = .{ .surface = .{ .x = xpos, .y = ypos } }; + const coord: rendererpkg.Coordinate = .{ .surface = .{ .x = xpos, .y = ypos } }; const grid = coord.convert(.grid, self.size).grid; return .{ .x = grid.x, .y = grid.y }; } diff --git a/src/apprt/action.zig b/src/apprt/action.zig index 149118aa6..2ddbee524 100644 --- a/src/apprt/action.zig +++ b/src/apprt/action.zig @@ -291,7 +291,7 @@ pub const Action = union(Key) { /// Sync with: ghostty_action_u pub const CValue = cvalue: { - const key_fields = @typeInfo(Key).Enum.fields; + const key_fields = @typeInfo(Key).@"enum".fields; var union_fields: [key_fields.len]std.builtin.Type.UnionField = undefined; for (key_fields, 0..) |field, i| { const action = @unionInit(Action, field.name, undefined); @@ -309,7 +309,7 @@ pub const Action = union(Key) { }; } - break :cvalue @Type(.{ .Union = .{ + break :cvalue @Type(.{ .@"union" = .{ .layout = .@"extern", .tag_type = Key, .fields = &union_fields, @@ -325,7 +325,7 @@ pub const Action = union(Key) { /// Returns the value type for the given key. pub fn Value(comptime key: Key) type { - inline for (@typeInfo(Action).Union.fields) |field| { + inline for (@typeInfo(Action).@"union".fields) |field| { const field_key = @field(Key, field.name); if (field_key == key) return field.type; } diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index f7f67b270..4ad0390df 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -165,7 +165,7 @@ pub const App = struct { // then we strip the alt modifier from the mods for translation. const translate_mods = translate_mods: { var translate_mods = mods; - if ((comptime builtin.target.isDarwin()) and translate_mods.alt) { + if ((comptime builtin.target.os.tag.isDarwin()) and translate_mods.alt) { // Note: the keyboardLayout() function is not super cheap // so we only want to run it if alt is already pressed hence // the above condition. @@ -184,7 +184,7 @@ pub const App = struct { // We strip super on macOS because its not used for translation // it results in a bad translation. - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { translate_mods.super = false; } @@ -538,12 +538,12 @@ pub const Platform = union(PlatformTag) { // If our build target for libghostty is not darwin then we do // not include macos support at all. - pub const MacOS = if (builtin.target.isDarwin()) struct { + pub const MacOS = if (builtin.target.os.tag.isDarwin()) struct { /// The view to render the surface on. nsview: objc.Object, } else void; - pub const IOS = if (builtin.target.isDarwin()) struct { + pub const IOS = if (builtin.target.os.tag.isDarwin()) struct { /// The view to render the surface on. uiview: objc.Object, } else void; @@ -1025,7 +1025,7 @@ pub const Surface = struct { var env = try internal_os.getEnvMap(alloc); errdefer env.deinit(); - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { if (env.get("__XCODE_BUILT_PRODUCTS_DIR_PATHS") != null) { env.remove("__XCODE_BUILT_PRODUCTS_DIR_PATHS"); env.remove("__XPC_DYLD_LIBRARY_PATH"); @@ -1078,7 +1078,7 @@ pub const Inspector = struct { pub fn deinit(self: Backend) void { switch (self) { - .metal => if (builtin.target.isDarwin()) cimgui.ImGui_ImplMetal_Shutdown(), + .metal => if (builtin.target.os.tag.isDarwin()) cimgui.ImGui_ImplMetal_Shutdown(), } } }; @@ -1351,7 +1351,7 @@ pub const CAPI = struct { // Reference the conditional exports based on target platform // so they're included in the C API. comptime { - if (builtin.target.isDarwin()) { + if (builtin.target.os.tag.isDarwin()) { _ = Darwin; } } diff --git a/src/apprt/glfw.zig b/src/apprt/glfw.zig index 935ca85ac..998f88022 100644 --- a/src/apprt/glfw.zig +++ b/src/apprt/glfw.zig @@ -25,10 +25,14 @@ const Config = @import("../config.zig").Config; // Get native API access on certain platforms so we can do more customization. const glfwNative = glfw.Native(.{ - .cocoa = builtin.target.isDarwin(), + .cocoa = builtin.target.os.tag.isDarwin(), .x11 = builtin.os.tag == .linux, }); +/// True if darwin-specific logic is enabled +const darwin_enabled = builtin.target.os.tag.isDarwin() and + build_config.artifact == .exe; + const log = std.log.scoped(.glfw); pub const App = struct { @@ -40,12 +44,12 @@ pub const App = struct { quit: bool = false, /// Mac-specific state. - darwin: if (Darwin.enabled) Darwin else void, + darwin: if (darwin_enabled) Darwin else void, pub const Options = struct {}; pub fn init(core_app: *CoreApp, _: Options) !App { - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { log.warn("WARNING WARNING WARNING: GLFW ON MAC HAS BUGS.", .{}); log.warn("You should use the AppKit-based app instead. The official download", .{}); log.warn("is properly built and available from GitHub. If you're building from", .{}); @@ -66,8 +70,8 @@ pub const App = struct { glfw.setErrorCallback(glfwErrorCallback); // Mac-specific state. For example, on Mac we enable window tabbing. - var darwin = if (Darwin.enabled) try Darwin.init() else {}; - errdefer if (Darwin.enabled) darwin.deinit(); + var darwin = if (darwin_enabled) try Darwin.init() else {}; + errdefer if (darwin_enabled) darwin.deinit(); // Load our configuration var config = try Config.load(core_app.alloc); @@ -338,7 +342,7 @@ pub const App = struct { /// Create a new tab in the parent surface. fn newTab(self: *App, parent_: ?*CoreSurface) !void { - if (!Darwin.enabled) { + if (comptime !darwin_enabled) { log.warn("tabbing is not supported on this platform", .{}); return; } @@ -439,8 +443,6 @@ pub const App = struct { /// Mac and the artifact is a standalone exe. We don't target libs because /// the embedded API doesn't do windowing. const Darwin = struct { - const enabled = builtin.target.isDarwin() and build_config.artifact == .exe; - tabbing_id: *macos.foundation.String, pub fn init() !Darwin { @@ -554,7 +556,7 @@ pub const Surface = struct { } // On Mac, enable window tabbing - if (App.Darwin.enabled) { + if (comptime darwin_enabled) { const NSWindowTabbingMode = enum(usize) { automatic = 0, preferred = 1, disallowed = 2 }; const nswindow = objc.Object.fromId(glfwNative.getCocoaWindow(win).?); @@ -630,7 +632,7 @@ pub const Surface = struct { // Clean up our core surface so that all the rendering and IO stop. self.core_surface.deinit(); - if (App.Darwin.enabled) { + if (comptime darwin_enabled) { const nswindow = objc.Object.fromId(glfwNative.getCocoaWindow(self.window).?); const tabgroup = nswindow.getProperty(objc.Object, "tabGroup"); const windows = tabgroup.getProperty(objc.Object, "windows"); @@ -767,7 +769,7 @@ pub const Surface = struct { /// Set the shape of the cursor. fn setMouseShape(self: *Surface, shape: terminal.MouseShape) !void { - if ((comptime builtin.target.isDarwin()) and + if ((comptime builtin.target.os.tag.isDarwin()) and !internal_os.macos.isAtLeastVersion(13, 0, 0)) { // We only set our cursor if we're NOT on Mac, or if we are then the @@ -925,7 +927,7 @@ pub const Surface = struct { // On macOS we need to also disable some modifiers because // alt+key consumes the alt. - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { // For GLFW, we say we always consume alt because // GLFW doesn't have a way to disable the alt key. key_event.consumed_mods.alt = true; diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 9893f1ee9..2ed90eccf 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -43,7 +43,7 @@ const c = @import("c.zig").c; const version = @import("version.zig"); const inspector = @import("inspector.zig"); const key = @import("key.zig"); -const winproto = @import("winproto.zig"); +const winprotopkg = @import("winproto.zig"); const testing = std.testing; const adwaita = @import("adwaita.zig"); @@ -58,7 +58,7 @@ app: *c.GtkApplication, ctx: *c.GMainContext, /// State and logic for the underlying windowing protocol. -winproto: winproto.App, +winproto: winprotopkg.App, /// True if the app was launched with single instance mode. single_instance: bool, @@ -226,7 +226,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { var fmt = std.io.fixedBufferStream(&buf); const writer = fmt.writer(); var first: bool = true; - inline for (@typeInfo(@TypeOf(gdk_debug)).Struct.fields) |field| { + inline for (@typeInfo(@TypeOf(gdk_debug)).@"struct".fields) |field| { if (@field(gdk_debug, field.name)) { if (!first) try writer.writeAll(","); try writer.writeAll(field.name); @@ -244,7 +244,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { var fmt = std.io.fixedBufferStream(&buf); const writer = fmt.writer(); var first: bool = true; - inline for (@typeInfo(@TypeOf(gdk_disable)).Struct.fields) |field| { + inline for (@typeInfo(@TypeOf(gdk_disable)).@"struct".fields) |field| { if (@field(gdk_disable, field.name)) { if (!first) try writer.writeAll(","); try writer.writeAll(field.name); @@ -401,7 +401,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { } // Setup our windowing protocol logic - var winproto_app = try winproto.App.init( + var winproto_app = try winprotopkg.App.init( core_app.alloc, display, app_id, diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 23abccc20..805681941 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -32,7 +32,7 @@ const ClipboardConfirmationWindow = @import("ClipboardConfirmationWindow.zig"); const ResizeOverlay = @import("ResizeOverlay.zig"); const URLWidget = @import("URLWidget.zig"); const CloseDialog = @import("CloseDialog.zig"); -const inspector = @import("inspector.zig"); +const inspectorpkg = @import("inspector.zig"); const gtk_key = @import("key.zig"); const c = @import("c.zig").c; const Builder = @import("Builder.zig"); @@ -290,7 +290,7 @@ size: apprt.SurfaceSize, cursor_pos: apprt.CursorPos, /// Inspector state. -inspector: ?*inspector.Inspector = null, +inspector: ?*inspectorpkg.Inspector = null, /// Key input states. See gtkKeyPressed for detailed descriptions. in_keyevent: IMKeyEvent = .false, @@ -703,7 +703,7 @@ pub fn controlInspector( // If we already have an inspector, we don't need to show anything. if (self.inspector != null) return; - self.inspector = inspector.Inspector.create( + self.inspector = inspectorpkg.Inspector.create( self, .{ .window = {} }, ) catch |err| { diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index 86e397e37..2e2e0c329 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -34,7 +34,7 @@ const TabView = @import("TabView.zig"); const HeaderBar = @import("headerbar.zig"); const CloseDialog = @import("CloseDialog.zig"); const version = @import("version.zig"); -const winproto = @import("winproto.zig"); +const winprotopkg = @import("winproto.zig"); const log = std.log.scoped(.gtk); @@ -69,7 +69,7 @@ toast_overlay: *c.GtkWidget, adw_tab_overview_focus_timer: ?c.guint = null, /// State and logic for windowing protocol for a window. -winproto: winproto.Window, +winproto: winprotopkg.Window, pub const DerivedConfig = struct { background_opacity: f64, @@ -693,7 +693,7 @@ fn gtkRealize(_: *c.GtkWindow, ud: ?*anyopaque) callconv(.C) bool { const self = userdataSelf(ud.?); // Initialize our window protocol logic - if (winproto.Window.init( + if (winprotopkg.Window.init( self.app.core_app.alloc, &self.app.winproto, self, diff --git a/src/apprt/gtk/winproto.zig b/src/apprt/gtk/winproto.zig index 01587a226..7fc7c0bd3 100644 --- a/src/apprt/gtk/winproto.zig +++ b/src/apprt/gtk/winproto.zig @@ -30,7 +30,7 @@ pub const App = union(Protocol) { app_id: [:0]const u8, config: *const Config, ) !App { - inline for (@typeInfo(App).Union.fields) |field| { + inline for (@typeInfo(App).@"union".fields) |field| { if (try field.type.init( alloc, gdk_display, @@ -96,7 +96,7 @@ pub const Window = union(Protocol) { ) !Window { return switch (app.*) { inline else => |*v, tag| { - inline for (@typeInfo(Window).Union.fields) |field| { + inline for (@typeInfo(Window).@"union".fields) |field| { if (comptime std.mem.eql( u8, field.name, diff --git a/src/apprt/gtk/winproto/x11.zig b/src/apprt/gtk/winproto/x11.zig index e0ac4e3e7..72054f0eb 100644 --- a/src/apprt/gtk/winproto/x11.zig +++ b/src/apprt/gtk/winproto/x11.zig @@ -342,7 +342,7 @@ pub const Window = struct { &actual_format_return, &nitems_return, &bytes_after_return, - &prop_return, + @ptrCast(&prop_return), ); if (code != c.Success) return error.RequestFailed; diff --git a/src/build/Config.zig b/src/build/Config.zig index d7a5e4ae2..562e1777c 100644 --- a/src/build/Config.zig +++ b/src/build/Config.zig @@ -7,7 +7,7 @@ const builtin = @import("builtin"); const apprt = @import("../apprt.zig"); const font = @import("../font/main.zig"); -const renderer = @import("../renderer.zig"); +const rendererpkg = @import("../renderer.zig"); const Command = @import("../Command.zig"); const WasmTarget = @import("../os/wasm/target.zig").Target; @@ -28,7 +28,7 @@ wasm_target: WasmTarget, /// Comptime interfaces app_runtime: apprt.Runtime = .none, -renderer: renderer.Impl = .opengl, +renderer: rendererpkg.Impl = .opengl, font_backend: font.Backend = .freetype, /// Feature flags @@ -69,7 +69,9 @@ pub fn init(b: *std.Build) !Config { // If we're building for macOS and we're on macOS, we need to // use a generic target to workaround compilation issues. - if (result.result.os.tag == .macos and builtin.target.isDarwin()) { + if (result.result.os.tag == .macos and + builtin.target.os.tag.isDarwin()) + { result = genericMacOSTarget(b, null); } @@ -122,10 +124,10 @@ pub fn init(b: *std.Build) !Config { ) orelse apprt.Runtime.default(target.result); config.renderer = b.option( - renderer.Impl, + rendererpkg.Impl, "renderer", "The app runtime to use. Not all values supported on all platforms.", - ) orelse renderer.Impl.default(target.result, wasm_target); + ) orelse rendererpkg.Impl.default(target.result, wasm_target); //--------------------------------------------------------------- // Feature Flags @@ -331,7 +333,7 @@ pub fn init(b: *std.Build) !Config { bool, "emit-xcframework", "Build and install the xcframework for the macOS library.", - ) orelse builtin.target.isDarwin() and + ) orelse builtin.target.os.tag.isDarwin() and target.result.os.tag == .macos and config.app_runtime == .none and (!config.emit_bench and @@ -366,7 +368,7 @@ pub fn init(b: *std.Build) !Config { .{ // If we're not on darwin we want to use whatever the // default is via the system package mode - .default = if (target.result.isDarwin()) false else null, + .default = if (target.result.os.tag.isDarwin()) false else null, }, ); } @@ -395,7 +397,7 @@ pub fn addOptions(self: *const Config, step: *std.Build.Step.Options) !void { step.addOption(bool, "sentry", self.sentry); step.addOption(apprt.Runtime, "app_runtime", self.app_runtime); step.addOption(font.Backend, "font_backend", self.font_backend); - step.addOption(renderer.Impl, "renderer", self.renderer); + step.addOption(rendererpkg.Impl, "renderer", self.renderer); step.addOption(ExeEntrypoint, "exe_entrypoint", self.exe_entrypoint); step.addOption(WasmTarget, "wasm_target", self.wasm_target); step.addOption(bool, "wasm_shared", self.wasm_shared); @@ -436,7 +438,7 @@ pub fn fromOptions() Config { .flatpak = options.flatpak, .app_runtime = std.meta.stringToEnum(apprt.Runtime, @tagName(options.app_runtime)).?, .font_backend = std.meta.stringToEnum(font.Backend, @tagName(options.font_backend)).?, - .renderer = std.meta.stringToEnum(renderer.Impl, @tagName(options.renderer)).?, + .renderer = std.meta.stringToEnum(rendererpkg.Impl, @tagName(options.renderer)).?, .exe_entrypoint = std.meta.stringToEnum(ExeEntrypoint, @tagName(options.exe_entrypoint)).?, .wasm_target = std.meta.stringToEnum(WasmTarget, @tagName(options.wasm_target)).?, .wasm_shared = options.wasm_shared, diff --git a/src/build/GhosttyDocs.zig b/src/build/GhosttyDocs.zig index 28cbea2c9..d6ebe30eb 100644 --- a/src/build/GhosttyDocs.zig +++ b/src/build/GhosttyDocs.zig @@ -27,7 +27,7 @@ pub fn init( const generate_markdown = b.addExecutable(.{ .name = "mdgen_" ++ manpage.name ++ "_" ++ manpage.section, .root_source_file = b.path("src/main.zig"), - .target = b.host, + .target = b.graph.host, }); deps.help_strings.addImport(generate_markdown); diff --git a/src/build/GhosttyExe.zig b/src/build/GhosttyExe.zig index ef5303baa..e251e7b45 100644 --- a/src/build/GhosttyExe.zig +++ b/src/build/GhosttyExe.zig @@ -99,7 +99,7 @@ fn checkNixShell(exe: *std.Build.Step.Compile, cfg: *const Config) !void { \\ \\ nix develop -c zig build \\ - ++ + ++ "\x1b[0m", .{}, ); diff --git a/src/build/GhosttyFrameData.zig b/src/build/GhosttyFrameData.zig index 7c22115b3..b07e7333f 100644 --- a/src/build/GhosttyFrameData.zig +++ b/src/build/GhosttyFrameData.zig @@ -16,7 +16,7 @@ pub fn init(b: *std.Build) !GhosttyFrameData { const exe = b.addExecutable(.{ .name = "framegen", .root_source_file = b.path("src/build/framegen/main.zig"), - .target = b.host, + .target = b.graph.host, }); const run = b.addRunArtifact(exe); diff --git a/src/build/GhosttyI18n.zig b/src/build/GhosttyI18n.zig index 56848fdc3..daf523938 100644 --- a/src/build/GhosttyI18n.zig +++ b/src/build/GhosttyI18n.zig @@ -97,8 +97,8 @@ fn createUpdateStep(b: *std.Build) !*std.Build.Step { } } - const wf = b.addWriteFiles(); - wf.addCopyFileToSource( + const usf = b.addUpdateSourceFiles(); + usf.addCopyFileToSource( xgettext.captureStdOut(), "po/" ++ domain ++ ".pot", ); @@ -107,8 +107,8 @@ fn createUpdateStep(b: *std.Build) !*std.Build.Step { const msgmerge = b.addSystemCommand(&.{ "msgmerge", "-q" }); msgmerge.addFileArg(b.path("po/" ++ locale ++ ".po")); msgmerge.addFileArg(xgettext.captureStdOut()); - wf.addCopyFileToSource(msgmerge.captureStdOut(), "po/" ++ locale ++ ".po"); + usf.addCopyFileToSource(msgmerge.captureStdOut(), "po/" ++ locale ++ ".po"); } - return &wf.step; + return &usf.step; } diff --git a/src/build/GhosttyLib.zig b/src/build/GhosttyLib.zig index 53aee0e24..4e36c57c8 100644 --- a/src/build/GhosttyLib.zig +++ b/src/build/GhosttyLib.zig @@ -22,15 +22,19 @@ pub fn initStatic( .target = deps.config.target, .optimize = deps.config.optimize, }); - lib.bundle_compiler_rt = true; lib.linkLibC(); + // These must be bundled since we're compiling into a static lib. + // Otherwise, you get undefined symbol errors. + lib.bundle_compiler_rt = true; + lib.bundle_ubsan_rt = true; + // Add our dependencies. Get the list of all static deps so we can // build a combined archive if necessary. var lib_list = try deps.add(lib); try lib_list.append(lib.getEmittedBin()); - if (!deps.config.target.result.isDarwin()) return .{ + if (!deps.config.target.result.os.tag.isDarwin()) return .{ .step = &lib.step, .output = lib.getEmittedBin(), }; diff --git a/src/build/GhosttyWebdata.zig b/src/build/GhosttyWebdata.zig index 860feb705..fef08434f 100644 --- a/src/build/GhosttyWebdata.zig +++ b/src/build/GhosttyWebdata.zig @@ -19,7 +19,7 @@ pub fn init( const webgen_config = b.addExecutable(.{ .name = "webgen_config", .root_source_file = b.path("src/main.zig"), - .target = b.host, + .target = b.graph.host, }); deps.help_strings.addImport(webgen_config); @@ -48,7 +48,7 @@ pub fn init( const webgen_actions = b.addExecutable(.{ .name = "webgen_actions", .root_source_file = b.path("src/main.zig"), - .target = b.host, + .target = b.graph.host, }); deps.help_strings.addImport(webgen_actions); @@ -77,7 +77,7 @@ pub fn init( const webgen_commands = b.addExecutable(.{ .name = "webgen_commands", .root_source_file = b.path("src/main.zig"), - .target = b.host, + .target = b.graph.host, }); deps.help_strings.addImport(webgen_commands); diff --git a/src/build/GhosttyXCFramework.zig b/src/build/GhosttyXCFramework.zig index 38bc2c43f..0dc4f5762 100644 --- a/src/build/GhosttyXCFramework.zig +++ b/src/build/GhosttyXCFramework.zig @@ -32,6 +32,13 @@ pub fn init(b: *std.Build, deps: *const SharedDeps) !GhosttyXCFramework { .os_tag = .ios, .os_version_min = Config.osVersionMin(.ios), .abi = .simulator, + + // We force the Apple CPU model because the simulator + // doesn't support the generic CPU model as of Zig 0.14 due + // to missing "altnzcv" instructions, which is false. This + // surely can't be right but we can fix this if/when we get + // back to running simulator builds. + .cpu_model = .{ .explicit = &std.Target.aarch64.cpu.apple_a17 }, }), )); diff --git a/src/build/HelpStrings.zig b/src/build/HelpStrings.zig index 0244670cc..d088e6c3e 100644 --- a/src/build/HelpStrings.zig +++ b/src/build/HelpStrings.zig @@ -13,7 +13,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !HelpStrings { const exe = b.addExecutable(.{ .name = "helpgen", .root_source_file = b.path("src/helpgen.zig"), - .target = b.host, + .target = b.graph.host, }); const help_config = config: { diff --git a/src/build/SharedDeps.zig b/src/build/SharedDeps.zig index a1a385872..ae9f09afe 100644 --- a/src/build/SharedDeps.zig +++ b/src/build/SharedDeps.zig @@ -277,7 +277,10 @@ pub fn add( // on x86_64. if (step.rootModuleTarget().os.tag == .linux) { const triple = try step.rootModuleTarget().linuxTriple(b.allocator); - step.addLibraryPath(.{ .cwd_relative = b.fmt("/usr/lib/{s}", .{triple}) }); + const path = b.fmt("/usr/lib/{s}", .{triple}); + if (std.fs.accessAbsolute(path, .{})) { + step.addLibraryPath(.{ .cwd_relative = path }); + } else |_| {} } // C files @@ -320,8 +323,8 @@ pub fn add( // We always require the system SDK so that our system headers are available. // This makes things like `os/log.h` available for cross-compiling. - if (step.rootModuleTarget().isDarwin()) { - try @import("apple_sdk").addPaths(b, &step.root_module); + if (step.rootModuleTarget().os.tag.isDarwin()) { + try @import("apple_sdk").addPaths(b, step.root_module); const metallib = self.metallib.?; metallib.output.addStepDependencies(&step.step); @@ -363,7 +366,7 @@ pub fn add( }).module("zf")); // Mac Stuff - if (step.rootModuleTarget().isDarwin()) { + if (step.rootModuleTarget().os.tag.isDarwin()) { const objc_dep = b.dependency("zig_objc", .{ .target = target, .optimize = optimize, @@ -470,7 +473,7 @@ pub fn add( } if (self.config.wayland) { - const scanner = Scanner.create(b.dependency("zig_wayland", .{}), .{ + const scanner = Scanner.create(b.dependency("zig_wayland", .{}).builder, .{ .wayland_xml = b.dependency("wayland", .{}).path("protocol/wayland.xml"), .wayland_protocols = b.dependency("wayland_protocols", .{}).path(""), }); @@ -523,7 +526,7 @@ pub fn add( const generate_gresource_xml = b.addExecutable(.{ .name = "generate_gresource_xml", .root_source_file = b.path("src/apprt/gtk/gresource.zig"), - .target = b.host, + .target = b.graph.host, }); const generate = b.addRunArtifact(generate_gresource_xml); @@ -531,7 +534,7 @@ pub fn add( const gtk_blueprint_compiler = b.addExecutable(.{ .name = "gtk_blueprint_compiler", .root_source_file = b.path("src/apprt/gtk/blueprint_compiler.zig"), - .target = b.host, + .target = b.graph.host, }); gtk_blueprint_compiler.linkSystemLibrary2("gtk4", dynamic_link_opts); gtk_blueprint_compiler.linkSystemLibrary2("libadwaita-1", dynamic_link_opts); @@ -569,7 +572,7 @@ pub fn add( const gtk_builder_check = b.addExecutable(.{ .name = "gtk_builder_check", .root_source_file = b.path("src/apprt/gtk/builder_check.zig"), - .target = b.host, + .target = b.graph.host, }); gtk_builder_check.root_module.addOptions("build_options", self.options); gtk_builder_check.root_module.addImport("gtk", gobject.module("gtk4")); @@ -593,7 +596,6 @@ pub fn add( }); const ghostty_resources_c = generate_resources_c.addOutputFileArg("ghostty_resources.c"); generate_resources_c.addFileArg(gresource_xml); - generate_resources_c.extra_file_dependencies = &gresource.dependencies; step.addCSourceFile(.{ .file = ghostty_resources_c, .flags = &.{} }); const generate_resources_h = b.addSystemCommand(&.{ @@ -605,7 +607,6 @@ pub fn add( }); const ghostty_resources_h = generate_resources_h.addOutputFileArg("ghostty_resources.h"); generate_resources_h.addFileArg(gresource_xml); - generate_resources_h.extra_file_dependencies = &gresource.dependencies; step.addIncludePath(ghostty_resources_h.dirname()); } }, diff --git a/src/build/UnicodeTables.zig b/src/build/UnicodeTables.zig index 7a4b0a5a2..d50ec3099 100644 --- a/src/build/UnicodeTables.zig +++ b/src/build/UnicodeTables.zig @@ -13,11 +13,11 @@ pub fn init(b: *std.Build) !UnicodeTables { const exe = b.addExecutable(.{ .name = "unigen", .root_source_file = b.path("src/unicode/props.zig"), - .target = b.host, + .target = b.graph.host, }); const ziglyph_dep = b.dependency("ziglyph", .{ - .target = b.host, + .target = b.graph.host, }); exe.root_module.addImport("ziglyph", ziglyph_dep.module("ziglyph")); diff --git a/src/build/bash_completions.zig b/src/build/bash_completions.zig index 86c2dc3cf..ad62ff97d 100644 --- a/src/build/bash_completions.zig +++ b/src/build/bash_completions.zig @@ -88,7 +88,7 @@ fn writeBashCompletions(writer: anytype) !void { \\ ); - for (@typeInfo(Config).Struct.fields) |field| { + for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; switch (field.type) { bool, ?bool => try writer.writeAll(pad2 ++ "config+=\" '--" ++ field.name ++ " '\"\n"), @@ -102,7 +102,7 @@ fn writeBashCompletions(writer: anytype) !void { \\ ); - for (@typeInfo(Config).Struct.fields) |field| { + for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; try writer.writeAll(pad3 ++ "--" ++ field.name ++ ") "); @@ -118,8 +118,8 @@ fn writeBashCompletions(writer: anytype) !void { const compgenPrefix = "mapfile -t COMPREPLY < <( compgen -W \""; const compgenSuffix = "\" -- \"$cur\" ); _add_spaces ;;"; switch (@typeInfo(field.type)) { - .Bool => try writer.writeAll("return ;;"), - .Enum => |info| { + .bool => try writer.writeAll("return ;;"), + .@"enum" => |info| { try writer.writeAll(compgenPrefix); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); @@ -127,7 +127,7 @@ fn writeBashCompletions(writer: anytype) !void { } try writer.writeAll(compgenSuffix); }, - .Struct => |info| { + .@"struct" => |info| { if (!@hasDecl(field.type, "parseCLI") and info.layout == .@"packed") { try writer.writeAll(compgenPrefix); for (info.fields, 0..) |f, i| { @@ -157,13 +157,13 @@ fn writeBashCompletions(writer: anytype) !void { \\ ); - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; const options = @field(Action, field.name).options(); // assumes options will never be created with only <_name> members - if (@typeInfo(options).Struct.fields.len == 0) continue; + if (@typeInfo(options).@"struct".fields.len == 0) continue; var buffer: [field.name.len]u8 = undefined; const bashName: []u8 = buffer[0..field.name.len]; @@ -174,7 +174,7 @@ fn writeBashCompletions(writer: anytype) !void { { var count = 0; - for (@typeInfo(options).Struct.fields) |opt| { + for (@typeInfo(options).@"struct".fields) |opt| { if (opt.name[0] == '_') continue; if (count > 0) try writer.writeAll(" "); switch (opt.type) { @@ -193,12 +193,12 @@ fn writeBashCompletions(writer: anytype) !void { \\ ); - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; const options = @field(Action, field.name).options(); - if (@typeInfo(options).Struct.fields.len == 0) continue; + if (@typeInfo(options).@"struct".fields.len == 0) continue; // bash doesn't allow variable names containing '-' so replace them var buffer: [field.name.len]u8 = undefined; @@ -207,7 +207,7 @@ fn writeBashCompletions(writer: anytype) !void { try writer.writeAll(pad3 ++ "+" ++ field.name ++ ")\n"); try writer.writeAll(pad4 ++ "case $prev in\n"); - for (@typeInfo(options).Struct.fields) |opt| { + for (@typeInfo(options).@"struct".fields) |opt| { if (opt.name[0] == '_') continue; try writer.writeAll(pad5 ++ "--" ++ opt.name ++ ") "); @@ -215,8 +215,8 @@ fn writeBashCompletions(writer: anytype) !void { const compgenPrefix = "mapfile -t COMPREPLY < <( compgen -W \""; const compgenSuffix = "\" -- \"$cur\" ); _add_spaces ;;"; switch (@typeInfo(opt.type)) { - .Bool => try writer.writeAll("return ;;"), - .Enum => |info| { + .bool => try writer.writeAll("return ;;"), + .@"enum" => |info| { try writer.writeAll(compgenPrefix); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); @@ -224,9 +224,9 @@ fn writeBashCompletions(writer: anytype) !void { } try writer.writeAll(compgenSuffix); }, - .Optional => |optional| { + .optional => |optional| { switch (@typeInfo(optional.child)) { - .Enum => |info| { + .@"enum" => |info| { try writer.writeAll(compgenPrefix); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); @@ -271,7 +271,7 @@ fn writeBashCompletions(writer: anytype) !void { \\ ); - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; diff --git a/src/build/docker/debian/Dockerfile b/src/build/docker/debian/Dockerfile index 817e8e28a..9d9cbbf96 100644 --- a/src/build/docker/debian/Dockerfile +++ b/src/build/docker/debian/Dockerfile @@ -28,7 +28,7 @@ RUN . /etc/os-release; if [ $VERSION_ID -le 12 ]; then ln -s libbz2.so /usr/lib/ # Install zig # https://ziglang.org/download/ -ARG ZIG_VERSION="0.13.0" +ARG ZIG_VERSION="0.14.0" RUN wget -q "https://ziglang.org/download/$ZIG_VERSION/zig-linux-$(uname -m)-$ZIG_VERSION.tar.xz" && \ tar -xf "zig-linux-$(uname -m)-$ZIG_VERSION.tar.xz" -C /opt && \ rm zig-linux-* && \ diff --git a/src/build/fish_completions.zig b/src/build/fish_completions.zig index dca119c6f..2b2563ee7 100644 --- a/src/build/fish_completions.zig +++ b/src/build/fish_completions.zig @@ -25,7 +25,7 @@ fn writeFishCompletions(writer: anytype) !void { { try writer.writeAll("set -l commands \""); var count: usize = 0; - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; if (count > 0) try writer.writeAll(" "); @@ -41,7 +41,7 @@ fn writeFishCompletions(writer: anytype) !void { try writer.writeAll("complete -c ghostty -s e -l help -f\n"); try writer.writeAll("complete -c ghostty -n \"not __fish_seen_subcommand_from $commands\" -l version -f\n"); - for (@typeInfo(Config).Struct.fields) |field| { + for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; try writer.writeAll("complete -c ghostty -n \"not __fish_seen_subcommand_from $commands\" -l "); @@ -56,8 +56,8 @@ fn writeFishCompletions(writer: anytype) !void { else { try writer.writeAll(if (field.type != Config.RepeatablePath) " -f" else " -F"); switch (@typeInfo(field.type)) { - .Bool => {}, - .Enum => |info| { + .bool => {}, + .@"enum" => |info| { try writer.writeAll(" -a \""); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); @@ -65,7 +65,7 @@ fn writeFishCompletions(writer: anytype) !void { } try writer.writeAll("\""); }, - .Struct => |info| { + .@"struct" => |info| { if (!@hasDecl(field.type, "parseCLI") and info.layout == .@"packed") { try writer.writeAll(" -a \""); for (info.fields, 0..) |f, i| { @@ -86,7 +86,7 @@ fn writeFishCompletions(writer: anytype) !void { { try writer.writeAll("complete -c ghostty -n \"string match -q -- '+*' (commandline -pt)\" -f -a \""); var count: usize = 0; - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; if (count > 0) try writer.writeAll(" "); @@ -97,12 +97,12 @@ fn writeFishCompletions(writer: anytype) !void { try writer.writeAll("\"\n"); } - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; const options = @field(Action, field.name).options(); - for (@typeInfo(options).Struct.fields) |opt| { + for (@typeInfo(options).@"struct".fields) |opt| { if (opt.name[0] == '_') continue; try writer.writeAll("complete -c ghostty -n \"__fish_seen_subcommand_from +" ++ field.name ++ "\" -l "); try writer.writeAll(opt.name); @@ -114,8 +114,8 @@ fn writeFishCompletions(writer: anytype) !void { } else try writer.writeAll(" -f"); switch (@typeInfo(opt.type)) { - .Bool => {}, - .Enum => |info| { + .bool => {}, + .@"enum" => |info| { try writer.writeAll(" -a \""); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); @@ -123,9 +123,9 @@ fn writeFishCompletions(writer: anytype) !void { } try writer.writeAll("\""); }, - .Optional => |optional| { + .optional => |optional| { switch (@typeInfo(optional.child)) { - .Enum => |info| { + .@"enum" => |info| { try writer.writeAll(" -a \""); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); diff --git a/src/build/mdgen/mdgen.zig b/src/build/mdgen/mdgen.zig index c7e8c8638..aca230aa5 100644 --- a/src/build/mdgen/mdgen.zig +++ b/src/build/mdgen/mdgen.zig @@ -27,7 +27,7 @@ pub fn genConfig(writer: anytype, cli: bool) !void { ); @setEvalBranchQuota(3000); - inline for (@typeInfo(Config).Struct.fields) |field| { + inline for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; try writer.writeAll("**`"); @@ -56,7 +56,7 @@ pub fn genActions(writer: anytype) !void { \\ ); - inline for (@typeInfo(Action).Enum.fields) |field| { + inline for (@typeInfo(Action).@"enum".fields) |field| { const action = std.meta.stringToEnum(Action, field.name).?; switch (action) { @@ -92,9 +92,9 @@ pub fn genKeybindActions(writer: anytype) !void { ); const info = @typeInfo(KeybindAction); - std.debug.assert(info == .Union); + std.debug.assert(info == .@"union"); - inline for (info.Union.fields) |field| { + inline for (info.@"union".fields) |field| { if (field.name[0] == '_') continue; try writer.writeAll("**`"); diff --git a/src/build/webgen/main_commands.zig b/src/build/webgen/main_commands.zig index 6e6b00c5e..add8fc803 100644 --- a/src/build/webgen/main_commands.zig +++ b/src/build/webgen/main_commands.zig @@ -8,7 +8,7 @@ pub fn main() !void { } // Note: as a shortcut for defining inline editOnGithubLinks per cli action the user -// is directed to the folder view on Github. This includes a README pointing them to +// is directed to the folder view on Github. This includes a README pointing them to // the files to edit. pub fn genActions(writer: anytype) !void { // Write the header @@ -24,7 +24,7 @@ pub fn genActions(writer: anytype) !void { \\ ); - inline for (@typeInfo(Action).Enum.fields) |field| { + inline for (@typeInfo(Action).@"enum".fields) |field| { const action = std.meta.stringToEnum(Action, field.name).?; switch (action) { diff --git a/src/build/webgen/main_config.zig b/src/build/webgen/main_config.zig index 6cb55fcd3..1bde2f9cc 100644 --- a/src/build/webgen/main_config.zig +++ b/src/build/webgen/main_config.zig @@ -29,7 +29,7 @@ pub fn genConfig(writer: anytype) !void { ); @setEvalBranchQuota(50_000); - const fields = @typeInfo(Config).Struct.fields; + const fields = @typeInfo(Config).@"struct".fields; inline for (fields, 0..) |field, i| { if (field.name[0] == '_') continue; if (!@hasDecl(help_strings.Config, field.name)) continue; diff --git a/src/build/zsh_completions.zig b/src/build/zsh_completions.zig index 4114abc63..2ded6d73c 100644 --- a/src/build/zsh_completions.zig +++ b/src/build/zsh_completions.zig @@ -45,7 +45,7 @@ fn writeZshCompletions(writer: anytype) !void { try writer.writeAll(" _arguments \\\n"); try writer.writeAll(" \"--help\" \\\n"); try writer.writeAll(" \"--version\" \\\n"); - for (@typeInfo(Config).Struct.fields) |field| { + for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; try writer.writeAll(" \"--"); try writer.writeAll(field.name); @@ -64,8 +64,8 @@ fn writeZshCompletions(writer: anytype) !void { try writer.writeAll("_files"); // todo check if this is needed } else { switch (@typeInfo(field.type)) { - .Bool => {}, - .Enum => |info| { + .bool => {}, + .@"enum" => |info| { try writer.writeAll(equals_required); try writer.writeAll("("); for (info.fields, 0..) |f, i| { @@ -74,7 +74,7 @@ fn writeZshCompletions(writer: anytype) !void { } try writer.writeAll(")"); }, - .Struct => |info| { + .@"struct" => |info| { try writer.writeAll(equals_required); if (!@hasDecl(field.type, "parseCLI") and info.layout == .@"packed") { try writer.writeAll("("); @@ -138,7 +138,7 @@ fn writeZshCompletions(writer: anytype) !void { // how to get 'commands' var count: usize = 0; const padding = " "; - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; @@ -167,25 +167,25 @@ fn writeZshCompletions(writer: anytype) !void { ); { const padding = " "; - for (@typeInfo(Action).Enum.fields) |field| { + for (@typeInfo(Action).@"enum".fields) |field| { if (std.mem.eql(u8, "help", field.name)) continue; if (std.mem.eql(u8, "version", field.name)) continue; const options = @field(Action, field.name).options(); // assumes options will never be created with only <_name> members - if (@typeInfo(options).Struct.fields.len == 0) continue; + if (@typeInfo(options).@"struct".fields.len == 0) continue; try writer.writeAll(padding ++ "(+" ++ field.name ++ ")\n"); try writer.writeAll(padding ++ " _arguments \\\n"); - for (@typeInfo(options).Struct.fields) |opt| { + for (@typeInfo(options).@"struct".fields) |opt| { if (opt.name[0] == '_') continue; try writer.writeAll(padding ++ " '--"); try writer.writeAll(opt.name); switch (@typeInfo(opt.type)) { - .Bool => {}, - .Enum => |info| { + .bool => {}, + .@"enum" => |info| { try writer.writeAll(equals_required); try writer.writeAll("("); for (info.fields, 0..) |f, i| { @@ -194,10 +194,10 @@ fn writeZshCompletions(writer: anytype) !void { } try writer.writeAll(")"); }, - .Optional => |optional| { + .optional => |optional| { try writer.writeAll(equals_required); switch (@typeInfo(optional.child)) { - .Enum => |info| { + .@"enum" => |info| { try writer.writeAll("("); for (info.fields, 0..) |f, i| { if (i > 0) try writer.writeAll(" "); diff --git a/src/build_config.zig b/src/build_config.zig index b80247aab..31418a14e 100644 --- a/src/build_config.zig +++ b/src/build_config.zig @@ -80,7 +80,7 @@ pub const Artifact = enum { wasm_module, pub fn detect() Artifact { - if (builtin.target.isWasm()) { + if (builtin.target.cpu.arch.isWasm()) { assert(builtin.output_mode == .Obj); assert(builtin.link_mode == .Static); return .wasm_module; diff --git a/src/cli/action.zig b/src/cli/action.zig index f3da2e2ef..a53e55ef8 100644 --- a/src/cli/action.zig +++ b/src/cli/action.zig @@ -119,7 +119,7 @@ pub const Action = enum { // If help is requested, then we use some comptime trickery // to find this action in the help strings and output that. help_error => err: { - inline for (@typeInfo(Action).Enum.fields) |field| { + inline for (@typeInfo(Action).@"enum".fields) |field| { // Future note: for now we just output the help text directly // to stdout. In the future we can style this much prettier // for all commands by just changing this one place. diff --git a/src/cli/args.zig b/src/cli/args.zig index 5ff7de2d4..4860cdd74 100644 --- a/src/cli/args.zig +++ b/src/cli/args.zig @@ -55,7 +55,7 @@ pub fn parse( iter: anytype, ) !void { const info = @typeInfo(T); - assert(info == .Struct); + assert(info == .@"struct"); comptime { // Verify all renamed fields are valid (source does not exist, @@ -208,10 +208,10 @@ fn formatInvalidValue( fn formatValues(comptime T: type, key: []const u8, writer: anytype) std.mem.Allocator.Error!void { const typeinfo = @typeInfo(T); - inline for (typeinfo.Struct.fields) |f| { + inline for (typeinfo.@"struct".fields) |f| { if (std.mem.eql(u8, key, f.name)) { switch (@typeInfo(f.type)) { - .Enum => |e| { + .@"enum" => |e| { try writer.print(", valid values are: ", .{}); inline for (e.fields, 0..) |field, i| { if (i != 0) try writer.print(", ", .{}); @@ -243,19 +243,21 @@ pub fn parseIntoField( value: ?[]const u8, ) !void { const info = @typeInfo(T); - assert(info == .Struct); + assert(info == .@"struct"); - inline for (info.Struct.fields) |field| { + inline for (info.@"struct".fields) |field| { if (field.name[0] != '_' and mem.eql(u8, field.name, key)) { // For optional fields, we just treat it as the child type. // This lets optional fields default to null but get set by // the CLI. const Field = switch (@typeInfo(field.type)) { - .Optional => |opt| opt.child, + .optional => |opt| opt.child, else => field.type, }; const fieldInfo = @typeInfo(Field); - const canHaveDecls = fieldInfo == .Struct or fieldInfo == .Union or fieldInfo == .Enum; + const canHaveDecls = fieldInfo == .@"struct" or + fieldInfo == .@"union" or + fieldInfo == .@"enum"; // If the value is empty string (set but empty string), // then we reset the value to the default. @@ -266,7 +268,7 @@ pub fn parseIntoField( try @field(dst, field.name).init(alloc); return; } - const raw = field.default_value orelse break :default; + const raw = field.default_value_ptr orelse break :default; const ptr: *const field.type = @alignCast(@ptrCast(raw)); @field(dst, field.name) = ptr.*; return; @@ -276,22 +278,22 @@ pub fn parseIntoField( // we call that and use that to set the value. if (canHaveDecls) { if (@hasDecl(Field, "parseCLI")) { - const fnInfo = @typeInfo(@TypeOf(Field.parseCLI)).Fn; + const fnInfo = @typeInfo(@TypeOf(Field.parseCLI)).@"fn"; switch (fnInfo.params.len) { // 1 arg = (input) => output 1 => @field(dst, field.name) = try Field.parseCLI(value), // 2 arg = (self, input) => void 2 => switch (@typeInfo(field.type)) { - .Struct, - .Union, - .Enum, + .@"struct", + .@"union", + .@"enum", => try @field(dst, field.name).parseCLI(value), // If the field is optional and set, then we use // the pointer value directly into it. If its not // set we need to create a new instance. - .Optional => if (@field(dst, field.name)) |*v| { + .optional => if (@field(dst, field.name)) |*v| { try v.parseCLI(value); } else { // Note: you cannot do @field(dst, name) = undefined @@ -307,12 +309,12 @@ pub fn parseIntoField( // 3 arg = (self, alloc, input) => void 3 => switch (@typeInfo(field.type)) { - .Struct, - .Union, - .Enum, + .@"struct", + .@"union", + .@"enum", => try @field(dst, field.name).parseCLI(alloc, value), - .Optional => if (@field(dst, field.name)) |*v| { + .optional => if (@field(dst, field.name)) |*v| { try v.parseCLI(alloc, value); } else { var tmp: Field = undefined; @@ -374,18 +376,18 @@ pub fn parseIntoField( ) catch return error.InvalidValue, else => switch (fieldInfo) { - .Enum => std.meta.stringToEnum( + .@"enum" => std.meta.stringToEnum( Field, value orelse return error.ValueRequired, ) orelse return error.InvalidValue, - .Struct => try parseStruct( + .@"struct" => try parseStruct( Field, alloc, value orelse return error.ValueRequired, ), - .Union => try parseTaggedUnion( + .@"union" => try parseTaggedUnion( Field, alloc, value orelse return error.ValueRequired, @@ -413,8 +415,8 @@ pub fn parseIntoField( } fn parseTaggedUnion(comptime T: type, alloc: Allocator, v: []const u8) !T { - const info = @typeInfo(T).Union; - assert(@typeInfo(info.tag_type.?) == .Enum); + const info = @typeInfo(T).@"union"; + assert(@typeInfo(info.tag_type.?) == .@"enum"); // Get the union tag that is being set. We support values with no colon // if the value is void so its not an error to have no colon. @@ -433,12 +435,12 @@ fn parseTaggedUnion(comptime T: type, alloc: Allocator, v: []const u8) !T { // We need to create a struct that looks like this union field. // This lets us use parseIntoField as if its a dedicated struct. - const Target = @Type(.{ .Struct = .{ + const Target = @Type(.{ .@"struct" = .{ .layout = .auto, .fields = &.{.{ .name = field.name, .type = field.type, - .default_value = null, + .default_value_ptr = null, .is_comptime = false, .alignment = @alignOf(field.type), }}, @@ -459,7 +461,7 @@ fn parseTaggedUnion(comptime T: type, alloc: Allocator, v: []const u8) !T { } fn parseStruct(comptime T: type, alloc: Allocator, v: []const u8) !T { - return switch (@typeInfo(T).Struct.layout) { + return switch (@typeInfo(T).@"struct".layout) { .auto => parseAutoStruct(T, alloc, v), .@"packed" => parsePackedStruct(T, v), else => @compileError("unsupported struct layout"), @@ -467,7 +469,7 @@ fn parseStruct(comptime T: type, alloc: Allocator, v: []const u8) !T { } pub fn parseAutoStruct(comptime T: type, alloc: Allocator, v: []const u8) !T { - const info = @typeInfo(T).Struct; + const info = @typeInfo(T).@"struct"; comptime assert(info.layout == .auto); // We start our result as undefined so we don't get an error for required @@ -519,7 +521,7 @@ pub fn parseAutoStruct(comptime T: type, alloc: Allocator, v: []const u8) !T { // Ensure all required fields are set inline for (info.fields, 0..) |field, i| { if (!fields_set.isSet(i)) { - const default_ptr = field.default_value orelse return error.InvalidValue; + const default_ptr = field.default_value_ptr orelse return error.InvalidValue; const typed_ptr: *const field.type = @alignCast(@ptrCast(default_ptr)); @field(result, field.name) = typed_ptr.*; } @@ -529,7 +531,7 @@ pub fn parseAutoStruct(comptime T: type, alloc: Allocator, v: []const u8) !T { } fn parsePackedStruct(comptime T: type, v: []const u8) !T { - const info = @typeInfo(T).Struct; + const info = @typeInfo(T).@"struct"; comptime assert(info.layout == .@"packed"); var result: T = .{}; diff --git a/src/cli/diagnostics.zig b/src/cli/diagnostics.zig index 40fed3001..2c6cb3b30 100644 --- a/src/cli/diagnostics.zig +++ b/src/cli/diagnostics.zig @@ -54,14 +54,14 @@ pub const Location = union(enum) { line: usize, }, - pub const Key = @typeInfo(Location).Union.tag_type.?; + pub const Key = @typeInfo(Location).@"union".tag_type.?; pub fn fromIter(iter: anytype, alloc: Allocator) Allocator.Error!Location { const Iter = t: { const T = @TypeOf(iter); break :t switch (@typeInfo(T)) { - .Pointer => |v| v.child, - .Struct => T, + .pointer => |v| v.child, + .@"struct" => T, else => return .none, }; }; diff --git a/src/cli/help.zig b/src/cli/help.zig index 22fe27d8d..32cdfa303 100644 --- a/src/cli/help.zig +++ b/src/cli/help.zig @@ -58,7 +58,7 @@ pub fn run(alloc: Allocator) !u8 { \\ ); - inline for (@typeInfo(Action).Enum.fields) |field| { + inline for (@typeInfo(Action).@"enum".fields) |field| { try stdout.print(" +{s}\n", .{field.name}); } diff --git a/src/cli/show_face.zig b/src/cli/show_face.zig index 8b460a623..b7f039dc8 100644 --- a/src/cli/show_face.zig +++ b/src/cli/show_face.zig @@ -101,7 +101,7 @@ fn runArgs(alloc_gpa: Allocator, argsIter: anytype) !u8 { var exit: bool = false; outer: for (opts._diagnostics.items()) |diagnostic| { if (diagnostic.location != .cli) continue :outer; - inner: inline for (@typeInfo(Options).Struct.fields) |field| { + inner: inline for (@typeInfo(Options).@"struct".fields) |field| { if (field.name[0] == '_') continue :inner; if (std.mem.eql(u8, field.name, diagnostic.key)) { try stderr.writeAll("config error: "); @@ -134,7 +134,7 @@ fn runArgs(alloc_gpa: Allocator, argsIter: anytype) !u8 { // action-specific argument. if (!config._diagnostics.empty()) { outer: for (config._diagnostics.items()) |diagnostic| { - inner: inline for (@typeInfo(Options).Struct.fields) |field| { + inner: inline for (@typeInfo(Options).@"struct".fields) |field| { if (field.name[0] == '_') continue :inner; if (std.mem.eql(u8, field.name, diagnostic.key) and (diagnostic.location == .none or diagnostic.location == .cli)) continue :outer; } diff --git a/src/config.zig b/src/config.zig index a8ffe2ec7..a06e19872 100644 --- a/src/config.zig +++ b/src/config.zig @@ -34,7 +34,7 @@ pub const WindowPaddingColor = Config.WindowPaddingColor; // Alternate APIs pub const CAPI = @import("config/CAPI.zig"); -pub const Wasm = if (!builtin.target.isWasm()) struct {} else @import("config/Wasm.zig"); +pub const Wasm = if (!builtin.target.cpu.arch.isWasm()) struct {} else @import("config/Wasm.zig"); test { @import("std").testing.refAllDecls(@This()); diff --git a/src/config/Config.zig b/src/config/Config.zig index 1790d8b38..481e02a79 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -2801,7 +2801,7 @@ pub fn changeConditionalState( // If the conditional state between the old and new is the same, // then we don't need to do anything. relevant: { - inline for (@typeInfo(conditional.Key).Enum.fields) |field| { + inline for (@typeInfo(conditional.Key).@"enum".fields) |field| { const key: conditional.Key = @field(conditional.Key, field.name); // Conditional set contains the keys that this config uses. So we @@ -2849,7 +2849,7 @@ fn expandPaths(self: *Config, base: []const u8) !void { ); // Expand all of our paths - inline for (@typeInfo(Config).Struct.fields) |field| { + inline for (@typeInfo(Config).@"struct".fields) |field| { switch (field.type) { RepeatablePath, Path => { try @field(self, field.name).expand( @@ -3023,7 +3023,7 @@ pub fn finalize(self: *Config) !void { // to look up defaults which is kind of expensive. We only do this // on desktop. const wd_home = std.mem.eql(u8, "home", wd); - if ((comptime !builtin.target.isWasm()) and + if ((comptime !builtin.target.cpu.arch.isWasm()) and (comptime !builtin.is_test)) { if (self.command == null or wd_home) command: { @@ -3239,7 +3239,7 @@ pub fn clone( const alloc_arena = result._arena.?.allocator(); // Copy our values - inline for (@typeInfo(Config).Struct.fields) |field| { + inline for (@typeInfo(Config).@"struct".fields) |field| { if (!@hasField(Key, field.name)) continue; @field(result, field.name) = try cloneValue( alloc_arena, @@ -3286,26 +3286,26 @@ fn cloneValue( // If we're a type that can have decls and we have clone, then // call clone and be done. const t = @typeInfo(T); - if (t == .Struct or t == .Enum or t == .Union) { + if (t == .@"struct" or t == .@"enum" or t == .@"union") { if (@hasDecl(T, "clone")) return try src.clone(alloc); } // Back into types of types switch (t) { - inline .Bool, - .Int, - .Float, - .Enum, - .Union, + inline .bool, + .int, + .float, + .@"enum", + .@"union", => return src, - .Optional => |info| return try cloneValue( + .optional => |info| return try cloneValue( alloc, info.child, src orelse return null, ), - .Struct => |info| { + .@"struct" => |info| { // Packed structs we can return directly as copies. assert(info.layout == .@"packed"); return src; @@ -3390,21 +3390,21 @@ fn equalField(comptime T: type, old: T, new: T) bool { // Back into types of types switch (@typeInfo(T)) { - .Void => return true, + .void => return true, - inline .Bool, - .Int, - .Float, - .Enum, + inline .bool, + .int, + .float, + .@"enum", => return old == new, - .Optional => |info| { + .optional => |info| { if (old == null and new == null) return true; if (old == null or new == null) return false; return equalField(info.child, old.?, new.?); }, - .Struct => |info| { + .@"struct" => |info| { if (@hasDecl(T, "equal")) return old.equal(new); // If a struct doesn't declare an "equal" function, we fall back @@ -3419,7 +3419,7 @@ fn equalField(comptime T: type, old: T, new: T) bool { return true; }, - .Union => |info| { + .@"union" => |info| { const tag_type = info.tag_type.?; const old_tag = std.meta.activeTag(old); const new_tag = std.meta.activeTag(new); @@ -4293,7 +4293,7 @@ pub const Keybinds = struct { // The order of these blocks is important. The *last* added keybind for a given action is // what will display in the menu. We want the more typical keybinds after this block to be // the standard - if (!builtin.target.isDarwin()) { + if (!builtin.target.os.tag.isDarwin()) { try self.set.put( alloc, .{ .key = .{ .translated = .insert }, .mods = .{ .ctrl = true } }, @@ -4308,7 +4308,7 @@ pub const Keybinds = struct { // On macOS we default to super but Linux ctrl+shift since // ctrl+c is to kill the process. - const mods: inputpkg.Mods = if (builtin.target.isDarwin()) + const mods: inputpkg.Mods = if (builtin.target.os.tag.isDarwin()) .{ .super = true } else .{ .ctrl = true, .shift = true }; @@ -4426,7 +4426,7 @@ pub const Keybinds = struct { ); // Windowing - if (comptime !builtin.target.isDarwin()) { + if (comptime !builtin.target.os.tag.isDarwin()) { try self.set.put( alloc, .{ .key = .{ .translated = .n }, .mods = .{ .ctrl = true, .shift = true } }, @@ -4603,7 +4603,7 @@ pub const Keybinds = struct { { // On macOS we default to super but everywhere else // is alt. - const mods: inputpkg.Mods = if (builtin.target.isDarwin()) + const mods: inputpkg.Mods = if (builtin.target.os.tag.isDarwin()) .{ .super = true } else .{ .alt = true }; @@ -4621,7 +4621,7 @@ pub const Keybinds = struct { // want to be true on other platforms as well but this // is definitely true on macOS so we just do it here for // now (#817) - .key = if (comptime builtin.target.isDarwin()) + .key = if (comptime builtin.target.os.tag.isDarwin()) .{ .physical = @enumFromInt(i) } else .{ .translated = @enumFromInt(i) }, @@ -4634,7 +4634,7 @@ pub const Keybinds = struct { try self.set.put( alloc, .{ - .key = if (comptime builtin.target.isDarwin()) + .key = if (comptime builtin.target.os.tag.isDarwin()) .{ .physical = .nine } else .{ .translated = .nine }, @@ -4659,7 +4659,7 @@ pub const Keybinds = struct { ); // Mac-specific keyboard bindings. - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { try self.set.put( alloc, .{ .key = .{ .translated = .q }, .mods = .{ .super = true } }, @@ -4995,7 +4995,7 @@ pub const Keybinds = struct { if (docs) { try formatter.writer.writeAll("\n"); const name = @tagName(v); - inline for (@typeInfo(help_strings.KeybindAction).Struct.decls) |decl| { + inline for (@typeInfo(help_strings.KeybindAction).@"struct".decls) |decl| { if (std.mem.eql(u8, decl.name, name)) { const help = @field(help_strings.KeybindAction, decl.name); try formatter.writer.writeAll("# " ++ decl.name ++ "\n"); diff --git a/src/config/c_get.zig b/src/config/c_get.zig index 251a95e77..f235f596a 100644 --- a/src/config/c_get.zig +++ b/src/config/c_get.zig @@ -53,21 +53,21 @@ fn getValue(ptr_raw: *anyopaque, value: anytype) bool { }, else => |T| switch (@typeInfo(T)) { - .Optional => { + .optional => { // If an optional has no value we return false. const unwrapped = value orelse return false; return getValue(ptr_raw, unwrapped); }, - .Enum => { + .@"enum" => { const ptr: *[*:0]const u8 = @ptrCast(@alignCast(ptr_raw)); ptr.* = @tagName(value); }, - .Struct => |info| { + .@"struct" => |info| { // If the struct implements cval then we call then. if (@hasDecl(T, "cval")) { - const PtrT = @typeInfo(@TypeOf(T.cval)).Fn.return_type.?; + const PtrT = @typeInfo(@TypeOf(T.cval)).@"fn".return_type.?; const ptr: *PtrT = @ptrCast(@alignCast(ptr_raw)); ptr.* = value.cval(); return true; @@ -84,9 +84,9 @@ fn getValue(ptr_raw: *anyopaque, value: anytype) bool { ptr.* = @intCast(@as(Backing, @bitCast(value))); }, - .Union => |_| { + .@"union" => |_| { if (@hasDecl(T, "cval")) { - const PtrT = @typeInfo(@TypeOf(T.cval)).Fn.return_type.?; + const PtrT = @typeInfo(@TypeOf(T.cval)).@"fn".return_type.?; const ptr: *PtrT = @ptrCast(@alignCast(ptr_raw)); ptr.* = value.cval(); return true; diff --git a/src/config/conditional.zig b/src/config/conditional.zig index d46b33399..5d5d204c5 100644 --- a/src/config/conditional.zig +++ b/src/config/conditional.zig @@ -39,14 +39,14 @@ pub const State = struct { /// An enum of the available conditional configuration keys. pub const Key = key: { - const stateInfo = @typeInfo(State).Struct; + const stateInfo = @typeInfo(State).@"struct"; var fields: [stateInfo.fields.len]std.builtin.Type.EnumField = undefined; for (stateInfo.fields, 0..) |field, i| fields[i] = .{ .name = field.name, .value = i, }; - break :key @Type(.{ .Enum = .{ + break :key @Type(.{ .@"enum" = .{ .tag_type = std.math.IntFittingRange(0, fields.len - 1), .fields = &fields, .decls = &.{}, diff --git a/src/config/formatter.zig b/src/config/formatter.zig index aec7ead89..ca3da1d91 100644 --- a/src/config/formatter.zig +++ b/src/config/formatter.zig @@ -42,27 +42,27 @@ pub fn formatEntry( writer: anytype, ) !void { switch (@typeInfo(T)) { - .Bool, .Int => { + .bool, .int => { try writer.print("{s} = {}\n", .{ name, value }); return; }, - .Float => { + .float => { try writer.print("{s} = {d}\n", .{ name, value }); return; }, - .Enum => { + .@"enum" => { try writer.print("{s} = {s}\n", .{ name, @tagName(value) }); return; }, - .Void => { + .void => { try writer.print("{s} = \n", .{name}); return; }, - .Optional => |info| { + .optional => |info| { if (value) |inner| { try formatEntry( info.child, @@ -77,7 +77,7 @@ pub fn formatEntry( return; }, - .Pointer => switch (T) { + .pointer => switch (T) { []const u8, [:0]const u8, => { @@ -93,7 +93,7 @@ pub fn formatEntry( // This is given the formatter in use so that they can // call BACK to our formatEntry to write each primitive // value. - .Struct => |info| if (@hasDecl(T, "formatEntry")) { + .@"struct" => |info| if (@hasDecl(T, "formatEntry")) { try value.formatEntry(entryFormatter(name, writer)); return; } else switch (info.layout) { @@ -114,7 +114,7 @@ pub fn formatEntry( else => {}, }, - .Union => if (@hasDecl(T, "formatEntry")) { + .@"union" => if (@hasDecl(T, "formatEntry")) { try value.formatEntry(entryFormatter(name, writer)); return; }, @@ -158,7 +158,7 @@ pub const FileFormatter = struct { null; defer if (default) |*v| v.deinit(); - inline for (@typeInfo(Config).Struct.fields) |field| { + inline for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; const value = @field(self.config, field.name); diff --git a/src/config/key.zig b/src/config/key.zig index f56376238..5709e2074 100644 --- a/src/config/key.zig +++ b/src/config/key.zig @@ -22,7 +22,7 @@ pub const Key = key: { var decls = [_]std.builtin.Type.Declaration{}; break :key @Type(.{ - .Enum = .{ + .@"enum" = .{ .tag_type = std.math.IntFittingRange(0, field_infos.len - 1), .fields = enumFields[0..i], .decls = &decls, @@ -34,6 +34,8 @@ pub const Key = key: { /// Returns the value type for a key pub fn Value(comptime key: Key) type { const field = comptime field: { + @setEvalBranchQuota(100_000); + const fields = std.meta.fields(Config); for (fields) |field| { if (@field(Key, field.name) == key) { diff --git a/src/config/sublime_syntax.zig b/src/config/sublime_syntax.zig index 18167fee6..dff7d758e 100644 --- a/src/config/sublime_syntax.zig +++ b/src/config/sublime_syntax.zig @@ -36,7 +36,7 @@ fn isInternal(name: []const u8) bool { fn generateKeywords() []const u8 { @setEvalBranchQuota(5000); var keywords: []const u8 = ""; - const config_fields = @typeInfo(Config).Struct.fields; + const config_fields = @typeInfo(Config).@"struct".fields; for (config_fields) |field| { if (isInternal(field.name)) continue; diff --git a/src/config/theme.zig b/src/config/theme.zig index 2d206e1f6..21d6faf08 100644 --- a/src/config/theme.zig +++ b/src/config/theme.zig @@ -76,7 +76,7 @@ pub const LocationIterator = struct { location: Location, dir: []const u8, } { - const max = @typeInfo(Location).Enum.fields.len; + const max = @typeInfo(Location).@"enum".fields.len; while (self.i < max) { const location: Location = @enumFromInt(self.i); self.i += 1; diff --git a/src/config/vim.zig b/src/config/vim.zig index ab487f9f9..6084bd248 100644 --- a/src/config/vim.zig +++ b/src/config/vim.zig @@ -91,7 +91,7 @@ fn writeSyntax(writer: anytype) !void { \\syn keyword ghosttyConfigKeyword ); - const config_fields = @typeInfo(Config).Struct.fields; + const config_fields = @typeInfo(Config).@"struct".fields; inline for (config_fields) |field| { if (field.name[0] == '_') continue; try writer.print("\n\t\\ {s}", .{field.name}); diff --git a/src/crash/minidump/reader.zig b/src/crash/minidump/reader.zig index f792d6670..b7f5efe80 100644 --- a/src/crash/minidump/reader.zig +++ b/src/crash/minidump/reader.zig @@ -46,13 +46,13 @@ pub fn Reader(comptime S: type) type { stream_directory_rva: u32, const SourceCallable = switch (@typeInfo(Source)) { - .Pointer => |v| v.child, - .Struct => Source, + .pointer => |v| v.child, + .@"struct" => Source, else => @compileError("Source type must be a pointer or struct"), }; - const SourceReader = @typeInfo(@TypeOf(SourceCallable.reader)).Fn.return_type.?; - const SourceSeeker = @typeInfo(@TypeOf(SourceCallable.seekableStream)).Fn.return_type.?; + const SourceReader = @typeInfo(@TypeOf(SourceCallable.reader)).@"fn".return_type.?; + const SourceSeeker = @typeInfo(@TypeOf(SourceCallable.seekableStream)).@"fn".return_type.?; /// A limited reader for reading data from the source. pub const LimitedReader = std.io.LimitedReader(SourceReader); diff --git a/src/datastruct/lru.zig b/src/datastruct/lru.zig index f303158e5..7bf42e82d 100644 --- a/src/datastruct/lru.zig +++ b/src/datastruct/lru.zig @@ -34,7 +34,7 @@ pub fn HashMap( return struct { const Self = @This(); const Map = std.HashMapUnmanaged(K, *Queue.Node, Context, max_load_percentage); - const Queue = std.TailQueue(KV); + const Queue = std.DoublyLinkedList(KV); /// Map to maintain our entries. map: Map, diff --git a/src/font/Collection.zig b/src/font/Collection.zig index cb16528aa..cfc633b04 100644 --- a/src/font/Collection.zig +++ b/src/font/Collection.zig @@ -639,11 +639,11 @@ pub const PresentationMode = union(enum) { /// the Backing type and everything should just work fine. pub const Index = packed struct(Index.Backing) { const Backing = u16; - const backing_bits = @typeInfo(Backing).Int.bits; + const backing_bits = @typeInfo(Backing).int.bits; /// The number of bits we use for the index. - const idx_bits = backing_bits - @typeInfo(@typeInfo(Style).Enum.tag_type).Int.bits; - pub const IndexInt = @Type(.{ .Int = .{ .signedness = .unsigned, .bits = idx_bits } }); + const idx_bits = backing_bits - @typeInfo(@typeInfo(Style).@"enum".tag_type).int.bits; + pub const IndexInt = @Type(.{ .int = .{ .signedness = .unsigned, .bits = idx_bits } }); /// The special-case fonts that we support. pub const Special = enum(IndexInt) { diff --git a/src/font/Metrics.zig b/src/font/Metrics.zig index c78ac0972..4c7793bed 100644 --- a/src/font/Metrics.zig +++ b/src/font/Metrics.zig @@ -324,7 +324,7 @@ pub const Modifier = union(enum) { /// Apply a modifier to a numeric value. pub fn apply(self: Modifier, v: anytype) @TypeOf(v) { const T = @TypeOf(v); - const signed = @typeInfo(T).Int.signedness == .signed; + const signed = @typeInfo(T).int.signedness == .signed; return switch (self) { .percent => |p| percent: { const p_clamped: f64 = @max(0, p); @@ -395,7 +395,7 @@ pub const Key = key: { var decls = [_]std.builtin.Type.Declaration{}; break :key @Type(.{ - .Enum = .{ + .@"enum" = .{ .tag_type = std.math.IntFittingRange(0, count - 1), .fields = enumFields[0..count], .decls = &decls, diff --git a/src/font/SharedGridSet.zig b/src/font/SharedGridSet.zig index 249a11f75..ca535eaf8 100644 --- a/src/font/SharedGridSet.zig +++ b/src/font/SharedGridSet.zig @@ -188,7 +188,7 @@ fn collection( // A buffer we use to store the font names for logging. var name_buf: [256]u8 = undefined; - inline for (@typeInfo(Style).Enum.fields) |field| { + inline for (@typeInfo(Style).@"enum".fields) |field| { const style = @field(Style, field.name); for (key.descriptorsForStyle(style)) |desc| { { @@ -297,7 +297,7 @@ fn collection( // people add other emoji fonts to their system, we always want to // prefer the official one. Users can override this by explicitly // specifying a font-family for emoji. - if (comptime builtin.target.isDarwin() and Discover != void) apple_emoji: { + if (comptime builtin.target.os.tag.isDarwin() and Discover != void) apple_emoji: { const disco = try self.discover() orelse break :apple_emoji; var disco_it = try disco.discover(self.alloc, .{ .family = "Apple Color Emoji", @@ -314,7 +314,7 @@ fn collection( // Emoji fallback. We don't include this on Mac since Mac is expected // to always have the Apple Emoji available on the system. - if (comptime !builtin.target.isDarwin() or Discover == void) { + if (comptime !builtin.target.os.tag.isDarwin() or Discover == void) { _ = try c.add( self.alloc, .regular, @@ -672,7 +672,7 @@ pub const Key = struct { autoHash(hasher, self.metric_modifiers.count()); autoHash(hasher, self.freetype_load_flags); if (self.metric_modifiers.count() > 0) { - inline for (@typeInfo(Metrics.Key).Enum.fields) |field| { + inline for (@typeInfo(Metrics.Key).@"enum".fields) |field| { const key = @field(Metrics.Key, field.name); if (self.metric_modifiers.get(key)) |value| { autoHash(hasher, key); diff --git a/src/font/discovery.zig b/src/font/discovery.zig index 071407d92..384799da5 100644 --- a/src/font/discovery.zig +++ b/src/font/discovery.zig @@ -597,7 +597,7 @@ pub const CoreText = struct { /// We represent our sorting score as a packed struct so that we can /// compare scores numerically but build scores symbolically. const Score = packed struct { - const Backing = @typeInfo(@This()).Struct.backing_integer.?; + const Backing = @typeInfo(@This()).@"struct".backing_integer.?; glyph_count: u16 = 0, // clamped if > intmax traits: Traits = .unmatched, diff --git a/src/font/face.zig b/src/font/face.zig index 0102010de..6355578db 100644 --- a/src/font/face.zig +++ b/src/font/face.zig @@ -33,7 +33,7 @@ pub const FreetypeLoadFlags = if (options.backend.hasFreetype()) config.FreetypeLoadFlags else void; -pub const freetype_load_flags_default = if (FreetypeLoadFlags != void) .{} else {}; +pub const freetype_load_flags_default: FreetypeLoadFlags = if (FreetypeLoadFlags != void) .{} else {}; /// Options for initializing a font face. pub const Options = struct { diff --git a/src/font/main.zig b/src/font/main.zig index ffeb42f7a..627fc6341 100644 --- a/src/font/main.zig +++ b/src/font/main.zig @@ -30,7 +30,7 @@ pub const Library = library.Library; // If we're targeting wasm then we export some wasm APIs. comptime { - if (builtin.target.isWasm()) { + if (builtin.target.cpu.arch.isWasm()) { _ = Atlas.Wasm; _ = DeferredFace.Wasm; _ = face.web_canvas.Wasm; @@ -45,7 +45,7 @@ pub const options: struct { // TODO: we need to modify the build config for wasm builds. the issue // is we're sharing the build config options between all exes in build.zig. // We need to construct it per target. - .backend = if (builtin.target.isWasm()) .web_canvas else build_config.font_backend, + .backend = if (builtin.target.cpu.arch.isWasm()) .web_canvas else build_config.font_backend, }; pub const Backend = enum { @@ -91,7 +91,7 @@ pub const Backend = enum { // macOS also supports "coretext_freetype" but there is no scenario // that is the default. It is only used by people who want to // self-compile Ghostty and prefer the freetype aesthetic. - return if (target.isDarwin()) .coretext else .fontconfig_freetype; + return if (target.os.tag.isDarwin()) .coretext else .fontconfig_freetype; } // All the functions below can be called at comptime or runtime to @@ -176,7 +176,7 @@ pub const sprite_index = Collection.Index.initSpecial(.sprite); test { // For non-wasm we want to test everything we can - if (!comptime builtin.target.isWasm()) { + if (!comptime builtin.target.cpu.arch.isWasm()) { @import("std").testing.refAllDecls(@This()); return; } diff --git a/src/font/opentype/sfnt.zig b/src/font/opentype/sfnt.zig index cbce50455..14a3b795a 100644 --- a/src/font/opentype/sfnt.zig +++ b/src/font/opentype/sfnt.zig @@ -64,7 +64,7 @@ pub const Version16Dot16 = packed struct(u32) { pub const F26Dot6 = FixedPoint(i32, 26, 6); fn FixedPoint(comptime T: type, int_bits: u64, frac_bits: u64) type { - const type_info: std.builtin.Type.Int = @typeInfo(T).Int; + const type_info: std.builtin.Type.Int = @typeInfo(T).int; comptime assert(int_bits + frac_bits == type_info.bits); return packed struct(T) { diff --git a/src/font/opentype/svg.zig b/src/font/opentype/svg.zig index 15edff5aa..01d172d17 100644 --- a/src/font/opentype/svg.zig +++ b/src/font/opentype/svg.zig @@ -67,14 +67,13 @@ pub const SVG = struct { // Slow path: binary search our records return std.sort.binarySearch( [12]u8, - glyph_id, self.records, - {}, + glyph_id, compareGlyphId, ) != null; } - fn compareGlyphId(_: void, glyph_id: u16, record: [12]u8) std.math.Order { + fn compareGlyphId(glyph_id: u16, record: [12]u8) std.math.Order { const start, const end = glyphRange(&record) catch return .lt; if (glyph_id < start) { return .lt; diff --git a/src/font/sprite/Box.zig b/src/font/sprite/Box.zig index 2cd3d929b..f387ab240 100644 --- a/src/font/sprite/Box.zig +++ b/src/font/sprite/Box.zig @@ -2241,7 +2241,9 @@ fn draw_branch_node( var ctx = canvas.getContext() catch return; defer ctx.deinit(); - ctx.setSource(.{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }); + ctx.setSource(.{ .opaque_pattern = .{ + .pixel = .{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }, + } }); ctx.setLineWidth(float_thick); // These @intFromFloat casts shouldn't ever fail since r can never @@ -2290,7 +2292,9 @@ fn draw_circle( var ctx = canvas.getContext() catch return; defer ctx.deinit(); - ctx.setSource(.{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }); + ctx.setSource(.{ .opaque_pattern = .{ + .pixel = .{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }, + } }); ctx.setLineWidth( @floatFromInt(Thickness.light.height(self.metrics.box_thickness)), ); @@ -2513,7 +2517,7 @@ fn draw_octant(self: Box, canvas: *font.sprite.Canvas, cp: u32) void { const octants: [octants_len]Octant = comptime octants: { @setEvalBranchQuota(10_000); - var result: [octants_len]Octant = .{.{}} ** octants_len; + var result: [octants_len]Octant = .{Octant{}} ** octants_len; var i: usize = 0; const data = @embedFile("octants.txt"); @@ -2678,7 +2682,9 @@ fn draw_arc( var ctx = try canvas.getContext(); defer ctx.deinit(); - ctx.setSource(.{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }); + ctx.setSource(.{ .opaque_pattern = .{ + .pixel = .{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }, + } }); ctx.setLineWidth(float_thick); ctx.setLineCapMode(.round); @@ -2970,8 +2976,9 @@ fn draw_separated_block_quadrant(self: Box, canvas: *font.sprite.Canvas, comptim var ctx = try canvas.getContext(); defer ctx.deinit(); - ctx.setSource(.{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }); - + ctx.setSource(.{ .opaque_pattern = .{ + .pixel = .{ .alpha8 = .{ .a = @intFromEnum(Shade.on) } }, + } }); const gap: f64 = @max(1.0, @as(f64, @floatFromInt(self.metrics.cell_width)) * 0.10) / 2.0; const left: f64 = gap; const right = @as(f64, @floatFromInt(self.metrics.cell_width)) - gap; diff --git a/src/global.zig b/src/global.zig index c93b35fa0..375c10538 100644 --- a/src/global.zig +++ b/src/global.zig @@ -211,9 +211,7 @@ pub const GlobalState = struct { // often write to a broken pipe to exit the read thread. This should // be fixed one day but for now this helps make this a bit more // robust. - p.sigaction(p.SIG.PIPE, &sa, null) catch |err| { - std.log.warn("failed to ignore SIGPIPE err={}", .{err}); - }; + p.sigaction(p.SIG.PIPE, &sa, null); } }; diff --git a/src/helpgen.zig b/src/helpgen.zig index 2084fb9f7..560e5ce29 100644 --- a/src/helpgen.zig +++ b/src/helpgen.zig @@ -34,7 +34,7 @@ fn genConfig(alloc: std.mem.Allocator, writer: anytype) !void { \\ ); - inline for (@typeInfo(Config).Struct.fields) |field| { + inline for (@typeInfo(Config).@"struct".fields) |field| { if (field.name[0] == '_') continue; try genConfigField(alloc, writer, ast, field.name); } @@ -78,7 +78,7 @@ fn genActions(alloc: std.mem.Allocator, writer: anytype) !void { \\ ); - inline for (@typeInfo(Action).Enum.fields) |field| { + inline for (@typeInfo(Action).@"enum".fields) |field| { const action_file = comptime action_file: { const action = @field(Action, field.name); break :action_file action.file(); @@ -126,7 +126,7 @@ fn genKeybindActions(alloc: std.mem.Allocator, writer: anytype) !void { \\ ); - inline for (@typeInfo(KeybindAction).Union.fields) |field| { + inline for (@typeInfo(KeybindAction).@"union".fields) |field| { if (field.name[0] == '_') continue; try genConfigField(alloc, writer, ast, field.name); } diff --git a/src/input/Binding.zig b/src/input/Binding.zig index b684e6cd6..244cd29cd 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -510,7 +510,7 @@ pub const Action = union(enum) { /// crash: CrashThread, - pub const Key = @typeInfo(Action).Union.tag_type.?; + pub const Key = @typeInfo(Action).@"union".tag_type.?; pub const CrashThread = enum { main, @@ -638,17 +638,22 @@ pub const Action = union(enum) { const field_info = @typeInfo(field.type); // Fields can provide a custom "parse" function - if (field_info == .Struct or field_info == .Union or field_info == .Enum) { - if (@hasDecl(field.type, "parse") and @typeInfo(@TypeOf(field.type.parse)) == .Fn) { + if (field_info == .@"struct" or + field_info == .@"union" or + field_info == .@"enum") + { + if (@hasDecl(field.type, "parse") and + @typeInfo(@TypeOf(field.type.parse)) == .@"fn") + { return field.type.parse(param); } } return switch (field_info) { - .Enum => try parseEnum(field.type, param), - .Int => try parseInt(field.type, param), - .Float => try parseFloat(field.type, param), - .Struct => |info| blk: { + .@"enum" => try parseEnum(field.type, param), + .int => try parseInt(field.type, param), + .float => try parseFloat(field.type, param), + .@"struct" => |info| blk: { // Only tuples are supported to avoid ambiguity with field // ordering comptime assert(info.is_tuple); @@ -658,9 +663,9 @@ pub const Action = union(enum) { inline for (info.fields) |field_| { const next = it.next() orelse return Error.InvalidFormat; @field(value, field_.name) = switch (@typeInfo(field_.type)) { - .Enum => try parseEnum(field_.type, next), - .Int => try parseInt(field_.type, next), - .Float => try parseFloat(field_.type, next), + .@"enum" => try parseEnum(field_.type, next), + .int => try parseInt(field_.type, next), + .float => try parseFloat(field_.type, next), else => unreachable, }; } @@ -688,7 +693,7 @@ pub const Action = union(enum) { // An action name is always required if (action.len == 0) return Error.InvalidFormat; - const actionInfo = @typeInfo(Action).Union; + const actionInfo = @typeInfo(Action).@"union"; inline for (actionInfo.fields) |field| { if (std.mem.eql(u8, action, field.name)) { // If the field type is void we expect no value @@ -813,7 +818,9 @@ pub const Action = union(enum) { /// Returns a union type that only contains actions that are scoped to /// the given scope. pub fn Scoped(comptime s: Scope) type { - const all_fields = @typeInfo(Action).Union.fields; + @setEvalBranchQuota(100_000); + + const all_fields = @typeInfo(Action).@"union".fields; // Find all fields that are app-scoped var i: usize = 0; @@ -829,9 +836,9 @@ pub const Action = union(enum) { } // Build our union - return @Type(.{ .Union = .{ + return @Type(.{ .@"union" = .{ .layout = .auto, - .tag_type = @Type(.{ .Enum = .{ + .tag_type = @Type(.{ .@"enum" = .{ .tag_type = std.math.IntFittingRange(0, i), .fields = enum_fields[0..i], .decls = &.{}, @@ -903,10 +910,10 @@ pub const Action = union(enum) { void => {}, []const u8 => try writer.print("{s}", .{value}), else => switch (value_info) { - .Enum => try writer.print("{s}", .{@tagName(value)}), - .Float => try writer.print("{d}", .{value}), - .Int => try writer.print("{d}", .{value}), - .Struct => |info| if (!info.is_tuple) { + .@"enum" => try writer.print("{s}", .{@tagName(value)}), + .float => try writer.print("{d}", .{value}), + .int => try writer.print("{d}", .{value}), + .@"struct" => |info| if (!info.is_tuple) { try writer.print("{} (not configurable)", .{value}); } else { inline for (info.fields, 0..) |field, i| { @@ -937,21 +944,21 @@ pub const Action = union(enum) { value: anytype, ) Allocator.Error!@TypeOf(value) { return switch (@typeInfo(@TypeOf(value))) { - .Void, - .Int, - .Float, - .Enum, + .void, + .int, + .float, + .@"enum", => value, - .Pointer => |info| slice: { - comptime assert(info.size == .Slice); + .pointer => |info| slice: { + comptime assert(info.size == .slice); break :slice try alloc.dupe( info.child, value, ); }, - .Struct => |info| if (info.is_tuple) + .@"struct" => |info| if (info.is_tuple) value else try value.clone(alloc), @@ -974,7 +981,7 @@ pub const Action = union(enum) { /// Hash the action into the given hasher. fn hashIncremental(self: Action, hasher: anytype) void { // Always has the active tag. - const Tag = @typeInfo(Action).Union.tag_type.?; + const Tag = @typeInfo(Action).@"union".tag_type.?; std.hash.autoHash(hasher, @as(Tag, self)); // Hash the value of the field. @@ -1081,7 +1088,7 @@ pub const Trigger = struct { if (part.len == 0) return Error.InvalidFormat; // Check if its a modifier - const modsInfo = @typeInfo(key.Mods).Struct; + const modsInfo = @typeInfo(key.Mods).@"struct"; inline for (modsInfo.fields) |field| { if (field.type == bool) { if (std.mem.eql(u8, part, field.name)) { @@ -1116,7 +1123,7 @@ pub const Trigger = struct { const key_part = if (physical) part[physical_prefix.len..] else part; // Check if its a key - const keysInfo = @typeInfo(key.Key).Enum; + const keysInfo = @typeInfo(key.Key).@"enum"; inline for (keysInfo.fields) |field| { if (!std.mem.eql(u8, field.name, "invalid")) { if (std.mem.eql(u8, key_part, field.name)) { diff --git a/src/input/KeyEncoder.zig b/src/input/KeyEncoder.zig index c009fbe0d..8be5c672c 100644 --- a/src/input/KeyEncoder.zig +++ b/src/input/KeyEncoder.zig @@ -1531,7 +1531,7 @@ test "kitty: left shift with report all" { } test "kitty: report associated with alt text on macOS with option" { - if (comptime !builtin.target.isDarwin()) return error.SkipZigTest; + if (comptime !builtin.target.os.tag.isDarwin()) return error.SkipZigTest; var buf: [128]u8 = undefined; var enc: KeyEncoder = .{ @@ -1555,7 +1555,7 @@ test "kitty: report associated with alt text on macOS with option" { } test "kitty: report associated with alt text on macOS with alt" { - if (comptime !builtin.target.isDarwin()) return error.SkipZigTest; + if (comptime !builtin.target.os.tag.isDarwin()) return error.SkipZigTest; { // With Alt modifier @@ -1826,7 +1826,7 @@ test "legacy: alt+e only unshifted" { } test "legacy: alt+x macos" { - if (comptime !builtin.target.isDarwin()) return error.SkipZigTest; + if (comptime !builtin.target.os.tag.isDarwin()) return error.SkipZigTest; var buf: [128]u8 = undefined; var enc: KeyEncoder = .{ @@ -1845,7 +1845,7 @@ test "legacy: alt+x macos" { } test "legacy: shift+alt+. macos" { - if (comptime !builtin.target.isDarwin()) return error.SkipZigTest; + if (comptime !builtin.target.os.tag.isDarwin()) return error.SkipZigTest; var buf: [128]u8 = undefined; var enc: KeyEncoder = .{ diff --git a/src/input/KeymapDarwin.zig b/src/input/KeymapDarwin.zig index 154f648a6..53c305ab1 100644 --- a/src/input/KeymapDarwin.zig +++ b/src/input/KeymapDarwin.zig @@ -195,7 +195,7 @@ pub fn translate( } else false; // Convert the utf16 to utf8 - const len = try std.unicode.utf16leToUtf8(out, char[0..char_count]); + const len = try std.unicode.utf16LeToUtf8(out, char[0..char_count]); return .{ .text = out[0..len], .composing = composing, diff --git a/src/input/function_keys.zig b/src/input/function_keys.zig index 1156faf56..612112e28 100644 --- a/src/input/function_keys.zig +++ b/src/input/function_keys.zig @@ -81,24 +81,24 @@ pub const keys = keys: { result.set(.left, pcStyle("\x1b[1;{}D") ++ cursorKey("\x1b[D", "\x1bOD")); result.set(.home, pcStyle("\x1b[1;{}H") ++ cursorKey("\x1b[H", "\x1bOH")); result.set(.end, pcStyle("\x1b[1;{}F") ++ cursorKey("\x1b[F", "\x1bOF")); - result.set(.insert, pcStyle("\x1b[2;{}~") ++ .{.{ .sequence = "\x1B[2~" }}); - result.set(.delete, pcStyle("\x1b[3;{}~") ++ .{.{ .sequence = "\x1B[3~" }}); - result.set(.page_up, pcStyle("\x1b[5;{}~") ++ .{.{ .sequence = "\x1B[5~" }}); - result.set(.page_down, pcStyle("\x1b[6;{}~") ++ .{.{ .sequence = "\x1B[6~" }}); + result.set(.insert, pcStyle("\x1b[2;{}~") ++ .{Entry{ .sequence = "\x1B[2~" }}); + result.set(.delete, pcStyle("\x1b[3;{}~") ++ .{Entry{ .sequence = "\x1B[3~" }}); + result.set(.page_up, pcStyle("\x1b[5;{}~") ++ .{Entry{ .sequence = "\x1B[5~" }}); + result.set(.page_down, pcStyle("\x1b[6;{}~") ++ .{Entry{ .sequence = "\x1B[6~" }}); // Function Keys. todo: f13-f35 but we need to add to input.Key - result.set(.f1, pcStyle("\x1b[1;{}P") ++ .{.{ .sequence = "\x1BOP" }}); - result.set(.f2, pcStyle("\x1b[1;{}Q") ++ .{.{ .sequence = "\x1BOQ" }}); - result.set(.f3, pcStyle("\x1b[13;{}~") ++ .{.{ .sequence = "\x1BOR" }}); - result.set(.f4, pcStyle("\x1b[1;{}S") ++ .{.{ .sequence = "\x1BOS" }}); - result.set(.f5, pcStyle("\x1b[15;{}~") ++ .{.{ .sequence = "\x1B[15~" }}); - result.set(.f6, pcStyle("\x1b[17;{}~") ++ .{.{ .sequence = "\x1B[17~" }}); - result.set(.f7, pcStyle("\x1b[18;{}~") ++ .{.{ .sequence = "\x1B[18~" }}); - result.set(.f8, pcStyle("\x1b[19;{}~") ++ .{.{ .sequence = "\x1B[19~" }}); - result.set(.f9, pcStyle("\x1b[20;{}~") ++ .{.{ .sequence = "\x1B[20~" }}); - result.set(.f10, pcStyle("\x1b[21;{}~") ++ .{.{ .sequence = "\x1B[21~" }}); - result.set(.f11, pcStyle("\x1b[23;{}~") ++ .{.{ .sequence = "\x1B[23~" }}); - result.set(.f12, pcStyle("\x1b[24;{}~") ++ .{.{ .sequence = "\x1B[24~" }}); + result.set(.f1, pcStyle("\x1b[1;{}P") ++ .{Entry{ .sequence = "\x1BOP" }}); + result.set(.f2, pcStyle("\x1b[1;{}Q") ++ .{Entry{ .sequence = "\x1BOQ" }}); + result.set(.f3, pcStyle("\x1b[13;{}~") ++ .{Entry{ .sequence = "\x1BOR" }}); + result.set(.f4, pcStyle("\x1b[1;{}S") ++ .{Entry{ .sequence = "\x1BOS" }}); + result.set(.f5, pcStyle("\x1b[15;{}~") ++ .{Entry{ .sequence = "\x1B[15~" }}); + result.set(.f6, pcStyle("\x1b[17;{}~") ++ .{Entry{ .sequence = "\x1B[17~" }}); + result.set(.f7, pcStyle("\x1b[18;{}~") ++ .{Entry{ .sequence = "\x1B[18~" }}); + result.set(.f8, pcStyle("\x1b[19;{}~") ++ .{Entry{ .sequence = "\x1B[19~" }}); + result.set(.f9, pcStyle("\x1b[20;{}~") ++ .{Entry{ .sequence = "\x1B[20~" }}); + result.set(.f10, pcStyle("\x1b[21;{}~") ++ .{Entry{ .sequence = "\x1B[21~" }}); + result.set(.f11, pcStyle("\x1b[23;{}~") ++ .{Entry{ .sequence = "\x1B[23~" }}); + result.set(.f12, pcStyle("\x1b[24;{}~") ++ .{Entry{ .sequence = "\x1B[24~" }}); // Keypad keys result.set(.kp_0, kpKeys("p")); @@ -116,7 +116,7 @@ pub const keys = keys: { result.set(.kp_multiply, kpKeys("j")); result.set(.kp_subtract, kpKeys("m")); result.set(.kp_add, kpKeys("k")); - result.set(.kp_enter, kpKeys("M") ++ .{.{ .sequence = "\r" }}); + result.set(.kp_enter, kpKeys("M") ++ .{Entry{ .sequence = "\r" }}); result.set(.kp_up, pcStyle("\x1b[1;{}A") ++ cursorKey("\x1b[A", "\x1bOA")); result.set(.kp_down, pcStyle("\x1b[1;{}B") ++ cursorKey("\x1b[B", "\x1bOB")); result.set(.kp_right, pcStyle("\x1b[1;{}C") ++ cursorKey("\x1b[C", "\x1bOC")); @@ -124,10 +124,10 @@ pub const keys = keys: { result.set(.kp_begin, pcStyle("\x1b[1;{}E") ++ cursorKey("\x1b[E", "\x1bOE")); result.set(.kp_home, pcStyle("\x1b[1;{}H") ++ cursorKey("\x1b[H", "\x1bOH")); result.set(.kp_end, pcStyle("\x1b[1;{}F") ++ cursorKey("\x1b[F", "\x1bOF")); - result.set(.kp_insert, pcStyle("\x1b[2;{}~") ++ .{.{ .sequence = "\x1B[2~" }}); - result.set(.kp_delete, pcStyle("\x1b[3;{}~") ++ .{.{ .sequence = "\x1B[3~" }}); - result.set(.kp_page_up, pcStyle("\x1b[5;{}~") ++ .{.{ .sequence = "\x1B[5~" }}); - result.set(.kp_page_down, pcStyle("\x1b[6;{}~") ++ .{.{ .sequence = "\x1B[6~" }}); + result.set(.kp_insert, pcStyle("\x1b[2;{}~") ++ .{Entry{ .sequence = "\x1B[2~" }}); + result.set(.kp_delete, pcStyle("\x1b[3;{}~") ++ .{Entry{ .sequence = "\x1B[3~" }}); + result.set(.kp_page_up, pcStyle("\x1b[5;{}~") ++ .{Entry{ .sequence = "\x1B[5~" }}); + result.set(.kp_page_down, pcStyle("\x1b[6;{}~") ++ .{Entry{ .sequence = "\x1B[6~" }}); result.set(.backspace, &.{ // Modify Keys Normal diff --git a/src/input/helpgen_actions.zig b/src/input/helpgen_actions.zig index 58305455b..1382bbe95 100644 --- a/src/input/helpgen_actions.zig +++ b/src/input/helpgen_actions.zig @@ -73,7 +73,7 @@ pub fn generate( var buffer = std.ArrayList(u8).init(page_allocator); defer buffer.deinit(); - const fields = @typeInfo(KeybindAction).Union.fields; + const fields = @typeInfo(KeybindAction).@"union".fields; inline for (fields) |field| { if (field.name[0] == '_') continue; diff --git a/src/input/key.zig b/src/input/key.zig index 766498d54..f9db4a04a 100644 --- a/src/input/key.zig +++ b/src/input/key.zig @@ -152,7 +152,7 @@ pub const Mods = packed struct(Mods.Backing) { pub fn translation(self: Mods, option_as_alt: config.OptionAsAlt) Mods { // We currently only process macos-option-as-alt so other // platforms don't need to do anything. - if (comptime !builtin.target.isDarwin()) return self; + if (comptime !builtin.target.os.tag.isDarwin()) return self; // Alt has to be set only on the correct side switch (option_as_alt) { @@ -170,7 +170,7 @@ pub const Mods = packed struct(Mods.Backing) { /// Checks to see if super is on (MacOS) or ctrl. pub fn ctrlOrSuper(self: Mods) bool { - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { return self.super; } return self.ctrl; @@ -187,7 +187,7 @@ pub const Mods = packed struct(Mods.Backing) { } test "translation macos-option-as-alt" { - if (comptime !builtin.target.isDarwin()) return error.SkipZigTest; + if (comptime !builtin.target.os.tag.isDarwin()) return error.SkipZigTest; const testing = std.testing; @@ -646,7 +646,7 @@ pub const Key = enum(c_int) { /// true if this key is one of the left or right versions of super (MacOS) /// or ctrl. pub fn ctrlOrSuper(self: Key) bool { - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { return self == .left_super or self == .right_super; } return self == .left_control or self == .right_control; @@ -757,7 +757,7 @@ pub const Key = enum(c_int) { /// non-Mac we default to ctrl (i.e. ctrl+c for copy). pub fn ctrlOrSuper(mods: Mods) Mods { var copy = mods; - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { copy.super = true; } else { copy.ctrl = true; diff --git a/src/input/mouse.zig b/src/input/mouse.zig index 10eae6b48..2be2b9a26 100644 --- a/src/input/mouse.zig +++ b/src/input/mouse.zig @@ -27,7 +27,7 @@ pub const Button = enum(c_int) { /// packed array, for example. pub const max = max: { var cur = 0; - for (@typeInfo(Self).Enum.fields) |field| { + for (@typeInfo(Self).@"enum".fields) |field| { if (field.value > cur) cur = field.value; } diff --git a/src/inspector/Inspector.zig b/src/inspector/Inspector.zig index 1824f5ead..edc204886 100644 --- a/src/inspector/Inspector.zig +++ b/src/inspector/Inspector.zig @@ -390,7 +390,7 @@ fn renderScreenWindow(self: *Inspector) void { if (kitty_flags.int() != 0) { const Flags = @TypeOf(kitty_flags); - inline for (@typeInfo(Flags).Struct.fields) |field| { + inline for (@typeInfo(Flags).@"struct".fields) |field| { { const value = @field(kitty_flags, field.name); @@ -602,7 +602,7 @@ fn renderModesWindow(self: *Inspector) void { } const t = self.surface.renderer_state.terminal; - inline for (@typeInfo(terminal.Mode).Enum.fields) |field| { + inline for (@typeInfo(terminal.Mode).@"enum".fields) |field| { const tag: terminal.modes.ModeTag = @bitCast(@as(terminal.modes.ModeTag.Backing, field.value)); cimgui.c.igTableNextRow(cimgui.c.ImGuiTableRowFlags_None, 0); @@ -1298,7 +1298,7 @@ fn renderTermioWindow(self: *Inspector) void { ); defer cimgui.c.igEndTable(); - inline for (@typeInfo(terminal.Parser.Action.Tag).Enum.fields) |field| { + inline for (@typeInfo(terminal.Parser.Action.Tag).@"enum".fields) |field| { const tag = @field(terminal.Parser.Action.Tag, field.name); if (tag == .apc_put or tag == .dcs_put) continue; diff --git a/src/inspector/page.zig b/src/inspector/page.zig index bb95d59b9..0b8609d5a 100644 --- a/src/inspector/page.zig +++ b/src/inspector/page.zig @@ -28,7 +28,7 @@ pub fn render(page: *const terminal.Page) void { { _ = cimgui.c.igTableSetColumnIndex(1); cimgui.c.igText("%d bytes (%d KiB)", page.memory.len, units.toKibiBytes(page.memory.len)); - cimgui.c.igText("%d VM pages", page.memory.len / std.mem.page_size); + cimgui.c.igText("%d VM pages", page.memory.len / std.heap.page_size_min); } } { diff --git a/src/inspector/termio.zig b/src/inspector/termio.zig index 1b499f9dd..6aa6628ab 100644 --- a/src/inspector/termio.zig +++ b/src/inspector/termio.zig @@ -199,7 +199,7 @@ pub const VTEvent = struct { void => {}, []const u8 => try md.put("data", try alloc.dupeZ(u8, v)), else => |T| switch (@typeInfo(T)) { - .Struct => |info| inline for (info.fields) |field| { + .@"struct" => |info| inline for (info.fields) |field| { try encodeMetadataSingle( alloc, md, @@ -208,7 +208,7 @@ pub const VTEvent = struct { ); }, - .Union => |info| { + .@"union" => |info| { const Tag = info.tag_type orelse @compileError("Unions must have a tag"); const tag_name = @tagName(@as(Tag, v)); inline for (info.fields) |field| { @@ -239,23 +239,23 @@ pub const VTEvent = struct { const Value = @TypeOf(value); const info = @typeInfo(Value); switch (info) { - .Optional => if (value) |unwrapped| { + .optional => if (value) |unwrapped| { try encodeMetadataSingle(alloc, md, key, unwrapped); } else { try md.put(key, try alloc.dupeZ(u8, "(unset)")); }, - .Bool => try md.put( + .bool => try md.put( key, try alloc.dupeZ(u8, if (value) "true" else "false"), ), - .Enum => try md.put( + .@"enum" => try md.put( key, try alloc.dupeZ(u8, @tagName(value)), ), - .Union => |u| { + .@"union" => |u| { const Tag = u.tag_type orelse @compileError("Unions must have a tag"); const tag_name = @tagName(@as(Tag, value)); inline for (u.fields) |field| { @@ -273,7 +273,7 @@ pub const VTEvent = struct { } }, - .Struct => try md.put( + .@"struct" => try md.put( key, try alloc.dupeZ(u8, @typeName(Value)), ), diff --git a/src/main_ghostty.zig b/src/main_ghostty.zig index 0e57fbc43..7560423db 100644 --- a/src/main_ghostty.zig +++ b/src/main_ghostty.zig @@ -130,7 +130,7 @@ fn logFn( // // sudo log stream --level debug --predicate 'subsystem=="com.mitchellh.ghostty"' // - if (builtin.target.isDarwin()) { + if (builtin.target.os.tag.isDarwin()) { // Convert our levels to Mac levels const mac_level: macos.os.LogType = switch (level) { .debug => .debug, diff --git a/src/os/file.zig b/src/os/file.zig index 875dd2c25..240c936e0 100644 --- a/src/os/file.zig +++ b/src/os/file.zig @@ -10,7 +10,8 @@ pub const rlimit = if (@hasDecl(posix.system, "rlimit")) posix.rlimit else struc /// need to do this because each window consumes at least a handful of fds. /// This is extracted from the Zig compiler source code. pub fn fixMaxFiles() ?rlimit { - if (!@hasDecl(posix.system, "rlimit")) return null; + if (!@hasDecl(posix.system, "rlimit") or + posix.system.rlimit == void) return null; const old = posix.getrlimit(.NOFILE) catch { log.warn("failed to query file handle limit, may limit max windows", .{}); @@ -59,7 +60,7 @@ pub fn allocTmpDir(allocator: std.mem.Allocator) ?[]const u8 { if (builtin.os.tag == .windows) { // TODO: what is a good fallback path on windows? const v = std.process.getenvW(std.unicode.utf8ToUtf16LeStringLiteral("TMP")) orelse return null; - return std.unicode.utf16leToUtf8Alloc(allocator, v) catch |e| { + return std.unicode.utf16LeToUtf8Alloc(allocator, v) catch |e| { log.warn("failed to convert temp dir path from windows string: {}", .{e}); return null; }; diff --git a/src/os/i18n.zig b/src/os/i18n.zig index dc72d3f5d..7b0b55c8e 100644 --- a/src/os/i18n.zig +++ b/src/os/i18n.zig @@ -147,7 +147,7 @@ extern fn dgettext(domainname: [*:0]const u8, msgid: [*:0]const u8) [*:0]const u extern fn _libintl_locale_name_canonicalize(name: [*:0]u8) void; test "canonicalizeLocale darwin" { - if (!builtin.target.isDarwin()) return error.SkipZigTest; + if (!builtin.target.os.tag.isDarwin()) return error.SkipZigTest; const testing = std.testing; var buf: [256]u8 = undefined; diff --git a/src/os/locale.zig b/src/os/locale.zig index f046448ca..17e4d163c 100644 --- a/src/os/locale.zig +++ b/src/os/locale.zig @@ -21,7 +21,7 @@ pub fn ensureLocale(alloc: std.mem.Allocator) !void { // When launching the .app, LANG is not set so we must query it from the // OS. When launching from the CLI, LANG is usually set by the parent // process. - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { // Set the lang if it is not set or if its empty. if (lang == null or lang.?.value.len == 0) { setLangFromCocoa(); diff --git a/src/os/macos.zig b/src/os/macos.zig index a956d25e2..ca7c81a47 100644 --- a/src/os/macos.zig +++ b/src/os/macos.zig @@ -7,7 +7,7 @@ const Allocator = std.mem.Allocator; /// Verifies that the running macOS system version is at least the given version. pub fn isAtLeastVersion(major: i64, minor: i64, patch: i64) bool { - comptime assert(builtin.target.isDarwin()); + comptime assert(builtin.target.os.tag.isDarwin()); const NSProcessInfo = objc.getClass("NSProcessInfo").?; const info = NSProcessInfo.msgSend(objc.Object, objc.sel("processInfo"), .{}); @@ -108,7 +108,7 @@ fn commonDir( directory: NSSearchPathDirectory, sub_paths: []const []const u8, ) (error{AppleAPIFailed} || Allocator.Error)![]const u8 { - comptime assert(builtin.target.isDarwin()); + comptime assert(builtin.target.os.tag.isDarwin()); const NSFileManager = objc.getClass("NSFileManager").?; const manager = NSFileManager.msgSend( @@ -146,7 +146,7 @@ fn commonDir( } test "cacheDir paths" { - if (!builtin.target.isDarwin()) return; + if (!builtin.target.os.tag.isDarwin()) return; const testing = std.testing; const alloc = testing.allocator; diff --git a/src/os/open.zig b/src/os/open.zig index f6dc7ca2a..f7eadd06e 100644 --- a/src/os/open.zig +++ b/src/os/open.zig @@ -57,14 +57,14 @@ pub fn open( // 50 KiB is the default value used by std.process.Child.run const output_max_size = 50 * 1024; - var stdout = std.ArrayList(u8).init(alloc); - var stderr = std.ArrayList(u8).init(alloc); + var stdout: std.ArrayListUnmanaged(u8) = .{}; + var stderr: std.ArrayListUnmanaged(u8) = .{}; defer { - stdout.deinit(); - stderr.deinit(); + stdout.deinit(alloc); + stderr.deinit(alloc); } - try exe.collectOutput(&stdout, &stderr, output_max_size); + try exe.collectOutput(alloc, &stdout, &stderr, output_max_size); _ = try exe.wait(); // If we have any stderr output we log it. This makes it easier for diff --git a/src/os/passwd.zig b/src/os/passwd.zig index 54f84a15d..4bbd55a4d 100644 --- a/src/os/passwd.zig +++ b/src/os/passwd.zig @@ -10,7 +10,7 @@ const log = std.log.scoped(.passwd); // We want to be extra sure since this will force bad symbols into our import table comptime { - if (builtin.target.isWasm()) { + if (builtin.target.cpu.arch.isWasm()) { @compileError("passwd is not available for wasm"); } } diff --git a/src/os/resourcesdir.zig b/src/os/resourcesdir.zig index ae7c33bc3..2ae4ba39a 100644 --- a/src/os/resourcesdir.zig +++ b/src/os/resourcesdir.zig @@ -46,7 +46,7 @@ pub fn resourcesDir(alloc: std.mem.Allocator) !?[]const u8 { exe = dir; // On MacOS, we look for the app bundle path. - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { if (try maybeDir(&dir_buf, dir, "Contents/Resources", sentinel)) |v| { return try std.fs.path.join(alloc, &.{ v, "ghostty" }); } diff --git a/src/os/wasm.zig b/src/os/wasm.zig index 92e12fe62..73a5922cf 100644 --- a/src/os/wasm.zig +++ b/src/os/wasm.zig @@ -4,7 +4,7 @@ const builtin = @import("builtin"); const options = @import("build_options"); comptime { - if (!builtin.target.isWasm()) { + if (!builtin.target.cpu.arch.isWasm()) { @compileError("wasm.zig should only be analyzed for wasm32 builds"); } } @@ -67,7 +67,7 @@ pub export fn free(ptr: ?[*]u8) void { /// to the host. pub fn toHostOwned(ptr: anytype) ![*]u8 { // Convert our pointer to a byte array - const info = @typeInfo(@TypeOf(ptr)).Pointer; + const info = @typeInfo(@TypeOf(ptr)).pointer; const T = info.child; const size = @sizeOf(T); const casted = @as([*]u8, @ptrFromInt(@intFromPtr(ptr))); diff --git a/src/os/windows.zig b/src/os/windows.zig index 5140cd2a4..1853f4162 100644 --- a/src/os/windows.zig +++ b/src/os/windows.zig @@ -6,6 +6,8 @@ const windows = std.os.windows; pub const kernel32 = windows.kernel32; pub const unexpectedError = windows.unexpectedError; pub const OpenFile = windows.OpenFile; +pub const CloseHandle = windows.CloseHandle; +pub const GetCurrentProcessId = windows.GetCurrentProcessId; pub const SetHandleInformation = windows.SetHandleInformation; pub const DWORD = windows.DWORD; pub const FILE_ATTRIBUTE_NORMAL = windows.FILE_ATTRIBUTE_NORMAL; diff --git a/src/pty.zig b/src/pty.zig index 6f97e190d..a36de9adc 100644 --- a/src/pty.zig +++ b/src/pty.zig @@ -215,19 +215,19 @@ const PosixPty = struct { .mask = posix.empty_sigset, .flags = 0, }; - try posix.sigaction(posix.SIG.ABRT, &sa, null); - try posix.sigaction(posix.SIG.ALRM, &sa, null); - try posix.sigaction(posix.SIG.BUS, &sa, null); - try posix.sigaction(posix.SIG.CHLD, &sa, null); - try posix.sigaction(posix.SIG.FPE, &sa, null); - try posix.sigaction(posix.SIG.HUP, &sa, null); - try posix.sigaction(posix.SIG.ILL, &sa, null); - try posix.sigaction(posix.SIG.INT, &sa, null); - try posix.sigaction(posix.SIG.PIPE, &sa, null); - try posix.sigaction(posix.SIG.SEGV, &sa, null); - try posix.sigaction(posix.SIG.TRAP, &sa, null); - try posix.sigaction(posix.SIG.TERM, &sa, null); - try posix.sigaction(posix.SIG.QUIT, &sa, null); + posix.sigaction(posix.SIG.ABRT, &sa, null); + posix.sigaction(posix.SIG.ALRM, &sa, null); + posix.sigaction(posix.SIG.BUS, &sa, null); + posix.sigaction(posix.SIG.CHLD, &sa, null); + posix.sigaction(posix.SIG.FPE, &sa, null); + posix.sigaction(posix.SIG.HUP, &sa, null); + posix.sigaction(posix.SIG.ILL, &sa, null); + posix.sigaction(posix.SIG.INT, &sa, null); + posix.sigaction(posix.SIG.PIPE, &sa, null); + posix.sigaction(posix.SIG.SEGV, &sa, null); + posix.sigaction(posix.SIG.TRAP, &sa, null); + posix.sigaction(posix.SIG.TERM, &sa, null); + posix.sigaction(posix.SIG.QUIT, &sa, null); // Create a new process group if (setsid() < 0) return error.ProcessGroupFailed; @@ -275,7 +275,7 @@ const WindowsPty = struct { &pipe_path_buf, "\\\\.\\pipe\\LOCAL\\ghostty-pty-{d}-{d}", .{ - windows.kernel32.GetCurrentProcessId(), + windows.GetCurrentProcessId(), pipe_name_counter.fetchAdd(1, .monotonic), }, ) catch unreachable; @@ -308,7 +308,7 @@ const WindowsPty = struct { if (pty.in_pipe == windows.INVALID_HANDLE_VALUE) { return windows.unexpectedError(windows.kernel32.GetLastError()); } - errdefer _ = windows.kernel32.CloseHandle(pty.in_pipe); + errdefer _ = windows.CloseHandle(pty.in_pipe); var security_attributes_read = security_attributes; pty.in_pipe_pty = windows.kernel32.CreateFileW( @@ -323,7 +323,7 @@ const WindowsPty = struct { if (pty.in_pipe_pty == windows.INVALID_HANDLE_VALUE) { return windows.unexpectedError(windows.kernel32.GetLastError()); } - errdefer _ = windows.kernel32.CloseHandle(pty.in_pipe_pty); + errdefer _ = windows.CloseHandle(pty.in_pipe_pty); // The in_pipe needs to be created as a named pipe, since anonymous // pipes created with CreatePipe do not support overlapped operations, @@ -336,16 +336,16 @@ const WindowsPty = struct { // return windows.unexpectedError(windows.kernel32.GetLastError()); // } // errdefer { - // _ = windows.kernel32.CloseHandle(pty.in_pipe_pty); - // _ = windows.kernel32.CloseHandle(pty.in_pipe); + // _ = windows.CloseHandle(pty.in_pipe_pty); + // _ = windows.CloseHandle(pty.in_pipe); // } if (windows.exp.kernel32.CreatePipe(&pty.out_pipe, &pty.out_pipe_pty, null, 0) == 0) { return windows.unexpectedError(windows.kernel32.GetLastError()); } errdefer { - _ = windows.kernel32.CloseHandle(pty.out_pipe); - _ = windows.kernel32.CloseHandle(pty.out_pipe_pty); + _ = windows.CloseHandle(pty.out_pipe); + _ = windows.CloseHandle(pty.out_pipe_pty); } try windows.SetHandleInformation(pty.in_pipe, windows.HANDLE_FLAG_INHERIT, 0); @@ -367,10 +367,10 @@ const WindowsPty = struct { } pub fn deinit(self: *Pty) void { - _ = windows.kernel32.CloseHandle(self.in_pipe_pty); - _ = windows.kernel32.CloseHandle(self.in_pipe); - _ = windows.kernel32.CloseHandle(self.out_pipe_pty); - _ = windows.kernel32.CloseHandle(self.out_pipe); + _ = windows.CloseHandle(self.in_pipe_pty); + _ = windows.CloseHandle(self.in_pipe); + _ = windows.CloseHandle(self.out_pipe_pty); + _ = windows.CloseHandle(self.out_pipe); _ = windows.exp.kernel32.ClosePseudoConsole(self.pseudo_console); self.* = undefined; } diff --git a/src/renderer.zig b/src/renderer.zig index d968ab4df..61d9a4e53 100644 --- a/src/renderer.zig +++ b/src/renderer.zig @@ -48,7 +48,7 @@ pub const Impl = enum { }; } - if (target.isDarwin()) return .metal; + if (target.os.tag.isDarwin()) return .metal; return .opengl; } }; @@ -70,5 +70,13 @@ pub const Health = enum(c_int) { }; test { - @import("std").testing.refAllDecls(@This()); + // Our comptime-chosen renderer + _ = Renderer; + + _ = cursor; + _ = message; + _ = shadertoy; + _ = size; + _ = Thread; + _ = State; } diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index d2477725c..3e4677bb5 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -1147,12 +1147,12 @@ pub fn updateFrame( // the entire screen. This can be optimized in the future. const full_rebuild: bool = rebuild: { { - const Int = @typeInfo(terminal.Terminal.Dirty).Struct.backing_integer.?; + const Int = @typeInfo(terminal.Terminal.Dirty).@"struct".backing_integer.?; const v: Int = @bitCast(state.terminal.flags.dirty); if (v > 0) break :rebuild true; } { - const Int = @typeInfo(terminal.Screen.Dirty).Struct.backing_integer.?; + const Int = @typeInfo(terminal.Screen.Dirty).@"struct".backing_integer.?; const v: Int = @bitCast(state.terminal.screen.dirty); if (v > 0) break :rebuild true; } diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index 20a0a82b3..f2df8f9a0 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -41,7 +41,7 @@ pub const single_threaded_draw = if (@hasDecl(apprt.Surface, "opengl_single_thre else false; const DrawMutex = if (single_threaded_draw) std.Thread.Mutex else void; -const drawMutexZero = if (DrawMutex == void) void{} else .{}; +const drawMutexZero: DrawMutex = if (DrawMutex == void) void{} else .{}; alloc: std.mem.Allocator, @@ -799,12 +799,12 @@ pub fn updateFrame( // the entire screen. This can be optimized in the future. const full_rebuild: bool = rebuild: { { - const Int = @typeInfo(terminal.Terminal.Dirty).Struct.backing_integer.?; + const Int = @typeInfo(terminal.Terminal.Dirty).@"struct".backing_integer.?; const v: Int = @bitCast(state.terminal.flags.dirty); if (v > 0) break :rebuild true; } { - const Int = @typeInfo(terminal.Screen.Dirty).Struct.backing_integer.?; + const Int = @typeInfo(terminal.Screen.Dirty).@"struct".backing_integer.?; const v: Int = @bitCast(state.terminal.screen.dirty); if (v > 0) break :rebuild true; } @@ -2327,7 +2327,7 @@ pub fn drawFrame(self: *OpenGL, surface: *apprt.Surface) !void { // This locks the context and avoids crashes that can happen due to // races with the underlying Metal layer that Apple is using to // implement OpenGL. - const is_darwin = builtin.target.isDarwin(); + const is_darwin = builtin.target.os.tag.isDarwin(); const ogl = if (comptime is_darwin) @cImport({ @cInclude("OpenGL/OpenGL.h"); }) else {}; diff --git a/src/renderer/State.zig b/src/renderer/State.zig index 8a11a7403..e882ddceb 100644 --- a/src/renderer/State.zig +++ b/src/renderer/State.zig @@ -3,7 +3,7 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const Inspector = @import("../inspector/main.zig").Inspector; -const terminal = @import("../terminal/main.zig"); +const terminalpkg = @import("../terminal/main.zig"); const inputpkg = @import("../input.zig"); const renderer = @import("../renderer.zig"); @@ -14,7 +14,7 @@ const renderer = @import("../renderer.zig"); mutex: *std.Thread.Mutex, /// The terminal data. -terminal: *terminal.Terminal, +terminal: *terminalpkg.Terminal, /// The terminal inspector, if any. This will be null while the inspector /// is not active and will be set when it is active. @@ -34,7 +34,7 @@ pub const Mouse = struct { /// The point on the viewport where the mouse currently is. We use /// viewport points to avoid the complexity of mapping the mouse to /// the renderer state. - point: ?terminal.point.Coordinate = null, + point: ?terminalpkg.point.Coordinate = null, /// The mods that are currently active for the last mouse event. /// This could really just be mods in general and we probably will @@ -80,11 +80,11 @@ pub const Preedit = struct { /// into the available space. pub fn range( self: *const Preedit, - start: terminal.size.CellCountInt, - max: terminal.size.CellCountInt, + start: terminalpkg.size.CellCountInt, + max: terminalpkg.size.CellCountInt, ) struct { - start: terminal.size.CellCountInt, - end: terminal.size.CellCountInt, + start: terminalpkg.size.CellCountInt, + end: terminalpkg.size.CellCountInt, cp_offset: usize, } { // If our width is greater than the number of cells we have @@ -96,7 +96,7 @@ pub const Preedit = struct { // Rebuild our width in reverse order. This is because we want // to offset by the end cells, not the start cells (if we have to). - var w: terminal.size.CellCountInt = 0; + var w: terminalpkg.size.CellCountInt = 0; for (0..self.codepoints.len) |i| { const reverse_i = self.codepoints.len - i - 1; const cp = self.codepoints[reverse_i]; diff --git a/src/renderer/Thread.zig b/src/renderer/Thread.zig index 03b41ab30..46ef8609b 100644 --- a/src/renderer/Thread.zig +++ b/src/renderer/Thread.zig @@ -8,7 +8,7 @@ const assert = std.debug.assert; const xev = @import("../global.zig").xev; const crash = @import("../crash/main.zig"); const internal_os = @import("../os/main.zig"); -const renderer = @import("../renderer.zig"); +const rendererpkg = @import("../renderer.zig"); const apprt = @import("../apprt.zig"); const configpkg = @import("../config.zig"); const BlockingQueue = @import("../datastruct/main.zig").BlockingQueue; @@ -23,7 +23,7 @@ const CURSOR_BLINK_INTERVAL = 600; /// The type used for sending messages to the IO thread. For now this is /// hardcoded with a capacity. We can make this a comptime parameter in /// the future if we want it configurable. -pub const Mailbox = BlockingQueue(renderer.Message, 64); +pub const Mailbox = BlockingQueue(rendererpkg.Message, 64); /// Allocator used for some state alloc: std.mem.Allocator, @@ -67,10 +67,10 @@ cursor_c_cancel: xev.Completion = .{}, surface: *apprt.Surface, /// The underlying renderer implementation. -renderer: *renderer.Renderer, +renderer: *rendererpkg.Renderer, /// Pointer to the shared state that is used to generate the final render. -state: *renderer.State, +state: *rendererpkg.State, /// The mailbox that can be used to send this thread messages. Note /// this is a blocking queue so if it is full you will get errors (or block). @@ -117,8 +117,8 @@ pub fn init( alloc: Allocator, config: *const configpkg.Config, surface: *apprt.Surface, - renderer_impl: *renderer.Renderer, - state: *renderer.State, + renderer_impl: *rendererpkg.Renderer, + state: *rendererpkg.State, app_mailbox: App.Mailbox, ) !Thread { // Create our event loop. @@ -209,7 +209,7 @@ fn threadMain_(self: *Thread) !void { self.setQosClass(); // Run our loop start/end callbacks if the renderer cares. - const has_loop = @hasDecl(renderer.Renderer, "loopEnter"); + const has_loop = @hasDecl(rendererpkg.Renderer, "loopEnter"); if (has_loop) try self.renderer.loopEnter(self); defer if (has_loop) self.renderer.loopExit(); @@ -248,7 +248,7 @@ fn threadMain_(self: *Thread) !void { fn setQosClass(self: *const Thread) void { // Thread QoS classes are only relevant on macOS. - if (comptime !builtin.target.isDarwin()) return; + if (comptime !builtin.target.os.tag.isDarwin()) return; const class: internal_os.macos.QosClass = class: { // If we aren't visible (our view is fully occluded) then we @@ -278,7 +278,7 @@ fn setQosClass(self: *const Thread) void { fn startDrawTimer(self: *Thread) void { // If our renderer doesn't support animations then we never run this. - if (!@hasDecl(renderer.Renderer, "hasAnimations")) return; + if (!@hasDecl(rendererpkg.Renderer, "hasAnimations")) return; if (!self.renderer.hasAnimations()) return; if (self.config.custom_shader_animation == .false) return; @@ -442,7 +442,7 @@ fn drainMailbox(self: *Thread) !void { .inspector => |v| self.flags.has_inspector = v, .macos_display_id => |v| { - if (@hasDecl(renderer.Renderer, "setMacOSDisplayID")) { + if (@hasDecl(rendererpkg.Renderer, "setMacOSDisplayID")) { try self.renderer.setMacOSDisplayID(v); } }, @@ -466,8 +466,8 @@ fn drawFrame(self: *Thread, now: bool) void { // If we're doing single-threaded GPU calls then we just wake up the // app thread to redraw at this point. - if (renderer.Renderer == renderer.OpenGL and - renderer.OpenGL.single_threaded_draw) + if (rendererpkg.Renderer == rendererpkg.OpenGL and + rendererpkg.OpenGL.single_threaded_draw) { _ = self.app_mailbox.push( .{ .redraw_surface = self.surface }, diff --git a/src/renderer/metal/api.zig b/src/renderer/metal/api.zig index 535a0b42b..19db17ba4 100644 --- a/src/renderer/metal/api.zig +++ b/src/renderer/metal/api.zig @@ -34,7 +34,7 @@ pub const MTLResourceOptions = packed struct(c_ulong) { hazard_tracking_mode: HazardTrackingMode = .default, _pad: @Type(.{ - .Int = .{ .signedness = .unsigned, .bits = @bitSizeOf(c_ulong) - 10 }, + .int = .{ .signedness = .unsigned, .bits = @bitSizeOf(c_ulong) - 10 }, }) = 0, pub const CPUCacheMode = enum(u4) { diff --git a/src/renderer/metal/shaders.zig b/src/renderer/metal/shaders.zig index b297de809..8fa170bf2 100644 --- a/src/renderer/metal/shaders.zig +++ b/src/renderer/metal/shaders.zig @@ -681,11 +681,11 @@ fn initImagePipeline( } fn autoAttribute(T: type, attrs: objc.Object) void { - inline for (@typeInfo(T).Struct.fields, 0..) |field, i| { + inline for (@typeInfo(T).@"struct".fields, 0..) |field, i| { const offset = @offsetOf(T, field.name); const FT = switch (@typeInfo(field.type)) { - .Enum => |e| e.tag_type, + .@"enum" => |e| e.tag_type, else => field.type, }; diff --git a/src/renderer/opengl/CellProgram.zig b/src/renderer/opengl/CellProgram.zig index 48386362e..c4da8e233 100644 --- a/src/renderer/opengl/CellProgram.zig +++ b/src/renderer/opengl/CellProgram.zig @@ -67,7 +67,7 @@ pub const CellMode = enum(u8) { // Since we use bit tricks below, we want to ensure the enum // doesn't change without us looking at this logic again. comptime { - const info = @typeInfo(CellMode).Enum; + const info = @typeInfo(CellMode).@"enum"; std.debug.assert(info.fields.len == 5); } diff --git a/src/renderer/size.zig b/src/renderer/size.zig index 40c5af3a9..83e921a26 100644 --- a/src/renderer/size.zig +++ b/src/renderer/size.zig @@ -75,7 +75,7 @@ pub const Coordinate = union(enum) { terminal: Terminal, grid: Grid, - pub const Tag = @typeInfo(Coordinate).Union.tag_type.?; + pub const Tag = @typeInfo(Coordinate).@"union".tag_type.?; pub const Surface = struct { x: f64, y: f64 }; pub const Terminal = struct { x: f64, y: f64 }; pub const Grid = struct { x: GridSize.Unit, y: GridSize.Unit }; diff --git a/src/simd/index_of.h b/src/simd/index_of.h index 2515f7e0a..8c214d9d0 100644 --- a/src/simd/index_of.h +++ b/src/simd/index_of.h @@ -70,7 +70,7 @@ size_t IndexOfImpl(D d, T needle, const T* HWY_RESTRICT input, size_t count) { using D1 = decltype(d1); // Get an equally sized needle vector with only one lane. - const hn::Vec needle1 = Set(d1, GetLane(needle_vec)); + const hn::Vec needle1 = Set(d1, hn::GetLane(needle_vec)); // Go through the remaining elements and do similar logic to // the previous loop to find any matches. diff --git a/src/simd/vt.cpp b/src/simd/vt.cpp index e6c762bea..d8133abf7 100644 --- a/src/simd/vt.cpp +++ b/src/simd/vt.cpp @@ -103,7 +103,7 @@ size_t DecodeUTF8UntilControlSeqImpl(D d, if (i != count) { const hn::CappedTag d1; using D1 = decltype(d1); - const hn::Vec esc1 = Set(d1, GetLane(esc_vec)); + const hn::Vec esc1 = Set(d1, hn::GetLane(esc_vec)); for (; i < count; ++i) { const hn::Vec input_vec = hn::LoadU(d1, input + i); const auto esc_idx = IndexOfChunk(d1, esc1, input_vec); diff --git a/src/surface_mouse.zig b/src/surface_mouse.zig index cc1643a88..ed1e36335 100644 --- a/src/surface_mouse.zig +++ b/src/surface_mouse.zig @@ -120,7 +120,7 @@ fn isMouseModeOverrideState(mods: input.Mods) bool { /// Returns true if our modifiers put us in a state where dragging /// should cause a rectangle select. pub fn isRectangleSelectState(mods: input.Mods) bool { - return if (comptime builtin.target.isDarwin()) + return if (comptime builtin.target.os.tag.isDarwin()) mods.alt else mods.ctrlOrSuper() and mods.alt; diff --git a/src/terminal/PageList.zig b/src/terminal/PageList.zig index b838332b0..95519fe99 100644 --- a/src/terminal/PageList.zig +++ b/src/terminal/PageList.zig @@ -56,7 +56,7 @@ const std_size = Page.layout(std_capacity).total_size; /// allocator because we need memory that is zero-initialized and page-aligned. const PagePool = std.heap.MemoryPoolAligned( [std_size]u8, - std.mem.page_size, + std.heap.page_size_min, ); /// List of pins, known as "tracked" pins. These are pins that are kept @@ -1977,7 +1977,7 @@ fn createPageExt( else try page_alloc.alignedAlloc( u8, - std.mem.page_size, + std.heap.page_size_min, layout.total_size, ); errdefer if (pooled) diff --git a/src/terminal/Parser.zig b/src/terminal/Parser.zig index bc5859ede..4e74f04ba 100644 --- a/src/terminal/Parser.zig +++ b/src/terminal/Parser.zig @@ -148,7 +148,7 @@ pub const Action = union(enum) { ) !void { _ = layout; const T = Action; - const info = @typeInfo(T).Union; + const info = @typeInfo(T).@"union"; try writer.writeAll(@typeName(T)); if (info.tag_type) |TagType| { diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index bec0a24a2..efb9684eb 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -11,7 +11,7 @@ const Allocator = std.mem.Allocator; const unicode = @import("../unicode/main.zig"); const ansi = @import("ansi.zig"); -const modes = @import("modes.zig"); +const modespkg = @import("modes.zig"); const charsets = @import("charsets.zig"); const csi = @import("csi.zig"); const hyperlink = @import("hyperlink.zig"); @@ -20,7 +20,7 @@ const point = @import("point.zig"); const sgr = @import("sgr.zig"); const Tabstops = @import("Tabstops.zig"); const color = @import("color.zig"); -const mouse_shape = @import("mouse_shape.zig"); +const mouse_shape_pkg = @import("mouse_shape.zig"); const size = @import("size.zig"); const pagepkg = @import("page.zig"); @@ -77,7 +77,7 @@ default_palette: color.Palette = color.default, /// The color palette to use. The mask indicates which palette indices have been /// modified with OSC 4 color_palette: struct { - const Mask = std.StaticBitSet(@typeInfo(color.Palette).Array.len); + const Mask = std.StaticBitSet(@typeInfo(color.Palette).array.len); colors: color.Palette = color.default, mask: Mask = Mask.initEmpty(), } = .{}, @@ -87,10 +87,10 @@ color_palette: struct { previous_char: ?u21 = null, /// The modes that this terminal currently has active. -modes: modes.ModeState = .{}, +modes: modespkg.ModeState = .{}, /// The most recently set mouse shape for the terminal. -mouse_shape: mouse_shape.MouseShape = .text, +mouse_shape: mouse_shape_pkg.MouseShape = .text, /// These are just a packed set of flags we may set on the terminal. flags: packed struct { @@ -196,7 +196,7 @@ pub const Options = struct { /// The default mode state. When the terminal gets a reset, it /// will revert back to this state. - default_modes: modes.ModePacked = .{}, + default_modes: modespkg.ModePacked = .{}, }; /// Initialize a new terminal. diff --git a/src/terminal/charsets.zig b/src/terminal/charsets.zig index 316238458..66d6566e3 100644 --- a/src/terminal/charsets.zig +++ b/src/terminal/charsets.zig @@ -99,7 +99,7 @@ fn initTable() [table_len]u16 { test { const testing = std.testing; - const info = @typeInfo(Charset).Enum; + const info = @typeInfo(Charset).@"enum"; inline for (info.fields) |field| { // utf8 has no table if (@field(Charset, field.name) == .utf8) continue; diff --git a/src/terminal/device_status.zig b/src/terminal/device_status.zig index 78147ddd4..1be7bf719 100644 --- a/src/terminal/device_status.zig +++ b/src/terminal/device_status.zig @@ -14,7 +14,7 @@ pub const Request = dsr_enum: { }; } - break :dsr_enum @Type(.{ .Enum = .{ + break :dsr_enum @Type(.{ .@"enum" = .{ .tag_type = Tag.Backing, .fields = &fields, .decls = &.{}, @@ -27,7 +27,7 @@ pub const Request = dsr_enum: { /// chosen somewhat arbitrarily to match the largest expected size /// we see as a multiple of 8 bits. pub const Tag = packed struct(u16) { - pub const Backing = @typeInfo(@This()).Struct.backing_integer.?; + pub const Backing = @typeInfo(@This()).@"struct".backing_integer.?; value: u15, question: bool = false, diff --git a/src/terminal/hash_map.zig b/src/terminal/hash_map.zig index 9e47da561..0cc17a747 100644 --- a/src/terminal/hash_map.zig +++ b/src/terminal/hash_map.zig @@ -118,7 +118,6 @@ fn HashMapUnmanaged( const Self = @This(); comptime { - std.hash_map.verifyContext(Context, K, K, u64, false); assert(@alignOf(Metadata) == 1); } @@ -205,8 +204,8 @@ fn HashMapUnmanaged( } pub fn takeFingerprint(hash: Hash) FingerPrint { - const hash_bits = @typeInfo(Hash).Int.bits; - const fp_bits = @typeInfo(FingerPrint).Int.bits; + const hash_bits = @typeInfo(Hash).int.bits; + const fp_bits = @typeInfo(FingerPrint).int.bits; return @as(FingerPrint, @truncate(hash >> (hash_bits - fp_bits))); } @@ -510,8 +509,6 @@ fn HashMapUnmanaged( /// from this function. To encourage that, this function is /// marked as inline. inline fn getIndex(self: Self, key: anytype, ctx: anytype) ?usize { - comptime std.hash_map.verifyContext(@TypeOf(ctx), @TypeOf(key), K, Hash, false); - if (self.header().size == 0) { return null; } @@ -519,8 +516,6 @@ fn HashMapUnmanaged( // If you get a compile error on this line, it means that your generic hash // function is invalid for these parameters. const hash = ctx.hash(key); - // verifyContext can't verify the return type of generic hash functions, - // so we need to double-check it here. if (@TypeOf(hash) != Hash) { @compileError("Context " ++ @typeName(@TypeOf(ctx)) ++ " has a generic hash function that returns the wrong type! " ++ @typeName(Hash) ++ " was expected, but found " ++ @typeName(@TypeOf(hash))); } @@ -693,8 +688,6 @@ fn HashMapUnmanaged( return result; } pub fn getOrPutAssumeCapacityAdapted(self: *Self, key: anytype, ctx: anytype) GetOrPutResult { - comptime std.hash_map.verifyContext(@TypeOf(ctx), @TypeOf(key), K, Hash, false); - // If you get a compile error on this line, it means that your generic hash // function is invalid for these parameters. const hash = ctx.hash(key); diff --git a/src/terminal/kitty/color.zig b/src/terminal/kitty/color.zig index a631bc6a5..b23e30ad8 100644 --- a/src/terminal/kitty/color.zig +++ b/src/terminal/kitty/color.zig @@ -30,7 +30,7 @@ pub const Special = enum { }; pub const Kind = union(enum) { - pub const max: usize = std.math.maxInt(u8) + @typeInfo(Special).Enum.fields.len; + pub const max: usize = std.math.maxInt(u8) + @typeInfo(Special).@"enum".fields.len; palette: u8, special: Special, diff --git a/src/terminal/kitty/graphics_unicode.zig b/src/terminal/kitty/graphics_unicode.zig index 339ad6202..a4a25e751 100644 --- a/src/terminal/kitty/graphics_unicode.zig +++ b/src/terminal/kitty/graphics_unicode.zig @@ -553,12 +553,11 @@ const IncompletePlacement = struct { /// Get the row/col index for a diacritic codepoint. These are 0-indexed. fn getIndex(cp: u21) ?u32 { - const idx = std.sort.binarySearch(u21, cp, diacritics, {}, (struct { - fn order(context: void, lhs: u21, rhs: u21) std.math.Order { - _ = context; - return std.math.order(lhs, rhs); + const idx = std.sort.binarySearch(u21, diacritics, cp, (struct { + fn compare(context: u21, item: u21) std.math.Order { + return std.math.order(context, item); } - }).order) orelse return null; + }).compare) orelse return null; return @intCast(idx); } diff --git a/src/terminal/kitty/key.zig b/src/terminal/kitty/key.zig index a3e154543..a04bd181a 100644 --- a/src/terminal/kitty/key.zig +++ b/src/terminal/kitty/key.zig @@ -8,7 +8,7 @@ const std = @import("std"); pub const FlagStack = struct { const len = 8; - flags: [len]Flags = .{.{}} ** len, + flags: [len]Flags = .{Flags{}} ** len, idx: u3 = 0, /// Return the current stack value @@ -51,7 +51,7 @@ pub const FlagStack = struct { // could send a huge number of pop commands to waste cpu. if (n >= self.flags.len) { self.idx = 0; - self.flags = .{.{}} ** len; + self.flags = .{Flags{}} ** len; return; } diff --git a/src/terminal/modes.zig b/src/terminal/modes.zig index 89d352e4a..60ecc7698 100644 --- a/src/terminal/modes.zig +++ b/src/terminal/modes.zig @@ -93,13 +93,13 @@ pub const ModePacked = packed_struct: { fields[i] = .{ .name = entry.name, .type = bool, - .default_value = &entry.default, + .default_value_ptr = &entry.default, .is_comptime = false, .alignment = 0, }; } - break :packed_struct @Type(.{ .Struct = .{ + break :packed_struct @Type(.{ .@"struct" = .{ .layout = .@"packed", .fields = &fields, .decls = &.{}, @@ -121,7 +121,7 @@ pub const Mode = mode_enum: { }; } - break :mode_enum @Type(.{ .Enum = .{ + break :mode_enum @Type(.{ .@"enum" = .{ .tag_type = ModeTag.Backing, .fields = &fields, .decls = &.{}, @@ -132,7 +132,7 @@ pub const Mode = mode_enum: { /// The tag type for our enum is a u16 but we use a packed struct /// in order to pack the ansi bit into the tag. pub const ModeTag = packed struct(u16) { - pub const Backing = @typeInfo(@This()).Struct.backing_integer.?; + pub const Backing = @typeInfo(@This()).@"struct".backing_integer.?; value: u15, ansi: bool = false, diff --git a/src/terminal/page.zig b/src/terminal/page.zig index 30f6658aa..acb757592 100644 --- a/src/terminal/page.zig +++ b/src/terminal/page.zig @@ -83,7 +83,7 @@ pub const Page = struct { comptime { // The alignment of our members. We want to ensure that the page // alignment is always divisible by this. - assert(std.mem.page_size % @max( + assert(std.heap.page_size_min % @max( @alignOf(Row), @alignOf(Cell), style.Set.base_align, @@ -93,7 +93,7 @@ pub const Page = struct { /// The backing memory for the page. A page is always made up of a /// a single contiguous block of memory that is aligned on a page /// boundary and is a multiple of the system page size. - memory: []align(std.mem.page_size) u8, + memory: []align(std.heap.page_size_min) u8, /// The array of rows in the page. The rows are always in row order /// (i.e. index 0 is the top row, index 1 is the row below that, etc.) @@ -198,7 +198,7 @@ pub const Page = struct { // (small but meaningful for this path) and because a private // anonymous mmap is guaranteed on Linux and macOS to be zeroed, // which is a critical property for us. - assert(l.total_size % std.mem.page_size == 0); + assert(l.total_size % std.heap.page_size_min == 0); const backing = try posix.mmap( null, l.total_size, @@ -611,7 +611,7 @@ pub const Page = struct { /// Clone the entire contents of this page. /// /// The buffer must be at least the size of self.memory. - pub fn cloneBuf(self: *const Page, buf: []align(std.mem.page_size) u8) Page { + pub fn cloneBuf(self: *const Page, buf: []align(std.heap.page_size_min) u8) Page { assert(buf.len >= self.memory.len); // The entire concept behind a page is that everything is stored @@ -1721,7 +1721,7 @@ pub const Page = struct { const dirty_start = alignForward(usize, cells_end, @alignOf(usize)); const dirty_end: usize = dirty_start + (dirty_usize_length * @sizeOf(usize)); - const styles_layout = style.Set.layout(cap.styles); + const styles_layout: style.Set.Layout = .init(cap.styles); const styles_start = alignForward(usize, dirty_end, style.Set.base_align); const styles_end = styles_start + styles_layout.total_size; @@ -1739,7 +1739,7 @@ pub const Page = struct { const string_end = string_start + string_layout.total_size; const hyperlink_count = @divFloor(cap.hyperlink_bytes, @sizeOf(hyperlink.Set.Item)); - const hyperlink_set_layout = hyperlink.Set.layout(@intCast(hyperlink_count)); + const hyperlink_set_layout: hyperlink.Set.Layout = .init(@intCast(hyperlink_count)); const hyperlink_set_start = alignForward(usize, string_end, hyperlink.Set.base_align); const hyperlink_set_end = hyperlink_set_start + hyperlink_set_layout.total_size; @@ -1755,7 +1755,7 @@ pub const Page = struct { const hyperlink_map_start = alignForward(usize, hyperlink_set_end, hyperlink.Map.base_align); const hyperlink_map_end = hyperlink_map_start + hyperlink_map_layout.total_size; - const total_size = alignForward(usize, hyperlink_map_end, std.mem.page_size); + const total_size = alignForward(usize, hyperlink_map_end, std.heap.page_size_min); return .{ .total_size = total_size, @@ -2124,12 +2124,12 @@ pub const Cell = packed struct(u64) { // .styles = 128, // .grapheme_bytes = 1024, // }).total_size, -// std.mem.page_size, +// std.heap.page_size_min, // ); // // std.log.warn("total_size={} pages={}", .{ // total_size, -// total_size / std.mem.page_size, +// total_size / std.heap.page_size_min, // }); // } // @@ -2139,7 +2139,7 @@ pub const Cell = packed struct(u64) { // // so we fail a test if it changes. // const total_size = Page.layout(std_capacity).total_size; // try testing.expectEqual(@as(usize, 524_288), total_size); // 512 KiB -// //const pages = total_size / std.mem.page_size; +// //const pages = total_size / std.heap.page_size_min; // } test "Cell is zero by default" { diff --git a/src/terminal/parse_table.zig b/src/terminal/parse_table.zig index 66c443783..2c8ccf8fc 100644 --- a/src/terminal/parse_table.zig +++ b/src/terminal/parse_table.zig @@ -37,7 +37,7 @@ pub const Transition = struct { fn genTableType(comptime optional: bool) type { const max_u8 = std.math.maxInt(u8); const stateInfo = @typeInfo(State); - const max_state = stateInfo.Enum.fields.len; + const max_state = stateInfo.@"enum".fields.len; const Elem = if (optional) ?Transition else Transition; return [max_u8 + 1][max_state]Elem; } @@ -56,7 +56,7 @@ fn genTable() Table { // anywhere transitions const stateInfo = @typeInfo(State); - inline for (stateInfo.Enum.fields) |field| { + inline for (stateInfo.@"enum".fields) |field| { const source: State = @enumFromInt(field.value); // anywhere => ground diff --git a/src/terminal/ref_counted_set.zig b/src/terminal/ref_counted_set.zig index b674295dc..3c9ad49ba 100644 --- a/src/terminal/ref_counted_set.zig +++ b/src/terminal/ref_counted_set.zig @@ -132,60 +132,6 @@ pub fn RefCountedSet( /// An instance of the context structure. context: Context, - /// Returns the memory layout for the given base offset and - /// desired capacity. The layout can be used by the caller to - /// determine how much memory to allocate, and the layout must - /// be used to initialize the set so that the set knows all - /// the offsets for the various buffers. - /// - /// The capacity passed for cap will be used for the hash table, - /// which has a load factor of `0.8125` (13/16), so the number of - /// items which can actually be stored in the set will be smaller. - /// - /// The laid out capacity will be at least `cap`, but may be higher, - /// since it is rounded up to the next power of 2 for efficiency. - /// - /// The returned layout `cap` property will be 1 more than the number - /// of items that the set can actually store, since ID 0 is reserved. - pub fn layout(cap: usize) Layout { - // Experimentally, this load factor works quite well. - const load_factor = 0.8125; - - assert(cap <= @as(usize, @intCast(std.math.maxInt(Id))) + 1); - - // Zero-cap set is valid, return special case - if (cap == 0) return .{ - .cap = 0, - .table_cap = 0, - .table_mask = 0, - .table_start = 0, - .items_start = 0, - .total_size = 0, - }; - - const table_cap: usize = std.math.ceilPowerOfTwoAssert(usize, cap); - const items_cap: usize = @intFromFloat(load_factor * @as(f64, @floatFromInt(table_cap))); - - const table_mask: Id = @intCast((@as(usize, 1) << std.math.log2_int(usize, table_cap)) - 1); - - const table_start = 0; - const table_end = table_start + table_cap * @sizeOf(Id); - - const items_start = std.mem.alignForward(usize, table_end, @alignOf(Item)); - const items_end = items_start + items_cap * @sizeOf(Item); - - const total_size = items_end; - - return .{ - .cap = items_cap, - .table_cap = table_cap, - .table_mask = table_mask, - .table_start = table_start, - .items_start = items_start, - .total_size = total_size, - }; - } - pub const Layout = struct { cap: usize, table_cap: usize, @@ -193,6 +139,60 @@ pub fn RefCountedSet( table_start: usize, items_start: usize, total_size: usize, + + /// Returns the memory layout for the given base offset and + /// desired capacity. The layout can be used by the caller to + /// determine how much memory to allocate, and the layout must + /// be used to initialize the set so that the set knows all + /// the offsets for the various buffers. + /// + /// The capacity passed for cap will be used for the hash table, + /// which has a load factor of `0.8125` (13/16), so the number of + /// items which can actually be stored in the set will be smaller. + /// + /// The laid out capacity will be at least `cap`, but may be higher, + /// since it is rounded up to the next power of 2 for efficiency. + /// + /// The returned layout `cap` property will be 1 more than the number + /// of items that the set can actually store, since ID 0 is reserved. + pub fn init(cap: usize) Layout { + // Experimentally, this load factor works quite well. + const load_factor = 0.8125; + + assert(cap <= @as(usize, @intCast(std.math.maxInt(Id))) + 1); + + // Zero-cap set is valid, return special case + if (cap == 0) return .{ + .cap = 0, + .table_cap = 0, + .table_mask = 0, + .table_start = 0, + .items_start = 0, + .total_size = 0, + }; + + const table_cap: usize = std.math.ceilPowerOfTwoAssert(usize, cap); + const items_cap: usize = @intFromFloat(load_factor * @as(f64, @floatFromInt(table_cap))); + + const table_mask: Id = @intCast((@as(usize, 1) << std.math.log2_int(usize, table_cap)) - 1); + + const table_start = 0; + const table_end = table_start + table_cap * @sizeOf(Id); + + const items_start = std.mem.alignForward(usize, table_end, @alignOf(Item)); + const items_end = items_start + items_cap * @sizeOf(Item); + + const total_size = items_end; + + return .{ + .cap = items_cap, + .table_cap = table_cap, + .table_mask = table_mask, + .table_start = table_start, + .items_start = items_start, + .total_size = total_size, + }; + } }; pub fn init(base: OffsetBuf, l: Layout, context: Context) Self { diff --git a/src/terminal/size.zig b/src/terminal/size.zig index ffa61e6be..6cedfdf6d 100644 --- a/src/terminal/size.zig +++ b/src/terminal/size.zig @@ -132,13 +132,13 @@ pub fn getOffset( fn intFromBase(base: anytype) usize { const T = @TypeOf(base); return switch (@typeInfo(T)) { - .Pointer => |v| switch (v.size) { - .One, - .Many, - .C, + .pointer => |v| switch (v.size) { + .one, + .many, + .c, => @intFromPtr(base), - .Slice => @intFromPtr(base.ptr), + .slice => @intFromPtr(base.ptr), }, else => switch (T) { diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index 3d9ed72fb..f1d66eab5 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -42,7 +42,7 @@ pub fn Stream(comptime Handler: type) type { // We use T with @hasDecl so it needs to be a struct. Unwrap the // pointer if we were given one. const T = switch (@typeInfo(Handler)) { - .Pointer => |p| p.child, + .pointer => |p| p.child, else => Handler, }; diff --git a/src/terminal/style.zig b/src/terminal/style.zig index 6c1f8b608..7f176561b 100644 --- a/src/terminal/style.zig +++ b/src/terminal/style.zig @@ -343,7 +343,7 @@ pub const Set = RefCountedSet( test "Set basic usage" { const testing = std.testing; const alloc = testing.allocator; - const layout = Set.layout(16); + const layout: Set.Layout = .init(16); const buf = try alloc.alignedAlloc(u8, Set.base_align, layout.total_size); defer alloc.free(buf); @@ -397,5 +397,5 @@ test "Set basic usage" { test "Set capacities" { // We want to support at least this many styles without overflowing. - _ = Set.layout(16384); + _ = Set.Layout.init(16384); } diff --git a/src/terminal/x11_color.zig b/src/terminal/x11_color.zig index f6413f96e..88bc30f09 100644 --- a/src/terminal/x11_color.zig +++ b/src/terminal/x11_color.zig @@ -8,7 +8,7 @@ pub const map = colorMap() catch @compileError("failed to parse rgb.txt"); pub const ColorMap = std.StaticStringMapWithEql(RGB, std.static_string_map.eqlAsciiIgnoreCase); fn colorMap() !ColorMap { - @setEvalBranchQuota(100_000); + @setEvalBranchQuota(500_000); const KV = struct { []const u8, RGB }; diff --git a/src/terminfo/Source.zig b/src/terminfo/Source.zig index 1012cb010..8ffd9cabb 100644 --- a/src/terminfo/Source.zig +++ b/src/terminfo/Source.zig @@ -233,12 +233,10 @@ test "encode" { try src.encode(buf_stream.writer()); const expected = - \\ghostty|xterm-ghostty|Ghostty, - \\ am, - \\ ccc@, - \\ colors#256, - \\ bel=^G, - \\ - ; + "ghostty|xterm-ghostty|Ghostty,\n" ++ + "\tam,\n" ++ + "\tccc@,\n" ++ + "\tcolors#256,\n" ++ + "\tbel=^G,\n"; try std.testing.expectEqualStrings(@as([]const u8, expected), buf_stream.getWritten()); } diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 770420f0c..c83757e8c 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -301,7 +301,7 @@ pub fn childExitedAbnormally( // We don't print this on macOS because the exit code is always 0 // due to the way we launch the process. - if (comptime !builtin.target.isDarwin()) { + if (comptime !builtin.target.os.tag.isDarwin()) { const exit_code_str = try std.fmt.allocPrint(alloc, "{d}", .{exit_code}); t.carriageReturn(); try t.linefeed(); @@ -369,7 +369,7 @@ fn processExit( if (runtime_ms) |runtime| runtime: { // On macOS, our exit code detection doesn't work, possibly // because of our `login` wrapper. More investigation required. - if (comptime !builtin.target.isDarwin()) { + if (comptime !builtin.target.os.tag.isDarwin()) { // If our exit code is zero, then the command was successful // and we don't ever consider it abnormal. if (exit_code == 0) break :runtime; @@ -751,7 +751,7 @@ const Subprocess = struct { }); try env.put("TERMINFO", dir); } else { - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { log.warn("ghostty terminfo not found, using xterm-256color", .{}); log.warn("the terminfo SHOULD exist on macos, please ensure", .{}); log.warn("you're using a valid app bundle.", .{}); @@ -797,7 +797,7 @@ const Subprocess = struct { // On macOS, export additional data directories from our // application bundle. - if (comptime builtin.target.isDarwin()) darwin: { + if (comptime builtin.target.os.tag.isDarwin()) darwin: { const resources_dir = cfg.resources_dir orelse break :darwin; var buf: [std.fs.max_path_bytes]u8 = undefined; @@ -908,7 +908,7 @@ const Subprocess = struct { // If we're on macOS, we have to use `login(1)` to get all of // the proper environment variables set, a login shell, and proper // hushlogin behavior. - if (comptime builtin.target.isDarwin()) darwin: { + if (comptime builtin.target.os.tag.isDarwin()) darwin: { const passwd = internal_os.passwd.get(alloc) catch |err| { log.warn("failed to read passwd, not using a login shell err={}", .{err}); break :darwin; @@ -1289,7 +1289,7 @@ const Subprocess = struct { switch (posix.errno(c.killpg(pgid, c.SIGHUP))) { .SUCCESS => log.debug("process group killed pgid={}", .{pgid}), else => |err| killpg: { - if ((comptime builtin.target.isDarwin()) and + if ((comptime builtin.target.os.tag.isDarwin()) and err == .PERM) { log.debug("killpg failed with EPERM, expected on Darwin and ignoring", .{}); diff --git a/src/termio/Termio.zig b/src/termio/Termio.zig index 1d125f049..ecfb9951e 100644 --- a/src/termio/Termio.zig +++ b/src/termio/Termio.zig @@ -16,7 +16,7 @@ const termio = @import("../termio.zig"); const Command = @import("../Command.zig"); const Pty = @import("../pty.zig").Pty; const StreamHandler = @import("stream_handler.zig").StreamHandler; -const terminal = @import("../terminal/main.zig"); +const terminalpkg = @import("../terminal/main.zig"); const terminfo = @import("../terminfo/main.zig"); const xev = @import("../global.zig").xev; const renderer = @import("../renderer.zig"); @@ -41,7 +41,7 @@ config: DerivedConfig, /// The terminal emulator internal state. This is the abstract "terminal" /// that manages input, grid updating, etc. and is renderer-agnostic. It /// just stores internal state about a grid. -terminal: terminal.Terminal, +terminal: terminalpkg.Terminal, /// The shared render state renderer_state: *renderer.State, @@ -64,7 +64,7 @@ mailbox: termio.Mailbox, /// The stream parser. This parses the stream of escape codes and so on /// from the child process and calls callbacks in the stream handler. -terminal_stream: terminal.Stream(StreamHandler), +terminal_stream: terminalpkg.Stream(StreamHandler), /// Last time the cursor was reset. This is used to prevent message /// flooding with cursor resets. @@ -76,9 +76,9 @@ last_cursor_reset: ?std.time.Instant = null, pub const DerivedConfig = struct { arena: ArenaAllocator, - palette: terminal.color.Palette, + palette: terminalpkg.color.Palette, image_storage_limit: usize, - cursor_style: terminal.CursorStyle, + cursor_style: terminalpkg.CursorStyle, cursor_blink: ?bool, cursor_color: ?configpkg.Config.Color, cursor_invert: bool, @@ -128,8 +128,8 @@ pub const DerivedConfig = struct { /// to run a child process. pub fn init(self: *Termio, alloc: Allocator, opts: termio.Options) !void { // The default terminal modes based on our config. - const default_modes: terminal.ModePacked = modes: { - var modes: terminal.ModePacked = .{}; + const default_modes: terminalpkg.ModePacked = modes: { + var modes: terminalpkg.ModePacked = .{}; // Setup our initial grapheme cluster support if enabled. We use a // switch to ensure we get a compiler error if more cases are added. @@ -145,7 +145,7 @@ pub fn init(self: *Termio, alloc: Allocator, opts: termio.Options) !void { }; // Create our terminal - var term = try terminal.Terminal.init(alloc, opts: { + var term = try terminalpkg.Terminal.init(alloc, opts: { const grid_size = opts.size.grid(); break :opts .{ .cols = grid_size.columns, @@ -510,7 +510,7 @@ pub fn clearScreen(self: *Termio, td: *ThreadData, history: bool) !void { } /// Scroll the viewport -pub fn scrollViewport(self: *Termio, scroll: terminal.Terminal.ScrollViewport) !void { +pub fn scrollViewport(self: *Termio, scroll: terminalpkg.Terminal.ScrollViewport) !void { self.renderer_state.mutex.lock(); defer self.renderer_state.mutex.unlock(); try self.terminal.scrollViewport(scroll); diff --git a/src/termio/message.zig b/src/termio/message.zig index 44381b228..42767e109 100644 --- a/src/termio/message.zig +++ b/src/termio/message.zig @@ -139,8 +139,8 @@ pub fn MessageData(comptime Elem: type, comptime small_size: comptime_int) type /// This can't and will never detect stable pointers. pub fn init(alloc: Allocator, data: anytype) !Self { switch (@typeInfo(@TypeOf(data))) { - .Pointer => |info| { - assert(info.size == .Slice); + .pointer => |info| { + assert(info.size == .slice); assert(info.child == Elem); // If it fits in our small request, do that. diff --git a/src/termio/shell_integration.zig b/src/termio/shell_integration.zig index 423e2f518..4bbf0a3b5 100644 --- a/src/termio/shell_integration.zig +++ b/src/termio/shell_integration.zig @@ -82,7 +82,7 @@ fn setupShell( // If we're running "/bin/bash" on Darwin, we can assume // we're using Apple's Bash because /bin is non-writable // on modern macOS due to System Integrity Protection. - if (comptime builtin.target.isDarwin()) { + if (comptime builtin.target.os.tag.isDarwin()) { if (std.mem.eql(u8, "/bin/bash", command)) { return null; } @@ -137,7 +137,7 @@ test "force shell" { var env = EnvMap.init(alloc); defer env.deinit(); - inline for (@typeInfo(Shell).Enum.fields) |field| { + inline for (@typeInfo(Shell).@"enum".fields) |field| { const shell = @field(Shell, field.name); const result = try setup(alloc, ".", "sh", &env, shell, .{}); try testing.expectEqual(shell, result.?.shell); diff --git a/src/unicode/grapheme.zig b/src/unicode/grapheme.zig index 25061b5ef..7847ef6f5 100644 --- a/src/unicode/grapheme.zig +++ b/src/unicode/grapheme.zig @@ -52,7 +52,7 @@ const Precompute = struct { var result: [std.math.maxInt(u10)]Value = undefined; @setEvalBranchQuota(3_000); - const info = @typeInfo(GraphemeBoundaryClass).Enum; + const info = @typeInfo(GraphemeBoundaryClass).@"enum"; for (0..std.math.maxInt(u2) + 1) |state_init| { for (info.fields) |field1| { for (info.fields) |field2| { diff --git a/typos.toml b/typos.toml index d449e3ffa..d1aab1b2c 100644 --- a/typos.toml +++ b/typos.toml @@ -1,5 +1,9 @@ [files] extend-exclude = [ + # Build + "build.zig.zon", + "build.zig.zon.nix", + "build.zig.zon2json-lock", # vendored code "vendor/*", "pkg/*",