Replaces #8372 

Before merge I'm going to squash this and give @pluiedev coauthor, since
I took a lot of her work. I just have to go through this myself to make
sure I learn all the changes in Zig 0.15, but as I got things, I copy
and pasted her work in. My work is probably less thorough and there are
places we can convert deprecated things, probably, but this results in
green CI.

## Benchmarks

It looks like there are some speed regressions in isolated places. I'm
not sure if this is noise or not, I'm going to keep running some tests.
If someone can check macOS that'd be helpful (my vtebench is down on
macOS atm), cc @qwerasd205 if interested.

On an x86_64 system:


![output](https://github.com/user-attachments/assets/25395c18-2560-45c8-9fd3-d524bc5cbfb8)
This commit is contained in:
Mitchell Hashimoto
2025-10-03 07:12:12 -07:00
committed by GitHub
183 changed files with 2574 additions and 2217 deletions

View File

@@ -14,7 +14,6 @@ jobs:
- build-dist
- build-examples
- build-flatpak
- build-freebsd
- build-libghostty-vt
- build-linux
- build-linux-libghostty
@@ -333,7 +332,7 @@ jobs:
run: nix build .#ghostty-releasefast
- name: Check version
run: result/bin/ghostty +version | grep -q 'builtin.OptimizeMode.ReleaseFast'
run: result/bin/ghostty +version | grep -q '.ReleaseFast'
- name: Check to see if the binary has been stripped
run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'no symbols'
@@ -342,7 +341,7 @@ jobs:
run: nix build .#ghostty-debug
- name: Check version
run: result/bin/ghostty +version | grep -q 'builtin.OptimizeMode.Debug'
run: result/bin/ghostty +version | grep -q '.Debug'
- name: Check to see if the binary has not been stripped
run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'main_ghostty.main'
@@ -513,7 +512,7 @@ jobs:
$fileContent = Get-Content -Path "build.zig" -Raw
$pattern = 'buildpkg\.requireZig\("(.*?)"\);'
$zigVersion = [regex]::Match($fileContent, $pattern).Groups[1].Value
$version = "zig-windows-x86_64-$zigVersion"
$version = "zig-x86_64-windows-$zigVersion"
Write-Output $version
$uri = "https://ziglang.org/download/$zigVersion/$version.zip"
Invoke-WebRequest -Uri "$uri" -OutFile ".\zig-windows.zip"
@@ -1138,6 +1137,7 @@ jobs:
name: Build on FreeBSD
needs: test
runs-on: namespace-profile-mitchellh-sm-systemd
if: false # FIXME: FreeBSD does not yet ship with Zig 0.15
strategy:
matrix:
release:

View File

@@ -4,7 +4,7 @@ const builtin = @import("builtin");
const buildpkg = @import("src/build/main.zig");
comptime {
buildpkg.requireZig("0.14.0");
buildpkg.requireZig("0.15.1");
}
pub fn build(b: *std.Build) !void {
@@ -249,8 +249,6 @@ pub fn build(b: *std.Build) !void {
{
const mod_vt_test = b.addTest(.{
.root_module = mod.vt,
.target = config.target,
.optimize = config.optimize,
.filters = test_filters,
});
const mod_vt_test_run = b.addRunArtifact(mod_vt_test);
@@ -258,8 +256,6 @@ pub fn build(b: *std.Build) !void {
const mod_vt_c_test = b.addTest(.{
.root_module = mod.vt_c,
.target = config.target,
.optimize = config.optimize,
.filters = test_filters,
});
const mod_vt_c_test_run = b.addRunArtifact(mod_vt_c_test);
@@ -280,6 +276,8 @@ pub fn build(b: *std.Build) !void {
.omit_frame_pointer = false,
.unwind_tables = .sync,
}),
// Crash on x86_64 without this
.use_llvm = true,
});
if (config.emit_test_exe) b.installArtifact(test_exe);
_ = try deps.add(test_exe);
@@ -289,7 +287,7 @@ pub fn build(b: *std.Build) !void {
test_step.dependOn(&test_run.step);
// Normal tests always test our libghostty modules
test_step.dependOn(test_lib_vt_step);
//test_step.dependOn(test_lib_vt_step);
// Valgrind test running
const valgrind_run = b.addSystemCommand(&.{

View File

@@ -3,54 +3,55 @@
.version = "1.2.1",
.paths = .{""},
.fingerprint = 0x64407a2a0b4147e5,
.minimum_zig_version = "0.14.1",
.minimum_zig_version = "0.15.1",
.dependencies = .{
// Zig libs
.libxev = .{
// mitchellh/libxev
.url = "https://github.com/mitchellh/libxev/archive/7f803181b158a10fec8619f793e3b4df515566cb.tar.gz",
.hash = "libxev-0.0.0-86vtc2UaEwDfiTKX3iBI-s_hdzfzWQUarT3MUrmUQl-Q",
.url = "https://github.com/mitchellh/libxev/archive/34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz",
.hash = "libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs",
.lazy = true,
},
.vaxis = .{
// rockorager/libvaxis
.url = "git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23",
.hash = "vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn",
.url = "https://github.com/rockorager/libvaxis/archive/9fc9015d5f147568e18c5e7ca28f15bf8b293760.tar.gz",
.hash = "vaxis-0.5.1-BWNV_O8fCQAeUeVrESVc-2BdXloEXkFqReDJL7Q6XTSZ",
.lazy = true,
},
.z2d = .{
// vancluever/z2d
.url = "https://github.com/vancluever/z2d/archive/refs/tags/v0.8.1.tar.gz",
.hash = "z2d-0.8.1-j5P_Hq8vDwB8ZaDA54-SzESDLF2zznG_zvTHiQNJImZP",
.url = "https://github.com/vancluever/z2d/archive/a1237f6881d99b75abd8a20a934e62e34b44a005.tar.gz",
.hash = "z2d-0.8.2-pre-j5P_HlVRFgCsBTQ3EgUoKbYHx5JMnyH1mHsOSPiafnef",
.lazy = true,
},
.zig_objc = .{
// mitchellh/zig-objc
.url = "https://github.com/mitchellh/zig-objc/archive/c9e917a4e15a983b672ca779c7985d738a2d517c.tar.gz",
.hash = "zig_objc-0.0.0-Ir_SpwsPAQBJgi9YRm2ubJMfdoysSq5gKpsIj3izQ8Zk",
.url = "https://github.com/mitchellh/zig-objc/archive/f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz",
.hash = "zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK",
.lazy = true,
},
.zig_js = .{
// mitchellh/zig-js
.url = "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz",
.hash = "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ",
.url = "https://github.com/mitchellh/zig-js/archive/04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz",
.hash = "zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi",
.lazy = true,
},
.uucode = .{
.url = "https://github.com/jacobsandlund/uucode/archive/190706c6b56f0842d29778007f74f7d3d1335fc5.tar.gz",
.hash = "uucode-0.1.0-ZZjBPpAFQABNCvd9cVPBg4I7233Ays-NWfWphPNqGbyE",
// TODO: currently the use-llvm branch because its broken on self-hosted
.url = "https://github.com/jacobsandlund/uucode/archive/f81f8ef8518b8ec5a7fca30ec5fdbc76cc6197df.tar.gz",
.hash = "uucode-0.1.0-ZZjBPjQHQADuCy1VMWftjrMl3iWqgMpUugWVQJG6_7xT",
},
.zig_wayland = .{
// codeberg ifreund/zig-wayland
.url = "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz",
.hash = "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy",
.url = "https://codeberg.org/ifreund/zig-wayland/archive/1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz",
.hash = "wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe",
.lazy = true,
},
.zf = .{
// natecraddock/zf
.url = "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz",
.hash = "zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9",
.url = "https://github.com/jcollie/zf/archive/52ad2e5528ab754f77437edf08a07b5ec843661c.tar.gz",
.hash = "zf-0.10.3-OIRy8QGJAACJcu3tCGtfbJnnd3Y4QL7OW_X8PJ8u_ASR",
.lazy = true,
},
.gobject = .{

75
build.zig.zon.json generated
View File

@@ -64,10 +64,10 @@
"url": "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz",
"hash": "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo="
},
"libxev-0.0.0-86vtc2UaEwDfiTKX3iBI-s_hdzfzWQUarT3MUrmUQl-Q": {
"libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs": {
"name": "libxev",
"url": "https://github.com/mitchellh/libxev/archive/7f803181b158a10fec8619f793e3b4df515566cb.tar.gz",
"hash": "sha256-KaozYKEhhT/6sInef7/8O/60LDBJN+8QmdLuNY1Gkmc="
"url": "https://github.com/mitchellh/libxev/archive/34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz",
"hash": "sha256-YAPqa5bkpRihKPkyMn15oRvTCZaxO3O66ymRY3lIfdc="
},
"N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK": {
"name": "libxml2",
@@ -109,15 +109,20 @@
"url": "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz",
"hash": "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8="
},
"uucode-0.1.0-ZZjBPpAFQABNCvd9cVPBg4I7233Ays-NWfWphPNqGbyE": {
"uucode-0.1.0-ZZjBPjQHQADuCy1VMWftjrMl3iWqgMpUugWVQJG6_7xT": {
"name": "uucode",
"url": "https://github.com/jacobsandlund/uucode/archive/190706c6b56f0842d29778007f74f7d3d1335fc5.tar.gz",
"hash": "sha256-iq9Oyns5e5Tnz2BKPPPTuyJ03BN4bK0dsmSPE1s0wig="
"url": "https://github.com/jacobsandlund/uucode/archive/f81f8ef8518b8ec5a7fca30ec5fdbc76cc6197df.tar.gz",
"hash": "sha256-VomSYOF8fRJwb/8GtVG/QqR6c95zSkQt4649C/4KXAc="
},
"vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn": {
"vaxis-0.5.1-BWNV_H0PCQAeMusmtLzh9P9xO2IW242GZ2IRe9iKYhcA": {
"name": "vaxis",
"url": "git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23",
"hash": "sha256-bNZ3oveT6vPChjimPJ/GGfcdivlAeJdl/xfWM+S/MHY="
"url": "https://github.com/rockorager/libvaxis/archive/1bf887aa7e3736bad69fd4e277a378946edb0f2a.tar.gz",
"hash": "sha256-eq5YC26OY0i2cdQJ0ZXMZ+o2vHQLEFNNGzQt5Zuz4BM="
},
"vaxis-0.5.1-BWNV_O8fCQAeUeVrESVc-2BdXloEXkFqReDJL7Q6XTSZ": {
"name": "vaxis",
"url": "https://github.com/rockorager/libvaxis/archive/9fc9015d5f147568e18c5e7ca28f15bf8b293760.tar.gz",
"hash": "sha256-7H5a0J7uUsrzlO7JNAf/Ussi9WxvmsbyJSmhqvl+rqI="
},
"N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t": {
"name": "wayland",
@@ -134,40 +139,50 @@
"url": "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
"hash": "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM="
},
"z2d-0.8.1-j5P_Hq8vDwB8ZaDA54-SzESDLF2zznG_zvTHiQNJImZP": {
"z2d-0.8.2-pre-j5P_HlVRFgCsBTQ3EgUoKbYHx5JMnyH1mHsOSPiafnef": {
"name": "z2d",
"url": "https://github.com/vancluever/z2d/archive/refs/tags/v0.8.1.tar.gz",
"hash": "sha256-0DbDKSYA1ejhVx/WbOkwTgD57PNRFcnRviqBh8xpPZ0="
"url": "https://github.com/vancluever/z2d/archive/a1237f6881d99b75abd8a20a934e62e34b44a005.tar.gz",
"hash": "sha256-5/qRZAIh1U42v7jql9W0jr2zzQZtu39DxJPLVrSybJg="
},
"zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9": {
"zf-0.10.3-OIRy8QGJAACJcu3tCGtfbJnnd3Y4QL7OW_X8PJ8u_ASR": {
"name": "zf",
"url": "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz",
"hash": "sha256-3nulNQd/4rZ4paeXJYXwAliNNyRNsIOX/q3z1JB8C7I="
"url": "https://github.com/jcollie/zf/archive/52ad2e5528ab754f77437edf08a07b5ec843661c.tar.gz",
"hash": "sha256-8BinbanSfZeBA8SBAopVxwJObN36/BTpxVHABKicsMQ="
},
"zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM": {
"zg-0.14.1-oGqU3J4_tAKBfyes3AWleKDjo-IcYvnEwaB8qxOqFMwM": {
"name": "zg",
"url": "git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc",
"hash": "sha256-fo3l6cjkrr/godElTGnQzalBsasN7J73IDIRmw7v1gA="
"url": "git+https://codeberg.org/ivanstepanovftw/zg#4fe689e56ce2ed5a8f59308b471bccd7da89fac9",
"hash": "sha256-P0ieLuOQ05wKVaMmeNKJIxCWMIdyeKkmhsj8Ps80BGU="
},
"N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ": {
"zg-0.15.1-oGqU3M0-tALZCy7boQS86znlBloyKx6--JriGlY0Paa9": {
"name": "zg",
"url": "https://codeberg.org/chaten/zg/archive/749197a3f9d25e211615960c02380a3d659b20f9.tar.gz",
"hash": "sha256-BZhz1nPqxK6hdsJQ66n7Jk4zMgFSGLXm8eU0CX/7mDI="
},
"zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi": {
"name": "zig_js",
"url": "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz",
"hash": "sha256-fyNeCVbC9UAaKJY6JhAZlT0A479M/AKYMPIWEZbDWD0="
"url": "https://github.com/mitchellh/zig-js/archive/04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz",
"hash": "sha256-TCAY5WAV05UEuAkDhq2c6Tk/ODgAhdnDI3O/flb8c6M="
},
"zig_objc-0.0.0-Ir_SpwsPAQBJgi9YRm2ubJMfdoysSq5gKpsIj3izQ8Zk": {
"zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK": {
"name": "zig_objc",
"url": "https://github.com/mitchellh/zig-objc/archive/c9e917a4e15a983b672ca779c7985d738a2d517c.tar.gz",
"hash": "sha256-o3vl7qfkSi0bKXa6JWuF92qMEGP8Af/shcip5nRo5Nw="
"url": "https://github.com/mitchellh/zig-objc/archive/f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz",
"hash": "sha256-3YSvc3YlNW/NciyzCQnzsujXAmZ89XlxSqfqvArAjsw="
},
"wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy": {
"wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe": {
"name": "zig_wayland",
"url": "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz",
"hash": "sha256-E77GZ15APYbbO1WzmuJi8eG9/iQFbc2CgkNBxjCLUhk="
"url": "https://codeberg.org/ifreund/zig-wayland/archive/1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz",
"hash": "sha256-TxRrc17Q1Sf1IOO/cdPpP3LD0PpYOujt06SFH3B5Ek4="
},
"zigimg-0.1.0-lly-O6N2EABOxke8dqyzCwhtUCAafqP35zC7wsZ4Ddxj": {
"zigimg-0.1.0-8_eo2mWmEgBoqdr0sH9O5GTqDHthkoEPM5_tipcBRreL": {
"name": "zigimg",
"url": "git+https://github.com/TUSF/zigimg#31268548fe3276c0e95f318a6c0d2ab10565b58d",
"hash": "sha256-oblfr2FIzuqq0FLo/RrzCwUX1NJJuT53EwD3nP3KwN0="
"url": "git+https://github.com/ivanstepanovftw/zigimg#aa4c31db872612c39edbb79f753b3cd9a79fe726",
"hash": "sha256-Ko5RuxxTAvpUHCnWEdHqNl7b+PVUAxg1/OPmzGGjdt0="
},
"zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms": {
"name": "zigimg",
"url": "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz",
"hash": "sha256-LB7Xa6KzVRRUSwwnyWM+y6fDG+kIDjfnoBDJO1obxVM="
},
"N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o": {
"name": "zlib",

84
build.zig.zon.nix generated
View File

@@ -187,11 +187,11 @@ in
};
}
{
name = "libxev-0.0.0-86vtc2UaEwDfiTKX3iBI-s_hdzfzWQUarT3MUrmUQl-Q";
name = "libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs";
path = fetchZigArtifact {
name = "libxev";
url = "https://github.com/mitchellh/libxev/archive/7f803181b158a10fec8619f793e3b4df515566cb.tar.gz";
hash = "sha256-KaozYKEhhT/6sInef7/8O/60LDBJN+8QmdLuNY1Gkmc=";
url = "https://github.com/mitchellh/libxev/archive/34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz";
hash = "sha256-YAPqa5bkpRihKPkyMn15oRvTCZaxO3O66ymRY3lIfdc=";
};
}
{
@@ -259,19 +259,27 @@ in
};
}
{
name = "uucode-0.1.0-ZZjBPpAFQABNCvd9cVPBg4I7233Ays-NWfWphPNqGbyE";
name = "uucode-0.1.0-ZZjBPjQHQADuCy1VMWftjrMl3iWqgMpUugWVQJG6_7xT";
path = fetchZigArtifact {
name = "uucode";
url = "https://github.com/jacobsandlund/uucode/archive/190706c6b56f0842d29778007f74f7d3d1335fc5.tar.gz";
hash = "sha256-iq9Oyns5e5Tnz2BKPPPTuyJ03BN4bK0dsmSPE1s0wig=";
url = "https://github.com/jacobsandlund/uucode/archive/f81f8ef8518b8ec5a7fca30ec5fdbc76cc6197df.tar.gz";
hash = "sha256-VomSYOF8fRJwb/8GtVG/QqR6c95zSkQt4649C/4KXAc=";
};
}
{
name = "vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn";
name = "vaxis-0.5.1-BWNV_H0PCQAeMusmtLzh9P9xO2IW242GZ2IRe9iKYhcA";
path = fetchZigArtifact {
name = "vaxis";
url = "git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23";
hash = "sha256-bNZ3oveT6vPChjimPJ/GGfcdivlAeJdl/xfWM+S/MHY=";
url = "https://github.com/rockorager/libvaxis/archive/1bf887aa7e3736bad69fd4e277a378946edb0f2a.tar.gz";
hash = "sha256-eq5YC26OY0i2cdQJ0ZXMZ+o2vHQLEFNNGzQt5Zuz4BM=";
};
}
{
name = "vaxis-0.5.1-BWNV_O8fCQAeUeVrESVc-2BdXloEXkFqReDJL7Q6XTSZ";
path = fetchZigArtifact {
name = "vaxis";
url = "https://github.com/rockorager/libvaxis/archive/9fc9015d5f147568e18c5e7ca28f15bf8b293760.tar.gz";
hash = "sha256-7H5a0J7uUsrzlO7JNAf/Ussi9WxvmsbyJSmhqvl+rqI=";
};
}
{
@@ -299,59 +307,75 @@ in
};
}
{
name = "z2d-0.8.1-j5P_Hq8vDwB8ZaDA54-SzESDLF2zznG_zvTHiQNJImZP";
name = "z2d-0.8.2-pre-j5P_HlVRFgCsBTQ3EgUoKbYHx5JMnyH1mHsOSPiafnef";
path = fetchZigArtifact {
name = "z2d";
url = "https://github.com/vancluever/z2d/archive/refs/tags/v0.8.1.tar.gz";
hash = "sha256-0DbDKSYA1ejhVx/WbOkwTgD57PNRFcnRviqBh8xpPZ0=";
url = "https://github.com/vancluever/z2d/archive/a1237f6881d99b75abd8a20a934e62e34b44a005.tar.gz";
hash = "sha256-5/qRZAIh1U42v7jql9W0jr2zzQZtu39DxJPLVrSybJg=";
};
}
{
name = "zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9";
name = "zf-0.10.3-OIRy8QGJAACJcu3tCGtfbJnnd3Y4QL7OW_X8PJ8u_ASR";
path = fetchZigArtifact {
name = "zf";
url = "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz";
hash = "sha256-3nulNQd/4rZ4paeXJYXwAliNNyRNsIOX/q3z1JB8C7I=";
url = "https://github.com/jcollie/zf/archive/52ad2e5528ab754f77437edf08a07b5ec843661c.tar.gz";
hash = "sha256-8BinbanSfZeBA8SBAopVxwJObN36/BTpxVHABKicsMQ=";
};
}
{
name = "zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM";
name = "zg-0.14.1-oGqU3J4_tAKBfyes3AWleKDjo-IcYvnEwaB8qxOqFMwM";
path = fetchZigArtifact {
name = "zg";
url = "git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc";
hash = "sha256-fo3l6cjkrr/godElTGnQzalBsasN7J73IDIRmw7v1gA=";
url = "git+https://codeberg.org/ivanstepanovftw/zg#4fe689e56ce2ed5a8f59308b471bccd7da89fac9";
hash = "sha256-P0ieLuOQ05wKVaMmeNKJIxCWMIdyeKkmhsj8Ps80BGU=";
};
}
{
name = "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ";
name = "zg-0.15.1-oGqU3M0-tALZCy7boQS86znlBloyKx6--JriGlY0Paa9";
path = fetchZigArtifact {
name = "zg";
url = "https://codeberg.org/chaten/zg/archive/749197a3f9d25e211615960c02380a3d659b20f9.tar.gz";
hash = "sha256-BZhz1nPqxK6hdsJQ66n7Jk4zMgFSGLXm8eU0CX/7mDI=";
};
}
{
name = "zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi";
path = fetchZigArtifact {
name = "zig_js";
url = "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz";
hash = "sha256-fyNeCVbC9UAaKJY6JhAZlT0A479M/AKYMPIWEZbDWD0=";
url = "https://github.com/mitchellh/zig-js/archive/04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz";
hash = "sha256-TCAY5WAV05UEuAkDhq2c6Tk/ODgAhdnDI3O/flb8c6M=";
};
}
{
name = "zig_objc-0.0.0-Ir_SpwsPAQBJgi9YRm2ubJMfdoysSq5gKpsIj3izQ8Zk";
name = "zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK";
path = fetchZigArtifact {
name = "zig_objc";
url = "https://github.com/mitchellh/zig-objc/archive/c9e917a4e15a983b672ca779c7985d738a2d517c.tar.gz";
hash = "sha256-o3vl7qfkSi0bKXa6JWuF92qMEGP8Af/shcip5nRo5Nw=";
url = "https://github.com/mitchellh/zig-objc/archive/f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz";
hash = "sha256-3YSvc3YlNW/NciyzCQnzsujXAmZ89XlxSqfqvArAjsw=";
};
}
{
name = "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy";
name = "wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe";
path = fetchZigArtifact {
name = "zig_wayland";
url = "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz";
hash = "sha256-E77GZ15APYbbO1WzmuJi8eG9/iQFbc2CgkNBxjCLUhk=";
url = "https://codeberg.org/ifreund/zig-wayland/archive/1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz";
hash = "sha256-TxRrc17Q1Sf1IOO/cdPpP3LD0PpYOujt06SFH3B5Ek4=";
};
}
{
name = "zigimg-0.1.0-lly-O6N2EABOxke8dqyzCwhtUCAafqP35zC7wsZ4Ddxj";
name = "zigimg-0.1.0-8_eo2mWmEgBoqdr0sH9O5GTqDHthkoEPM5_tipcBRreL";
path = fetchZigArtifact {
name = "zigimg";
url = "git+https://github.com/TUSF/zigimg#31268548fe3276c0e95f318a6c0d2ab10565b58d";
hash = "sha256-oblfr2FIzuqq0FLo/RrzCwUX1NJJuT53EwD3nP3KwN0=";
url = "git+https://github.com/ivanstepanovftw/zigimg#aa4c31db872612c39edbb79f753b3cd9a79fe726";
hash = "sha256-Ko5RuxxTAvpUHCnWEdHqNl7b+PVUAxg1/OPmzGGjdt0=";
};
}
{
name = "zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms";
path = fetchZigArtifact {
name = "zigimg";
url = "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz";
hash = "sha256-LB7Xa6KzVRRUSwwnyWM+y6fDG+kIDjfnoBDJO1obxVM=";
};
}
{

23
build.zig.zon.txt generated
View File

@@ -1,7 +1,7 @@
git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc
git+https://github.com/TUSF/zigimg#31268548fe3276c0e95f318a6c0d2ab10565b58d
git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23
https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz
git+https://codeberg.org/ivanstepanovftw/zg#4fe689e56ce2ed5a8f59308b471bccd7da89fac9
git+https://github.com/ivanstepanovftw/zigimg#aa4c31db872612c39edbb79f753b3cd9a79fe726
https://codeberg.org/chaten/zg/archive/749197a3f9d25e211615960c02380a3d659b20f9.tar.gz
https://codeberg.org/ifreund/zig-wayland/archive/1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz
https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz
https://deps.files.ghostty.org/NerdFontsSymbolsOnly-3.4.0.tar.gz
https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz
@@ -24,12 +24,15 @@ 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/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz
https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz
https://github.com/ghostty-org/zig-gobject/releases/download/2025-09-20-20-1/ghostty-gobject-2025-09-20-20-1.tar.zst
https://github.com/jacobsandlund/uucode/archive/190706c6b56f0842d29778007f74f7d3d1335fc5.tar.gz
https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz
https://github.com/jacobsandlund/uucode/archive/f81f8ef8518b8ec5a7fca30ec5fdbc76cc6197df.tar.gz
https://github.com/jcollie/zf/archive/52ad2e5528ab754f77437edf08a07b5ec843661c.tar.gz
https://github.com/mbadolato/iTerm2-Color-Schemes/releases/download/release-20250922-150534-d28055b/ghostty-themes.tgz
https://github.com/mitchellh/libxev/archive/7f803181b158a10fec8619f793e3b4df515566cb.tar.gz
https://github.com/mitchellh/zig-objc/archive/c9e917a4e15a983b672ca779c7985d738a2d517c.tar.gz
https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz
https://github.com/vancluever/z2d/archive/refs/tags/v0.8.1.tar.gz
https://github.com/mitchellh/libxev/archive/34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz
https://github.com/mitchellh/zig-js/archive/04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz
https://github.com/mitchellh/zig-objc/archive/f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz
https://github.com/rockorager/libvaxis/archive/1bf887aa7e3736bad69fd4e277a378946edb0f2a.tar.gz
https://github.com/rockorager/libvaxis/archive/9fc9015d5f147568e18c5e7ca28f15bf8b293760.tar.gz
https://github.com/vancluever/z2d/archive/a1237f6881d99b75abd8a20a934e62e34b44a005.tar.gz

View File

@@ -2,7 +2,7 @@
.name = .c_vt,
.version = "0.0.0",
.fingerprint = 0x413a8529b1255f9a,
.minimum_zig_version = "0.14.1",
.minimum_zig_version = "0.15.1",
.dependencies = .{
// Ghostty dependency. In reality, you'd probably use a URL-based
// dependency like the one showed (and commented out) below this one.

View File

@@ -2,7 +2,7 @@
.name = .zig_vt,
.version = "0.0.0",
.fingerprint = 0x6045575a7a8387e6,
.minimum_zig_version = "0.14.1",
.minimum_zig_version = "0.15.1",
.dependencies = .{
// Ghostty dependency. In reality, you'd probably use a URL-based
// dependency like the one showed (and commented out) below this one.

16
flake.lock generated
View File

@@ -36,15 +36,15 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1748189127,
"narHash": "sha256-zRDR+EbbeObu4V2X5QCd2Bk5eltfDlCr5yvhBwUT6pY=",
"rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334",
"lastModified": 315532800,
"narHash": "sha256-YwoXN6fthkakCFD7nXPcUK+rkNr6ZTNTuF8zdGaxZo0=",
"rev": "dc704e6102e76aad573f63b74c742cd96f8f1e6c",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.802491.7c43f080a7f2/nixexprs.tar.xz"
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre870318.dc704e6102e7/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz"
"url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_2": {
@@ -97,11 +97,11 @@
]
},
"locked": {
"lastModified": 1748261582,
"narHash": "sha256-3i0IL3s18hdDlbsf0/E+5kyPRkZwGPbSFngq5eToiAA=",
"lastModified": 1759192380,
"narHash": "sha256-0BWJgt4OSzxCESij5oo8WLWrPZ+1qLp8KUQe32QeV4Q=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "aafb1b093fb838f7a02613b719e85ec912914221",
"rev": "0bcd1401ed43d10f10cbded49624206553e92f57",
"type": "github"
},
"original": {

View File

@@ -5,7 +5,9 @@
# We want to stay as up to date as possible but need to be careful that the
# glibc versions used by our dependencies from Nix are compatible with the
# system glibc that the user is building for.
nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz";
#
# We are currently on unstable to get Zig 0.15 for our package.nix
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
flake-utils.url = "github:numtide/flake-utils";
# Used for shell.nix
@@ -47,7 +49,7 @@
pkgs = nixpkgs.legacyPackages.${system};
in {
devShell.${system} = pkgs.callPackage ./nix/devShell.nix {
zig = zig.packages.${system}."0.14.1";
zig = zig.packages.${system}."0.15.1";
wraptest = pkgs.callPackage ./nix/wraptest.nix {};
zon2nix = zon2nix;
};

View File

@@ -13,12 +13,12 @@ modules:
- chmod a+x /app/zig/zig
sources:
- type: archive
sha256: 24aeeec8af16c381934a6cd7d95c807a8cb2cf7df9fa40d359aa884195c4716c
url: https://ziglang.org/download/0.14.1/zig-x86_64-linux-0.14.1.tar.xz
sha256: c61c5da6edeea14ca51ecd5e4520c6f4189ef5250383db33d01848293bfafe05
url: https://ziglang.org/download/0.15.1/zig-x86_64-linux-0.15.1.tar.xz
only-arches: [x86_64]
- type: archive
sha256: f7a654acc967864f7a050ddacfaa778c7504a0eca8d2b678839c21eea47c992b
url: https://ziglang.org/download/0.14.1/zig-aarch64-linux-0.14.1.tar.xz
sha256: bb4a8d2ad735e7fba764c497ddf4243cb129fece4148da3222a7046d3f1f19fe
url: https://ziglang.org/download/0.15.1/zig-aarch64-linux-0.15.1.tar.xz
only-arches: [aarch64]
- name: bzip2-redirect

View File

@@ -79,9 +79,9 @@
},
{
"type": "archive",
"url": "https://github.com/mitchellh/libxev/archive/7f803181b158a10fec8619f793e3b4df515566cb.tar.gz",
"dest": "vendor/p/libxev-0.0.0-86vtc2UaEwDfiTKX3iBI-s_hdzfzWQUarT3MUrmUQl-Q",
"sha256": "29aa3360a121853ffab089de7fbffc3bfeb42c304937ef1099d2ee358d469267"
"url": "https://github.com/mitchellh/libxev/archive/34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz",
"dest": "vendor/p/libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs",
"sha256": "6003ea6b96e4a518a128f932327d79a11bd30996b13b73baeb29916379487dd7"
},
{
"type": "archive",
@@ -133,15 +133,21 @@
},
{
"type": "archive",
"url": "https://github.com/jacobsandlund/uucode/archive/190706c6b56f0842d29778007f74f7d3d1335fc5.tar.gz",
"dest": "vendor/p/uucode-0.1.0-ZZjBPpAFQABNCvd9cVPBg4I7233Ays-NWfWphPNqGbyE",
"sha256": "8aaf4eca7b397b94e7cf604a3cf3d3bb2274dc13786cad1db2648f135b34c228"
"url": "https://github.com/jacobsandlund/uucode/archive/f81f8ef8518b8ec5a7fca30ec5fdbc76cc6197df.tar.gz",
"dest": "vendor/p/uucode-0.1.0-ZZjBPjQHQADuCy1VMWftjrMl3iWqgMpUugWVQJG6_7xT",
"sha256": "56899260e17c7d12706fff06b551bf42a47a73de734a442de3ae3d0bfe0a5c07"
},
{
"type": "git",
"url": "https://github.com/rockorager/libvaxis",
"commit": "1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23",
"dest": "vendor/p/vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn"
"type": "archive",
"url": "https://github.com/rockorager/libvaxis/archive/1bf887aa7e3736bad69fd4e277a378946edb0f2a.tar.gz",
"dest": "vendor/p/vaxis-0.5.1-BWNV_H0PCQAeMusmtLzh9P9xO2IW242GZ2IRe9iKYhcA",
"sha256": "7aae580b6e8e6348b671d409d195cc67ea36bc740b10534d1b342de59bb3e013"
},
{
"type": "archive",
"url": "https://github.com/rockorager/libvaxis/archive/9fc9015d5f147568e18c5e7ca28f15bf8b293760.tar.gz",
"dest": "vendor/p/vaxis-0.5.1-BWNV_O8fCQAeUeVrESVc-2BdXloEXkFqReDJL7Q6XTSZ",
"sha256": "ec7e5ad09eee52caf394eec93407ff52cb22f56c6f9ac6f22529a1aaf97eaea2"
},
{
"type": "archive",
@@ -163,45 +169,57 @@
},
{
"type": "archive",
"url": "https://github.com/vancluever/z2d/archive/refs/tags/v0.8.1.tar.gz",
"dest": "vendor/p/z2d-0.8.1-j5P_Hq8vDwB8ZaDA54-SzESDLF2zznG_zvTHiQNJImZP",
"sha256": "d036c3292600d5e8e1571fd66ce9304e00f9ecf35115c9d1be2a8187cc693d9d"
"url": "https://github.com/vancluever/z2d/archive/a1237f6881d99b75abd8a20a934e62e34b44a005.tar.gz",
"dest": "vendor/p/z2d-0.8.2-pre-j5P_HlVRFgCsBTQ3EgUoKbYHx5JMnyH1mHsOSPiafnef",
"sha256": "e7fa91640221d54e36bfb8ea97d5b48ebdb3cd066dbb7f43c493cb56b4b26c98"
},
{
"type": "archive",
"url": "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz",
"dest": "vendor/p/zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9",
"sha256": "de7ba535077fe2b678a5a7972585f002588d37244db08397feadf3d4907c0bb2"
"url": "https://github.com/jcollie/zf/archive/52ad2e5528ab754f77437edf08a07b5ec843661c.tar.gz",
"dest": "vendor/p/zf-0.10.3-OIRy8QGJAACJcu3tCGtfbJnnd3Y4QL7OW_X8PJ8u_ASR",
"sha256": "f018a76da9d27d978103c481028a55c7024e6cddfafc14e9c551c004a89cb0c4"
},
{
"type": "git",
"url": "https://codeberg.org/atman/zg",
"commit": "4a002763419a34d61dcbb1f415821b83b9bf8ddc",
"dest": "vendor/p/zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM"
"url": "https://codeberg.org/ivanstepanovftw/zg",
"commit": "4fe689e56ce2ed5a8f59308b471bccd7da89fac9",
"dest": "vendor/p/zg-0.14.1-oGqU3J4_tAKBfyes3AWleKDjo-IcYvnEwaB8qxOqFMwM"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz",
"dest": "vendor/p/N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ",
"sha256": "7f235e0956c2f5401a28963a261019953d00e3bf4cfc029830f2161196c3583d"
"url": "https://codeberg.org/chaten/zg/archive/749197a3f9d25e211615960c02380a3d659b20f9.tar.gz",
"dest": "vendor/p/zg-0.15.1-oGqU3M0-tALZCy7boQS86znlBloyKx6--JriGlY0Paa9",
"sha256": "059873d673eac4aea176c250eba9fb264e3332015218b5e6f1e534097ffb9832"
},
{
"type": "archive",
"url": "https://github.com/mitchellh/zig-objc/archive/c9e917a4e15a983b672ca779c7985d738a2d517c.tar.gz",
"dest": "vendor/p/zig_objc-0.0.0-Ir_SpwsPAQBJgi9YRm2ubJMfdoysSq5gKpsIj3izQ8Zk",
"sha256": "a37be5eea7e44a2d1b2976ba256b85f76a8c1063fc01ffec85c8a9e67468e4dc"
"url": "https://github.com/mitchellh/zig-js/archive/04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz",
"dest": "vendor/p/zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi",
"sha256": "4c2018e56015d39504b8090386ad9ce9393f38380085d9c32373bf7e56fc73a3"
},
{
"type": "archive",
"url": "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz",
"dest": "vendor/p/wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy",
"sha256": "13bec6675e403d86db3b55b39ae262f1e1bdfe24056dcd82824341c6308b5219"
"url": "https://github.com/mitchellh/zig-objc/archive/f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz",
"dest": "vendor/p/zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK",
"sha256": "dd84af737625356fcd722cb30909f3b2e8d702667cf579714aa7eabc0ac08ecc"
},
{
"type": "archive",
"url": "https://codeberg.org/ifreund/zig-wayland/archive/1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz",
"dest": "vendor/p/wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe",
"sha256": "4f146b735ed0d527f520e3bf71d3e93f72c3d0fa583ae8edd3a4851f7079124e"
},
{
"type": "git",
"url": "https://github.com/TUSF/zigimg",
"commit": "31268548fe3276c0e95f318a6c0d2ab10565b58d",
"dest": "vendor/p/zigimg-0.1.0-lly-O6N2EABOxke8dqyzCwhtUCAafqP35zC7wsZ4Ddxj"
"url": "https://github.com/ivanstepanovftw/zigimg",
"commit": "aa4c31db872612c39edbb79f753b3cd9a79fe726",
"dest": "vendor/p/zigimg-0.1.0-8_eo2mWmEgBoqdr0sH9O5GTqDHthkoEPM5_tipcBRreL"
},
{
"type": "archive",
"url": "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz",
"dest": "vendor/p/zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms",
"sha256": "2c1ed76ba2b35514544b0c27c9633ecba7c31be9080e37e7a010c93b5a1bc553"
},
{
"type": "archive",

View File

@@ -10,7 +10,7 @@
git,
ncurses,
pkg-config,
zig_0_14,
zig_0_15,
pandoc,
revision ? "dirty",
optimize ? "Debug",
@@ -27,7 +27,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_14.hook.overrideAttrs {
zig_hook = zig_0_15.hook.overrideAttrs {
zig_default_flags = "-Dcpu=baseline -Doptimize=${optimize} --color off";
};
gi_typelib_path = import ./build-support/gi-typelib-path.nix {

View File

@@ -46,19 +46,19 @@ pub fn addPaths(
// find the SDK path.
const libc = try std.zig.LibCInstallation.findNative(.{
.allocator = b.allocator,
.target = step.rootModuleTarget(),
.target = &step.rootModuleTarget(),
.verbose = false,
});
// Render the file compatible with the `--libc` Zig flag.
var list: std.ArrayList(u8) = .init(b.allocator);
defer list.deinit();
try libc.render(list.writer());
var stream: std.io.Writer.Allocating = .init(b.allocator);
defer stream.deinit();
try libc.render(&stream.writer);
// Create a temporary file to store the libc path because
// `--libc` expects a file path.
const wf = b.addWriteFiles();
const path = wf.add("libc.txt", list.items);
const path = wf.add("libc.txt", stream.written());
// Determine our framework path. Zig has a bug where it doesn't
// parse this from the libc txt file for `-framework` flags:

View File

@@ -19,9 +19,8 @@ pub fn build(b: *std.Build) !void {
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{});
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
if (b.lazyDependency("breakpad", .{})) |upstream| {
lib.addIncludePath(upstream.path("src"));

View File

@@ -55,19 +55,19 @@ pub fn build(b: *std.Build) !void {
if (imgui_) |imgui| lib.addIncludePath(imgui.path(""));
module.addIncludePath(b.path("vendor"));
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DCIMGUI_FREETYPE=1",
"-DIMGUI_USE_WCHAR32=1",
"-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1",
});
if (target.result.os.tag == .windows) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DIMGUI_IMPL_API=extern\t\"C\"\t__declspec(dllexport)",
});
} else {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DIMGUI_IMPL_API=extern\t\"C\"",
});
}

View File

@@ -82,9 +82,9 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
lib.addIncludePath(b.path("override/include"));
module.addIncludePath(b.path("override/include"));
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DHAVE_DIRENT_H",
"-DHAVE_FCNTL_H",
"-DHAVE_STDLIB_H",
@@ -129,12 +129,12 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
});
switch (target.result.ptrBitWidth()) {
32 => try flags.appendSlice(&.{
32 => try flags.appendSlice(b.allocator, &.{
"-DSIZEOF_VOID_P=4",
"-DALIGNOF_VOID_P=4",
}),
64 => try flags.appendSlice(&.{
64 => try flags.appendSlice(b.allocator, &.{
"-DSIZEOF_VOID_P=8",
"-DALIGNOF_VOID_P=8",
}),
@@ -142,14 +142,14 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
else => @panic("unsupported arch"),
}
if (target.result.os.tag == .windows) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DFC_CACHEDIR=\"LOCAL_APPDATA_FONTCONFIG_CACHE\"",
"-DFC_TEMPLATEDIR=\"c:/share/fontconfig/conf.avail\"",
"-DCONFIGDIR=\"c:/etc/fonts/conf.d\"",
"-DFC_DEFAULT_FONTS=\"\\t<dir>WINDOWSFONTDIR</dir>\\n\\t<dir>WINDOWSUSERFONTDIR</dir>\\n\"",
});
} else {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DHAVE_FSTATFS",
"-DHAVE_FSTATVFS",
"-DHAVE_GETOPT",
@@ -173,13 +173,13 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
});
if (target.result.os.tag == .freebsd) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DFC_TEMPLATEDIR=\"/usr/local/etc/fonts/conf.avail\"",
"-DFONTCONFIG_PATH=\"/usr/local/etc/fonts\"",
"-DCONFIGDIR=\"/usr/local/etc/fonts/conf.d\"",
});
} else {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DFC_TEMPLATEDIR=\"/usr/share/fontconfig/conf.avail\"",
"-DFONTCONFIG_PATH=\"/etc/fonts\"",
"-DCONFIGDIR=\"/usr/local/fontconfig/conf.d\"",
@@ -187,7 +187,7 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
}
if (target.result.os.tag == .linux) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DHAVE_SYS_STATFS_H",
"-DHAVE_SYS_VFS_H",
});
@@ -214,14 +214,14 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
// Libxml2
_ = b.systemIntegrationOption("libxml2", .{}); // So it shows up in help
if (libxml2_enabled) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DENABLE_LIBXML2",
"-DLIBXML_STATIC",
"-DLIBXML_PUSH_ENABLED",
});
if (target.result.os.tag == .windows) {
// NOTE: this should be defined on all targets
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-Werror=implicit-function-declaration",
});
}

View File

@@ -77,9 +77,9 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DFT2_BUILD_LIBRARY",
"-DFT_CONFIG_OPTION_SYSTEM_ZLIB=1",
@@ -103,7 +103,7 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
// Libpng
_ = b.systemIntegrationOption("libpng", .{}); // So it shows up in help
if (libpng_enabled) {
try flags.append("-DFT_CONFIG_OPTION_USE_PNG=1");
try flags.append(b.allocator, "-DFT_CONFIG_OPTION_USE_PNG=1");
if (b.systemIntegrationOption("libpng", .{})) {
lib.linkSystemLibrary2("libpng", dynamic_link_opts);

View File

@@ -193,8 +193,8 @@ pub const Face = struct {
) void {
c.FT_Set_Transform(
self.handle,
@constCast(@ptrCast(matrix)),
@constCast(@ptrCast(delta)),
@ptrCast(@constCast(matrix)),
@ptrCast(@constCast(delta)),
);
}
};

View File

@@ -59,9 +59,9 @@ fn buildGlslang(
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-fno-sanitize=undefined",
"-fno-sanitize-trap=undefined",
});

View File

@@ -36,10 +36,13 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
const optimize = options.optimize;
// Shared library
const lib = b.addSharedLibrary(.{
const lib = b.addLibrary(.{
.name = "gtk4-layer-shell",
.target = target,
.optimize = optimize,
.linkage = .dynamic,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
b.installArtifact(lib);

View File

@@ -111,13 +111,13 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
const dynamic_link_opts = options.dynamic_link_opts;
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DHAVE_STDBOOL_H",
});
if (target.result.os.tag != .windows) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DHAVE_UNISTD_H",
"-DHAVE_SYS_MMAN_H",
"-DHAVE_PTHREAD=1",
@@ -127,7 +127,7 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
// Freetype
_ = b.systemIntegrationOption("freetype", .{}); // So it shows up in help
if (freetype_enabled) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DHAVE_FREETYPE=1",
// Let's just assume a new freetype
@@ -153,7 +153,7 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
}
if (coretext_enabled) {
try flags.appendSlice(&.{"-DHAVE_CORETEXT=1"});
try flags.appendSlice(b.allocator, &.{"-DHAVE_CORETEXT=1"});
lib.linkFramework("CoreText");
module.linkFramework("CoreText", .{});
}

View File

@@ -31,9 +31,9 @@ pub fn build(b: *std.Build) !void {
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
// Avoid changing binaries based on the current time and date.
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
@@ -69,7 +69,7 @@ pub fn build(b: *std.Build) !void {
"-fno-vectorize",
});
if (target.result.os.tag != .windows) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-fmath-errno",
"-fno-exceptions",
});

View File

@@ -22,9 +22,9 @@ pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DHAVE_CONFIG_H",
"-DLOCALEDIR=\"\"",
});

View File

@@ -46,9 +46,9 @@ pub fn build(b: *std.Build) !void {
}
if (b.lazyDependency("libpng", .{})) |upstream| {
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DPNG_ARM_NEON_OPT=0",
"-DPNG_POWERPC_VSX_OPT=0",
"-DPNG_INTEL_SSE_OPT=0",

View File

@@ -25,9 +25,9 @@ pub fn build(b: *std.Build) !void {
lib.addIncludePath(b.path("override/config/posix"));
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
// Version info, hardcoded
comptime "-DLIBXML_VERSION=" ++ Version.number(),
comptime "-DLIBXML_VERSION_STRING=" ++ Version.string(),
@@ -46,7 +46,7 @@ pub fn build(b: *std.Build) !void {
"-DWITHOUT_TRIO=1",
});
if (target.result.os.tag != .windows) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DHAVE_ARPA_INET_H=1",
"-DHAVE_ARPA_NAMESER_H=1",
"-DHAVE_DL_H=1",
@@ -74,25 +74,25 @@ pub fn build(b: *std.Build) !void {
var nameBuf: [32]u8 = undefined;
const name = std.ascii.upperString(&nameBuf, field.name);
const define = try std.fmt.allocPrint(b.allocator, "-DLIBXML_{s}_ENABLED=1", .{name});
try flags.append(define);
try flags.append(b.allocator, define);
if (std.mem.eql(u8, field.name, "history")) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DHAVE_LIBHISTORY=1",
"-DHAVE_LIBREADLINE=1",
});
}
if (std.mem.eql(u8, field.name, "mem_debug")) {
try flags.append("-DDEBUG_MEMORY_LOCATION=1");
try flags.append(b.allocator, "-DDEBUG_MEMORY_LOCATION=1");
}
if (std.mem.eql(u8, field.name, "regexp")) {
try flags.append("-DLIBXML_UNICODE_ENABLED=1");
try flags.append(b.allocator, "-DLIBXML_UNICODE_ENABLED=1");
}
if (std.mem.eql(u8, field.name, "run_debug")) {
try flags.append("-DLIBXML_DEBUG_RUNTIME=1");
try flags.append(b.allocator, "-DLIBXML_DEBUG_RUNTIME=1");
}
if (std.mem.eql(u8, field.name, "thread")) {
try flags.append("-DHAVE_LIBPTHREAD=1");
try flags.append(b.allocator, "-DHAVE_LIBPTHREAD=1");
}
}
}

View File

@@ -68,7 +68,7 @@ pub const MutableArray = opaque {
comptime Elem: type,
value: *const Elem,
) void {
CFArrayAppendValue(self, @constCast(@ptrCast(value)));
CFArrayAppendValue(self, @ptrCast(@constCast(value)));
}
pub fn removeValue(self: *MutableArray, idx: usize) void {

View File

@@ -10,7 +10,7 @@ pub const AttributedString = opaque {
str: *foundation.String,
attributes: *foundation.Dictionary,
) Allocator.Error!*AttributedString {
return @constCast(@ptrCast(c.CFAttributedStringCreate(
return @ptrCast(@constCast(c.CFAttributedStringCreate(
null,
@ptrCast(str),
@ptrCast(attributes),

View File

@@ -17,8 +17,8 @@ pub const Dictionary = opaque {
return @as(?*Dictionary, @ptrFromInt(@intFromPtr(c.CFDictionaryCreate(
null,
@constCast(@ptrCast(if (keys) |slice| slice.ptr else null)),
@constCast(@ptrCast(if (values) |slice| slice.ptr else null)),
@ptrCast(@constCast(if (keys) |slice| slice.ptr else null)),
@ptrCast(@constCast(if (values) |slice| slice.ptr else null)),
@intCast(if (keys) |slice| slice.len else 0),
&c.kCFTypeDictionaryKeyCallBacks,
&c.kCFTypeDictionaryValueCallBacks,

View File

@@ -32,10 +32,11 @@ pub const Log = opaque {
comptime format: []const u8,
args: anytype,
) void {
const str = nosuspend std.fmt.allocPrintZ(
const str = nosuspend std.fmt.allocPrintSentinel(
alloc,
format,
args,
0,
) catch return;
defer alloc.free(str);
zig_os_log_with_type(self, typ, str.ptr);

View File

@@ -68,7 +68,7 @@ pub const Font = opaque {
}
pub fn copyTable(self: *Font, tag: FontTableTag) ?*foundation.Data {
return @constCast(@ptrCast(c.CTFontCopyTable(
return @ptrCast(@constCast(c.CTFontCopyTable(
@ptrCast(self),
@intFromEnum(tag),
c.kCTFontTableOptionNoOptions,
@@ -90,7 +90,7 @@ pub const Font = opaque {
}
pub fn createPathForGlyph(self: *Font, glyph: graphics.Glyph) ?*graphics.Path {
return @constCast(@ptrCast(c.CTFontCreatePathForGlyph(
return @ptrCast(@constCast(c.CTFontCreatePathForGlyph(
@ptrCast(self),
glyph,
null,

View File

@@ -51,7 +51,7 @@ pub const Line = opaque {
}
pub fn getGlyphRuns(self: *Line) *foundation.Array {
return @constCast(@ptrCast(c.CTLineGetGlyphRuns(@ptrCast(self))));
return @ptrCast(@constCast(c.CTLineGetGlyphRuns(@ptrCast(self))));
}
};

View File

@@ -74,7 +74,7 @@ pub const DisplayLink = opaque {
callbackFn(
displayLink,
@alignCast(@ptrCast(inner_userinfo)),
@ptrCast(@alignCast(inner_userinfo)),
);
return c.kCVReturnSuccess;
}

View File

@@ -100,9 +100,8 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
.SIZEOF_VOIDP = t.ptrBitWidth() / t.cTypeBitSize(.char),
}));
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{});
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
lib.addCSourceFiles(.{
.root = upstream.path(""),
.flags = flags.items,

View File

@@ -6,7 +6,7 @@ const errors = @import("errors.zig");
/// the encodings that the program will use.
pub fn init(encs: []const *Encoding) !void {
_ = try errors.convertError(c.onig_initialize(
@constCast(@ptrCast(@alignCast(encs.ptr))),
@ptrCast(@alignCast(@constCast(encs.ptr))),
@intCast(encs.len),
));
}

View File

@@ -26,22 +26,21 @@ pub fn build(b: *std.Build) !void {
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{});
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
if (target.result.os.tag == .windows) {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DSENTRY_WITH_UNWINDER_DBGHELP",
});
} else {
try flags.appendSlice(&.{
try flags.appendSlice(b.allocator, &.{
"-DSENTRY_WITH_UNWINDER_LIBBACKTRACE",
});
}
switch (backend) {
.crashpad => try flags.append("-DSENTRY_BACKEND_CRASHPAD"),
.breakpad => try flags.append("-DSENTRY_BACKEND_BREAKPAD"),
.inproc => try flags.append("-DSENTRY_BACKEND_INPROC"),
.crashpad => try flags.append(b.allocator, "-DSENTRY_BACKEND_CRASHPAD"),
.breakpad => try flags.append(b.allocator, "-DSENTRY_BACKEND_BREAKPAD"),
.inproc => try flags.append(b.allocator, "-DSENTRY_BACKEND_INPROC"),
.none => {},
}

View File

@@ -20,11 +20,11 @@ pub fn build(b: *std.Build) !void {
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
// Zig 0.13 bug: https://github.com/ziglang/zig/issues/20414
// (See root Ghostty build.zig on why we do this)
try flags.appendSlice(&.{"-DSIMDUTF_IMPLEMENTATION_ICELAKE=0"});
try flags.appendSlice(b.allocator, &.{"-DSIMDUTF_IMPLEMENTATION_ICELAKE=0"});
lib.addCSourceFiles(.{
.flags = flags.items,

View File

@@ -64,9 +64,9 @@ fn buildSpirvCross(
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DSPIRV_CROSS_C_API_GLSL=1",
"-DSPIRV_CROSS_C_API_MSL=1",

View File

@@ -19,9 +19,8 @@ pub fn build(b: *std.Build) !void {
try apple_sdk.addPaths(b, lib);
}
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{});
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
lib.addCSourceFiles(.{
.flags = flags.items,

View File

@@ -17,11 +17,11 @@ pub fn build(b: *std.Build) !void {
});
unit_tests.linkLibC();
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.append("-DWUFFS_IMPLEMENTATION");
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.append(b.allocator, "-DWUFFS_IMPLEMENTATION");
inline for (@import("src/c.zig").defines) |key| {
try flags.append("-D" ++ key);
try flags.append(b.allocator, "-D" ++ key);
}
if (b.lazyDependency("wuffs", .{})) |wuffs_dep| {

View File

@@ -31,7 +31,7 @@ pub fn decode(alloc: Allocator, data: []const u8) Error!ImageData {
}
var source_buffer: c.wuffs_base__io_buffer = .{
.data = .{ .ptr = @constCast(@ptrCast(data.ptr)), .len = data.len },
.data = .{ .ptr = @ptrCast(@constCast(data.ptr)), .len = data.len },
.meta = .{
.wi = data.len,
.ri = 0,

View File

@@ -31,7 +31,7 @@ pub fn decode(alloc: Allocator, data: []const u8) Error!ImageData {
}
var source_buffer: c.wuffs_base__io_buffer = .{
.data = .{ .ptr = @constCast(@ptrCast(data.ptr)), .len = data.len },
.data = .{ .ptr = @ptrCast(@constCast(data.ptr)), .len = data.len },
.meta = .{
.wi = data.len,
.ri = 0,

View File

@@ -26,9 +26,9 @@ pub fn build(b: *std.Build) !void {
.{ .include_extensions = &.{".h"} },
);
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
try flags.appendSlice(&.{
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
"-DHAVE_SYS_TYPES_H",
"-DHAVE_STDINT_H",
"-DHAVE_STDDEF_H",

View File

@@ -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.14.0/zig-linux-$arch-0.14.0.tar.xz
curl -LO --retry-connrefused --retry 10 https://ziglang.org/download/0.15.1/zig-$arch-linux-0.15.1.tar.xz
else
echo "Unsupported arch"
exit 1

View File

@@ -194,7 +194,9 @@ fn startPosix(self: *Command, arena: Allocator) !void {
// child process so there isn't much we can do. We try to output
// something reasonable. Its important to note we MUST NOT return
// any other error condition from here on out.
const stderr = std.io.getStdErr().writer();
var stderr_buf: [1024]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&stderr_buf);
const stderr = &stderr_writer.interface;
switch (err) {
error.FileNotFound => stderr.print(
\\Requested executable not found. Please verify the command is on
@@ -211,6 +213,7 @@ fn startPosix(self: *Command, arena: Allocator) !void {
.{err},
) catch {},
}
stderr.flush() catch {};
// We return a very specific error that can be detected to determine
// we're in the child.
@@ -464,34 +467,35 @@ fn createWindowsEnvBlock(allocator: mem.Allocator, env_map: *const EnvMap) ![]u1
/// Copied from Zig. This function could be made public in child_process.zig instead.
fn windowsCreateCommandLine(allocator: mem.Allocator, argv: []const []const u8) ![:0]u8 {
var buf = std.ArrayList(u8).init(allocator);
var buf: std.Io.Writer.Allocating = .init(allocator);
defer buf.deinit();
const writer = &buf.writer;
for (argv, 0..) |arg, arg_i| {
if (arg_i != 0) try buf.append(' ');
if (arg_i != 0) try writer.writeByte(' ');
if (mem.indexOfAny(u8, arg, " \t\n\"") == null) {
try buf.appendSlice(arg);
try writer.writeAll(arg);
continue;
}
try buf.append('"');
try writer.writeByte('"');
var backslash_count: usize = 0;
for (arg) |byte| {
switch (byte) {
'\\' => backslash_count += 1,
'"' => {
try buf.appendNTimes('\\', backslash_count * 2 + 1);
try buf.append('"');
try writer.splatByteAll('\\', backslash_count * 2 + 1);
try writer.writeByte('"');
backslash_count = 0;
},
else => {
try buf.appendNTimes('\\', backslash_count);
try buf.append(byte);
try writer.splatByteAll('\\', backslash_count);
try writer.writeByte(byte);
backslash_count = 0;
},
}
}
try buf.appendNTimes('\\', backslash_count * 2);
try buf.append('"');
try writer.splatByteAll('\\', backslash_count * 2);
try writer.writeByte('"');
}
return buf.toOwnedSliceSentinel(0);

View File

@@ -305,19 +305,19 @@ const DerivedConfig = struct {
// Build all of our links
const links = links: {
var links = std.ArrayList(Link).init(alloc);
defer links.deinit();
var links: std.ArrayList(Link) = .empty;
defer links.deinit(alloc);
for (config.link.links.items) |link| {
var regex = try link.oniRegex();
errdefer regex.deinit();
try links.append(.{
try links.append(alloc, .{
.regex = regex,
.action = link.action,
.highlight = link.highlight,
});
}
break :links try links.toOwnedSlice();
break :links try links.toOwnedSlice(alloc);
};
errdefer {
for (links) |*link| link.regex.deinit();
@@ -1009,7 +1009,7 @@ pub fn handleMessage(self: *Surface, msg: Message) !void {
self.command_timer = null;
const duration: Duration = .{ .duration = end.since(start) };
log.debug("command took {}", .{duration});
log.debug("command took {f}", .{duration});
_ = self.rt_app.performAction(
.{ .surface = self },
@@ -2493,7 +2493,7 @@ fn maybeHandleBinding(
self.keyboard.bindings = null;
// Attempt to perform the action
log.debug("key event binding flags={} action={}", .{
log.debug("key event binding flags={} action={f}", .{
leaf.flags,
action,
});
@@ -5119,7 +5119,9 @@ fn writeScreenFile(
defer file.close();
// Screen.dumpString writes byte-by-byte, so buffer it
var buf_writer = std.io.bufferedWriter(file.writer());
var buf: [4096]u8 = undefined;
var file_writer = file.writer(&buf);
var buf_writer = &file_writer.interface;
// Write the scrollback contents. This requires a lock.
{
@@ -5169,7 +5171,7 @@ fn writeScreenFile(
const br = sel.bottomRight(&self.io.terminal.screen);
try self.io.terminal.screen.dumpString(
buf_writer.writer(),
buf_writer,
.{
.tl = tl,
.br = br,

View File

@@ -578,7 +578,7 @@ pub const SetTitle = struct {
value: @This(),
comptime _: []const u8,
_: std.fmt.FormatOptions,
writer: anytype,
writer: *std.Io.Writer,
) !void {
try writer.print("{s}{{ {s} }}", .{ @typeName(@This()), value.title });
}
@@ -602,7 +602,7 @@ pub const Pwd = struct {
value: @This(),
comptime _: []const u8,
_: std.fmt.FormatOptions,
writer: anytype,
writer: *std.Io.Writer,
) !void {
try writer.print("{s}{{ {s} }}", .{ @typeName(@This()), value.pwd });
}
@@ -630,7 +630,7 @@ pub const DesktopNotification = struct {
value: @This(),
comptime _: []const u8,
_: std.fmt.FormatOptions,
writer: anytype,
writer: *std.Io.Writer,
) !void {
try writer.print("{s}{{ title: {s}, body: {s} }}", .{
@typeName(@This()),

View File

@@ -266,8 +266,8 @@ pub const App = struct {
// embedded apprt.
self.performPreAction(target, action, value);
log.debug("dispatching action target={s} action={} value={}", .{
@tagName(target),
log.debug("dispatching action target={t} action={} value={any}", .{
target,
action,
value,
});
@@ -1910,7 +1910,7 @@ pub const CAPI = struct {
};
return ptr.core_surface.performBindingAction(action) catch |err| {
log.err("error performing binding action action={} err={}", .{ action, err });
log.err("error performing binding action action={f} err={}", .{ action, err });
return false;
};
}

View File

@@ -27,7 +27,7 @@ pub fn getRuntimeVersion() std.SemanticVersion {
}
pub fn logVersion() void {
log.info("libadwaita version build={} runtime={}", .{
log.info("libadwaita version build={f} runtime={f}", .{
comptime_version,
getRuntimeVersion(),
});

View File

@@ -45,7 +45,7 @@ pub fn main() !void {
std.debug.print(
\\`libadwaita` is too old.
\\
\\Ghostty requires a version {} or newer of `libadwaita` to
\\Ghostty requires a version {f} or newer of `libadwaita` to
\\compile this blueprint. Please install it, ensure that it is
\\available on your PATH, and then retry building Ghostty.
, .{required_adwaita_version});
@@ -80,7 +80,7 @@ pub fn main() !void {
std.debug.print(
\\`blueprint-compiler` not found.
\\
\\Ghostty requires version {} or newer of
\\Ghostty requires version {f} or newer of
\\`blueprint-compiler` as a build-time dependency starting
\\from version 1.2. Please install it, ensure that it is
\\available on your PATH, and then retry building Ghostty.
@@ -104,7 +104,7 @@ pub fn main() !void {
std.debug.print(
\\`blueprint-compiler` is the wrong version.
\\
\\Ghostty requires version {} or newer of
\\Ghostty requires version {f} or newer of
\\`blueprint-compiler` as a build-time dependency starting
\\from version 1.2. Please install it, ensure that it is
\\available on your PATH, and then retry building Ghostty.
@@ -145,7 +145,7 @@ pub fn main() !void {
std.debug.print(
\\`blueprint-compiler` not found.
\\
\\Ghostty requires version {} or newer of
\\Ghostty requires version {f} or newer of
\\`blueprint-compiler` as a build-time dependency starting
\\from version 1.2. Please install it, ensure that it is
\\available on your PATH, and then retry building Ghostty.

View File

@@ -142,7 +142,9 @@ pub fn main() !void {
);
}
const writer = std.io.getStdOut().writer();
var buf: [4096]u8 = undefined;
var stdout = std.fs.File.stdout().writer(&buf);
const writer = &stdout.interface;
try writer.writeAll(
\\<?xml version="1.0" encoding="UTF-8"?>
\\<gresources>
@@ -157,12 +159,14 @@ pub fn main() !void {
\\</gresources>
\\
);
try stdout.end();
}
/// Generate the icon resources. This works by looking up all the icons
/// specified by `icon_sizes` in `images/icons/`. They are asserted to exist
/// by trying to access the file.
fn genIcons(writer: anytype) !void {
fn genIcons(writer: *std.Io.Writer) !void {
try writer.print(
\\ <gresource prefix="{s}/icons">
\\
@@ -204,7 +208,7 @@ fn genIcons(writer: anytype) !void {
}
/// Generate the resources at the root prefix.
fn genRoot(writer: anytype) !void {
fn genRoot(writer: *std.Io.Writer) !void {
try writer.print(
\\ <gresource prefix="{s}">
\\
@@ -236,7 +240,7 @@ fn genRoot(writer: anytype) !void {
/// assuming these will be
fn genUi(
alloc: Allocator,
writer: anytype,
writer: *std.Io.Writer,
files: *const std.ArrayListUnmanaged([]const u8),
) !void {
try writer.print(

View File

@@ -50,7 +50,7 @@ pub fn init(
) orelse "";
if (!std.mem.eql(u8, original, current)) break :transient current;
alloc.free(current);
std.time.sleep(25 * std.time.ns_per_ms);
std.Thread.sleep(25 * std.time.ns_per_ms);
};
errdefer alloc.free(transient);
log.info("transient scope created cgroup={s}", .{transient});
@@ -101,21 +101,21 @@ fn enableControllers(alloc: Allocator, cgroup: []const u8) !void {
defer alloc.free(raw);
// Build our string builder for enabling all controllers
var builder = std.ArrayList(u8).init(alloc);
var builder: std.Io.Writer.Allocating = .init(alloc);
defer builder.deinit();
// Controllers are space-separated
var it = std.mem.splitScalar(u8, raw, ' ');
while (it.next()) |controller| {
try builder.append('+');
try builder.appendSlice(controller);
if (it.rest().len > 0) try builder.append(' ');
try builder.writer.writeByte('+');
try builder.writer.writeAll(controller);
if (it.rest().len > 0) try builder.writer.writeByte(' ');
}
// Enable them all
try internal_os.cgroup.configureControllers(
cgroup,
builder.items,
builder.written(),
);
}

View File

@@ -282,7 +282,7 @@ pub fn Common(
fn setter(self: *Self, value: ?[:0]const u8) void {
const priv = private(self);
if (@field(priv, name)) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
}
// We don't need to copy this because it was already

View File

@@ -1044,7 +1044,9 @@ pub const Application = extern struct {
defer file.close();
log.info("loading gtk-custom-css path={s}", .{path});
const contents = try file.reader().readAllAlloc(
var buf: [4096]u8 = undefined;
var reader = file.reader(&buf);
const contents = try reader.interface.readAlloc(
alloc,
5 * 1024 * 1024, // 5MB,
);
@@ -1115,8 +1117,8 @@ pub const Application = extern struct {
// This should really never, never happen. Its not critical enough
// to actually crash, but this is a bug somewhere. An accelerator
// for a trigger can't possibly be more than 1024 bytes.
error.NoSpaceLeft => {
log.warn("accelerator somehow longer than 1024 bytes: {}", .{trigger});
error.WriteFailed => {
log.warn("accelerator somehow longer than 1024 bytes: {f}", .{trigger});
return;
},
};

View File

@@ -485,10 +485,11 @@ const Command = extern struct {
const command = priv.command orelse return null;
priv.action_key = std.fmt.allocPrintZ(
priv.action_key = std.fmt.allocPrintSentinel(
priv.arena.allocator(),
"{}",
"{f}",
.{command.action},
0,
) catch null;
return priv.action_key;

View File

@@ -117,10 +117,10 @@ pub const Config = extern struct {
errdefer text_buf.unref();
var buf: [4095:0]u8 = undefined;
var fbs = std.io.fixedBufferStream(&buf);
var writer: std.Io.Writer = .fixed(&buf);
for (config._diagnostics.items()) |diag| {
fbs.reset();
diag.write(fbs.writer()) catch |err| {
writer.end = 0;
diag.format(&writer) catch |err| {
log.warn(
"error writing diagnostic to buffer err={}",
.{err},
@@ -128,7 +128,7 @@ pub const Config = extern struct {
continue;
};
text_buf.insertAtCursor(&buf, @intCast(fbs.pos));
text_buf.insertAtCursor(&buf, @intCast(writer.end));
text_buf.insertAtCursor("\n", 1);
}

View File

@@ -188,9 +188,9 @@ pub const GlobalShortcuts = extern struct {
// If there isn't space to translate the trigger, then our
// buffer might be too small (but 1024 is insane!). In any case
// we don't want to stop registering globals.
error.NoSpaceLeft => {
error.WriteFailed => {
log.warn(
"buffer too small to translate trigger, ignoring={}",
"buffer too small to translate trigger, ignoring={f}",
.{entry.key_ptr.*},
);
continue;
@@ -257,7 +257,7 @@ pub const GlobalShortcuts = extern struct {
const trigger = entry.key_ptr.*.ptr;
const action = std.fmt.bufPrintZ(
&action_buf,
"{}",
"{f}",
.{entry.value_ptr.*},
) catch continue;

View File

@@ -172,7 +172,7 @@ pub const ResizeOverlay = extern struct {
/// overlay if it is currently hidden; you must call schedule.
pub fn setLabel(self: *Self, label: ?[:0]const u8) void {
const priv = self.private();
if (priv.label_text) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.label_text) |v| glib.free(@ptrCast(@constCast(v)));
priv.label_text = null;
if (label) |v| priv.label_text = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.label.impl.param_spec);
@@ -285,7 +285,7 @@ pub const ResizeOverlay = extern struct {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.label_text) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.label_text = null;
}

View File

@@ -268,7 +268,7 @@ pub const SplitTree = extern struct {
);
defer new_tree.deinit();
log.debug(
"new split at={} direction={} old_tree={} new_tree={}",
"new split at={} direction={} old_tree={f} new_tree={f}",
.{ handle, direction, old_tree, &new_tree },
);

View File

@@ -1375,11 +1375,11 @@ pub const Surface = extern struct {
defer arena.deinit();
const alloc = arena.allocator();
var env_to_remove = std.ArrayList([]const u8).init(alloc);
var env_to_update = std.ArrayList(struct {
var env_to_remove: std.ArrayList([]const u8) = .empty;
var env_to_update: std.ArrayList(struct {
key: []const u8,
value: []const u8,
}).init(alloc);
}) = .empty;
var it = env_map.iterator();
while (it.next()) |entry| {
@@ -1392,13 +1392,11 @@ pub const Surface = extern struct {
// Any env var starting with SNAP must be removed
if (std.mem.startsWith(u8, key, "SNAP_")) {
try env_to_remove.append(key);
try env_to_remove.append(alloc, key);
continue;
}
var filtered_paths = std.ArrayList([]const u8).init(alloc);
defer filtered_paths.deinit();
var filtered_paths: std.ArrayList([]const u8) = .empty;
var modified = false;
var paths = std.mem.splitAny(u8, value, ":");
while (paths.next()) |path| {
@@ -1411,15 +1409,15 @@ pub const Surface = extern struct {
break;
}
};
if (include) try filtered_paths.append(path);
if (include) try filtered_paths.append(alloc, path);
}
if (modified) {
if (filtered_paths.items.len > 0) {
const new_value = try std.mem.join(alloc, ":", filtered_paths.items);
try env_to_update.append(.{ .key = key, .value = new_value });
try env_to_update.append(alloc, .{ .key = key, .value = new_value });
} else {
try env_to_remove.append(key);
try env_to_remove.append(alloc, key);
}
}
}
@@ -1626,7 +1624,7 @@ pub const Surface = extern struct {
priv.core_surface = null;
}
if (priv.mouse_hover_url) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.mouse_hover_url = null;
}
if (priv.default_size) |v| {
@@ -1642,15 +1640,15 @@ pub const Surface = extern struct {
priv.min_size = null;
}
if (priv.pwd) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.pwd = null;
}
if (priv.title) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.title = null;
}
if (priv.title_override) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.title_override = null;
}
self.clearCgroup();
@@ -1674,7 +1672,7 @@ pub const Surface = extern struct {
/// title. For manually set titles see `setTitleOverride`.
pub fn setTitle(self: *Self, title: ?[:0]const u8) void {
const priv = self.private();
if (priv.title) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.title) |v| glib.free(@ptrCast(@constCast(v)));
priv.title = null;
if (title) |v| priv.title = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.title.impl.param_spec);
@@ -1684,7 +1682,7 @@ pub const Surface = extern struct {
/// unless this is unset (null).
pub fn setTitleOverride(self: *Self, title: ?[:0]const u8) void {
const priv = self.private();
if (priv.title_override) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.title_override) |v| glib.free(@ptrCast(@constCast(v)));
priv.title_override = null;
if (title) |v| priv.title_override = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.@"title-override".impl.param_spec);
@@ -1698,7 +1696,7 @@ pub const Surface = extern struct {
/// Set the pwd for this surface, copies the value.
pub fn setPwd(self: *Self, pwd: ?[:0]const u8) void {
const priv = self.private();
if (priv.pwd) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.pwd) |v| glib.free(@ptrCast(@constCast(v)));
priv.pwd = null;
if (pwd) |v| priv.pwd = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.pwd.impl.param_spec);
@@ -1783,7 +1781,7 @@ pub const Surface = extern struct {
pub fn setMouseHoverUrl(self: *Self, url: ?[:0]const u8) void {
const priv = self.private();
if (priv.mouse_hover_url) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.mouse_hover_url) |v| glib.free(@ptrCast(@constCast(v)));
priv.mouse_hover_url = null;
if (url) |v| priv.mouse_hover_url = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.@"mouse-hover-url".impl.param_spec);
@@ -2117,13 +2115,11 @@ pub const Surface = extern struct {
const alloc = Application.default().allocator();
if (ext.gValueHolds(value, gdk.FileList.getGObjectType())) {
var data = std.ArrayList(u8).init(alloc);
defer data.deinit();
var stream: std.Io.Writer.Allocating = .init(alloc);
defer stream.deinit();
var shell_escape_writer: internal_os.ShellEscapeWriter(std.ArrayList(u8).Writer) = .{
.child_writer = data.writer(),
};
const writer = shell_escape_writer.writer();
var shell_escape_writer: internal_os.ShellEscapeWriter = .init(&stream.writer);
const writer = &shell_escape_writer.writer;
const list: ?*glib.SList = list: {
const unboxed = value.getBoxed() orelse return 0;
@@ -2151,7 +2147,7 @@ pub const Surface = extern struct {
}
}
const string = data.toOwnedSliceSentinel(0) catch |err| {
const string = stream.toOwnedSliceSentinel(0) catch |err| {
log.err("unable to convert to a slice: {}", .{err});
return 0;
};
@@ -2164,13 +2160,11 @@ pub const Surface = extern struct {
const object = value.getObject() orelse return 0;
const file = gobject.ext.cast(gio.File, object) orelse return 0;
const path = file.getPath() orelse return 0;
var data = std.ArrayList(u8).init(alloc);
defer data.deinit();
var stream: std.Io.Writer.Allocating = .init(alloc);
defer stream.deinit();
var shell_escape_writer: internal_os.ShellEscapeWriter(std.ArrayList(u8).Writer) = .{
.child_writer = data.writer(),
};
const writer = shell_escape_writer.writer();
var shell_escape_writer: internal_os.ShellEscapeWriter = .init(&stream.writer);
const writer = &shell_escape_writer.writer;
writer.writeAll(std.mem.span(path)) catch |err| {
log.err("unable to write path to buffer: {}", .{err});
return 0;
@@ -2180,7 +2174,7 @@ pub const Surface = extern struct {
return 0;
};
const string = data.toOwnedSliceSentinel(0) catch |err| {
const string = stream.toOwnedSliceSentinel(0) catch |err| {
log.err("unable to convert to a slice: {}", .{err});
return 0;
};

View File

@@ -136,7 +136,7 @@ pub const SurfaceTitleDialog = extern struct {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.initial_value) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.initial_value = null;
}

View File

@@ -270,11 +270,11 @@ pub const Tab = extern struct {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.tooltip) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.tooltip = null;
}
if (priv.title) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.title = null;
}
@@ -405,22 +405,21 @@ pub const Tab = extern struct {
};
// Use an allocator to build up our string as we write it.
var buf: std.ArrayList(u8) = .init(Application.default().allocator());
var buf: std.Io.Writer.Allocating = .init(Application.default().allocator());
defer buf.deinit();
const writer = buf.writer();
// If our bell is ringing, then we prefix the bell icon to the title.
if (bell_ringing and config.@"bell-features".title) {
writer.writeAll("🔔 ") catch {};
buf.writer.writeAll("🔔 ") catch {};
}
// If we're zoomed, prefix with the magnifying glass emoji.
if (zoomed) {
writer.writeAll("🔍 ") catch {};
buf.writer.writeAll("🔍 ") catch {};
}
writer.writeAll(plain) catch return glib.ext.dupeZ(u8, plain);
return glib.ext.dupeZ(u8, buf.items);
buf.writer.writeAll(plain) catch return glib.ext.dupeZ(u8, plain);
return glib.ext.dupeZ(u8, buf.written());
}
const C = Common(Self, Private);

View File

@@ -26,7 +26,7 @@ pub fn getRuntimeVersion() std.SemanticVersion {
}
pub fn logVersion() void {
log.info("GTK version build={} runtime={}", .{
log.info("GTK version build={f} runtime={f}", .{
comptime_version,
getRuntimeVersion(),
});

View File

@@ -29,7 +29,10 @@ payload_builder: *glib.VariantBuilder,
parameters_builder: *glib.VariantBuilder,
/// Initialize the helper.
pub fn init(alloc: Allocator, target: apprt.ipc.Target, action: [:0]const u8) (Allocator.Error || std.posix.WriteError || apprt.ipc.Errors)!Self {
pub fn init(alloc: Allocator, target: apprt.ipc.Target, action: [:0]const u8) (Allocator.Error || std.Io.Writer.Error || apprt.ipc.Errors)!Self {
var buf: [256]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&buf);
const stderr = &stderr_writer.interface;
// Get the appropriate bus name and object path for contacting the
// Ghostty instance we're interested in.
@@ -37,7 +40,7 @@ pub fn init(alloc: Allocator, target: apprt.ipc.Target, action: [:0]const u8) (A
.class => |class| result: {
// Force the usage of the class specified on the CLI to determine the
// bus name and object path.
const object_path = try std.fmt.allocPrintZ(alloc, "/{s}", .{class});
const object_path = try std.fmt.allocPrintSentinel(alloc, "/{s}", .{class}, 0);
std.mem.replaceScalar(u8, object_path, '.', '/');
std.mem.replaceScalar(u8, object_path, '-', '_');
@@ -54,14 +57,14 @@ pub fn init(alloc: Allocator, target: apprt.ipc.Target, action: [:0]const u8) (A
}
if (gio.Application.idIsValid(bus_name.ptr) == 0) {
const stderr = std.io.getStdErr().writer();
try stderr.print("D-Bus bus name is not valid: {s}\n", .{bus_name});
try stderr.flush();
return error.IPCFailed;
}
if (glib.Variant.isObjectPath(object_path.ptr) == 0) {
const stderr = std.io.getStdErr().writer();
try stderr.print("D-Bus object path is not valid: {s}\n", .{object_path});
try stderr.flush();
return error.IPCFailed;
}
@@ -72,17 +75,17 @@ pub fn init(alloc: Allocator, target: apprt.ipc.Target, action: [:0]const u8) (A
const dbus_ = gio.busGetSync(.session, null, &err_);
if (err_) |err| {
const stderr = std.io.getStdErr().writer();
try stderr.print(
"Unable to establish connection to D-Bus session bus: {s}\n",
.{err.f_message orelse "(unknown)"},
);
try stderr.flush();
return error.IPCFailed;
}
break :dbus dbus_ orelse {
const stderr = std.io.getStdErr().writer();
try stderr.print("gio.busGetSync returned null\n", .{});
try stderr.flush();
return error.IPCFailed;
};
};
@@ -128,7 +131,11 @@ pub fn addParameter(self: *Self, variant: *glib.Variant) void {
/// Send the IPC to the remote Ghostty. Once it completes, nothing further
/// should be done with this object other than call `deinit`.
pub fn send(self: *Self) (std.posix.WriteError || apprt.ipc.Errors)!void {
pub fn send(self: *Self) (std.Io.Writer.Error || apprt.ipc.Errors)!void {
var buf: [256]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&buf);
const stderr = &stderr_writer.interface;
// finish building the parameters
const parameters = self.parameters_builder.end();
@@ -167,11 +174,11 @@ pub fn send(self: *Self) (std.posix.WriteError || apprt.ipc.Errors)!void {
defer if (result_) |result| result.unref();
if (err_) |err| {
const stderr = std.io.getStdErr().writer();
try stderr.print(
"D-Bus method call returned an error err={s}\n",
.{err.f_message orelse "(unknown)"},
);
try stderr.flush();
return error.IPCFailed;
}
}

View File

@@ -20,7 +20,7 @@ const DBus = @import("DBus.zig");
// ```
// gdbus call --session --dest com.mitchellh.ghostty --object-path /com/mitchellh/ghostty --method org.gtk.Actions.Activate new-window-command '[<@as ["echo" "hello"]>]' []
// ```
pub fn newWindow(alloc: Allocator, target: apprt.ipc.Target, value: apprt.ipc.Action.NewWindow) (Allocator.Error || std.posix.WriteError || apprt.ipc.Errors)!bool {
pub fn newWindow(alloc: Allocator, target: apprt.ipc.Target, value: apprt.ipc.Action.NewWindow) (Allocator.Error || std.Io.Writer.Error || apprt.ipc.Errors)!bool {
var dbus = try DBus.init(
alloc,
target,

View File

@@ -12,9 +12,8 @@ const winproto = @import("winproto.zig");
pub fn accelFromTrigger(
buf: []u8,
trigger: input.Binding.Trigger,
) error{NoSpaceLeft}!?[:0]const u8 {
var buf_stream = std.io.fixedBufferStream(buf);
const writer = buf_stream.writer();
) error{WriteFailed}!?[:0]const u8 {
var writer: std.Io.Writer = .fixed(buf);
// Modifiers
if (trigger.mods.shift) try writer.writeAll("<Shift>");
@@ -23,11 +22,11 @@ pub fn accelFromTrigger(
if (trigger.mods.super) try writer.writeAll("<Super>");
// Write our key
if (!try writeTriggerKey(writer, trigger)) return null;
if (!try writeTriggerKey(&writer, trigger)) return null;
// We need to make the string null terminated.
try writer.writeByte(0);
const slice = buf_stream.getWritten();
const slice = writer.buffered();
return slice[0 .. slice.len - 1 :0];
}
@@ -36,9 +35,8 @@ pub fn accelFromTrigger(
pub fn xdgShortcutFromTrigger(
buf: []u8,
trigger: input.Binding.Trigger,
) error{NoSpaceLeft}!?[:0]const u8 {
var buf_stream = std.io.fixedBufferStream(buf);
const writer = buf_stream.writer();
) error{WriteFailed}!?[:0]const u8 {
var writer: std.Io.Writer = .fixed(buf);
// Modifiers
if (trigger.mods.shift) try writer.writeAll("SHIFT+");
@@ -52,15 +50,18 @@ pub fn xdgShortcutFromTrigger(
// to *X11's* keysyms (which I assume is a subset of libxkbcommon's).
// I haven't been able to any evidence to back up that assumption but
// this works for now
if (!try writeTriggerKey(writer, trigger)) return null;
if (!try writeTriggerKey(&writer, trigger)) return null;
// We need to make the string null terminated.
try writer.writeByte(0);
const slice = buf_stream.getWritten();
const slice = writer.buffered();
return slice[0 .. slice.len - 1 :0];
}
fn writeTriggerKey(writer: anytype, trigger: input.Binding.Trigger) error{NoSpaceLeft}!bool {
fn writeTriggerKey(
writer: *std.Io.Writer,
trigger: input.Binding.Trigger,
) error{WriteFailed}!bool {
switch (trigger.key) {
.physical => |k| {
const keyval = keyvalFromKey(k) orelse return false;

View File

@@ -10,7 +10,6 @@ const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const Benchmark = @import("Benchmark.zig");
const options = @import("options.zig");
const uucode = @import("uucode");
const UTF8Decoder = @import("../terminal/UTF8Decoder.zig");
const simd = @import("../simd/main.zig");
const table = @import("../unicode/main.zig").table;
@@ -48,9 +47,6 @@ pub const Mode = enum {
/// Test our lookup table implementation.
table,
/// Using uucode, with custom `width` extension based on `wcwidth`.
uucode,
};
/// Create a new terminal stream handler for the given arguments.
@@ -75,7 +71,6 @@ pub fn benchmark(self: *CodepointWidth) Benchmark {
.wcwidth => stepWcwidth,
.table => stepTable,
.simd => stepSimd,
.uucode => stepUucode,
},
.setupFn = setup,
.teardownFn = teardown,
@@ -112,12 +107,15 @@ fn stepWcwidth(ptr: *anyopaque) Benchmark.Error!void {
const self: *CodepointWidth = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
@@ -136,12 +134,15 @@ fn stepTable(ptr: *anyopaque) Benchmark.Error!void {
const self: *CodepointWidth = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
@@ -165,12 +166,15 @@ fn stepSimd(ptr: *anyopaque) Benchmark.Error!void {
const self: *CodepointWidth = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
@@ -185,35 +189,6 @@ fn stepSimd(ptr: *anyopaque) Benchmark.Error!void {
}
}
fn stepUucode(ptr: *anyopaque) Benchmark.Error!void {
const self: *CodepointWidth = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
for (buf[0..n]) |c| {
const cp_, const consumed = d.next(c);
assert(consumed);
if (cp_) |cp| {
// This is the same trick we do in terminal.zig so we
// keep it here.
std.mem.doNotOptimizeAway(if (cp <= 0xFF)
1
else
uucode.get(.width, @intCast(cp)));
}
}
}
}
test CodepointWidth {
const testing = std.testing;
const alloc = testing.allocator;

View File

@@ -8,7 +8,6 @@ const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const Benchmark = @import("Benchmark.zig");
const options = @import("options.zig");
const uucode = @import("uucode");
const UTF8Decoder = @import("../terminal/UTF8Decoder.zig");
const unicode = @import("../unicode/main.zig");
@@ -39,9 +38,6 @@ pub const Mode = enum {
/// Ghostty's table-based approach.
table,
/// uucode implementation
uucode,
};
/// Create a new terminal stream handler for the given arguments.
@@ -64,7 +60,6 @@ pub fn benchmark(self: *GraphemeBreak) Benchmark {
.stepFn = switch (self.opts.mode) {
.noop => stepNoop,
.table => stepTable,
.uucode => stepUucode,
},
.setupFn = setup,
.teardownFn = teardown,
@@ -95,12 +90,15 @@ fn stepNoop(ptr: *anyopaque) Benchmark.Error!void {
const self: *GraphemeBreak = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
@@ -115,14 +113,17 @@ fn stepTable(ptr: *anyopaque) Benchmark.Error!void {
const self: *GraphemeBreak = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
var state: unicode.GraphemeBreakState = .{};
var cp1: u21 = 0;
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
@@ -138,33 +139,6 @@ fn stepTable(ptr: *anyopaque) Benchmark.Error!void {
}
}
fn stepUucode(ptr: *anyopaque) Benchmark.Error!void {
const self: *GraphemeBreak = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var d: UTF8Decoder = .{};
var state: uucode.grapheme.BreakState = .default;
var cp1: u21 = 0;
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
for (buf[0..n]) |c| {
const cp_, const consumed = d.next(c);
assert(consumed);
if (cp_) |cp2| {
std.mem.doNotOptimizeAway(uucode.grapheme.isBreak(cp1, @intCast(cp2), &state));
cp1 = cp2;
}
}
}
}
test GraphemeBreak {
const testing = std.testing;
const alloc = testing.allocator;

View File

@@ -90,7 +90,8 @@ fn stepUucode(ptr: *anyopaque) Benchmark.Error!void {
const self: *IsSymbol = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var r = f.reader(&read_buf);
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {
@@ -114,7 +115,8 @@ fn stepTable(ptr: *anyopaque) Benchmark.Error!void {
const self: *IsSymbol = @ptrCast(@alignCast(ptr));
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var r = f.reader(&read_buf);
var d: UTF8Decoder = .{};
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
while (true) {

View File

@@ -75,14 +75,16 @@ fn step(ptr: *anyopaque) Benchmark.Error!void {
// the benchmark results and... I know writing this that we
// aren't currently IO bound.
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
var r = &f_reader.interface;
var p: terminalpkg.Parser = .init();
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
var buf: [4096]u8 = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached

View File

@@ -113,17 +113,19 @@ fn step(ptr: *anyopaque) Benchmark.Error!void {
// the benchmark results and... I know writing this that we
// aren't currently IO bound.
const f = self.data_f orelse return;
var r = std.io.bufferedReader(f.reader());
var buf: [4096]u8 align(std.atomic.cache_line) = undefined;
var read_buf: [4096]u8 = undefined;
var f_reader = f.reader(&read_buf);
const r = &f_reader.interface;
var buf: [4096]u8 = undefined;
while (true) {
const n = r.read(&buf) catch |err| {
log.warn("error reading data file err={}", .{err});
const n = r.readSliceShort(&buf) catch {
log.warn("error reading data file err={?}", .{f_reader.err});
return error.BenchmarkFailed;
};
if (n == 0) break; // EOF reached
const chunk = buf[0..n];
self.stream.nextSlice(chunk) catch |err| {
self.stream.nextSlice(buf[0..n]) catch |err| {
log.warn("error processing data file chunk err={}", .{err});
return error.BenchmarkFailed;
};

View File

@@ -10,7 +10,7 @@ pub fn dataFile(path_: ?[]const u8) !?std.fs.File {
const path = path_ orelse return null;
// Stdin
if (std.mem.eql(u8, path, "-")) return std.io.getStdIn();
if (std.mem.eql(u8, path, "-")) return .stdin();
// Normal file
const file = try std.fs.cwd().openFile(path, .{});

View File

@@ -477,7 +477,7 @@ pub fn addOptions(self: *const Config, step: *std.Build.Step.Options) !void {
step.addOption(std.SemanticVersion, "app_version", self.version);
step.addOption([:0]const u8, "app_version_string", try std.fmt.bufPrintZ(
&buf,
"{}",
"{f}",
.{self.version},
));
step.addOption(

View File

@@ -11,8 +11,8 @@ pub fn init(
b: *std.Build,
deps: *const SharedDeps,
) !GhosttyBench {
var steps = std.ArrayList(*std.Build.Step.Compile).init(b.allocator);
errdefer steps.deinit();
var steps: std.ArrayList(*std.Build.Step.Compile) = .empty;
errdefer steps.deinit(b.allocator);
// Our synthetic data generator
{
@@ -28,7 +28,7 @@ pub fn init(
});
exe.linkLibC();
_ = try deps.add(exe);
try steps.append(exe);
try steps.append(b.allocator, exe);
}
// Our benchmarking application.
@@ -44,7 +44,7 @@ pub fn init(
});
exe.linkLibC();
_ = try deps.add(exe);
try steps.append(exe);
try steps.append(b.allocator, exe);
}
return .{ .steps = steps.items };

View File

@@ -43,10 +43,10 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
// embed the Ghostty version in the tarball
{
const version = b.addWriteFiles().add("VERSION", b.fmt("{}", .{cfg.version}));
const version = b.addWriteFiles().add("VERSION", b.fmt("{f}", .{cfg.version}));
// --add-file uses the most recent --prefix to determine the path
// in the archive to copy the file (the directory only).
git_archive.addArg(b.fmt("--prefix=ghostty-{}/", .{
git_archive.addArg(b.fmt("--prefix=ghostty-{f}/", .{
cfg.version,
}));
git_archive.addPrefixedFileArg("--add-file=", version);
@@ -65,7 +65,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
// --add-file uses the most recent --prefix to determine the path
// in the archive to copy the file (the directory only).
git_archive.addArg(b.fmt("--prefix=ghostty-{}/{s}/", .{
git_archive.addArg(b.fmt("--prefix=ghostty-{f}/{s}/", .{
cfg.version,
std.fs.path.dirname(resource.dist).?,
}));
@@ -77,11 +77,11 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
// This is important. Standard source tarballs extract into
// a directory named `project-version`. This is expected by
// standard tooling such as debhelper and rpmbuild.
b.fmt("--prefix=ghostty-{}/", .{cfg.version}),
b.fmt("--prefix=ghostty-{f}/", .{cfg.version}),
"-o",
});
const output = git_archive.addOutputFileArg(b.fmt(
"ghostty-{}.tar.gz",
"ghostty-{f}.tar.gz",
.{cfg.version},
));
git_archive.addArg("HEAD");
@@ -89,7 +89,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
// The install step to put the dist into the build directory.
const install = b.addInstallFile(
output,
b.fmt("dist/ghostty-{}.tar.gz", .{cfg.version}),
b.fmt("dist/ghostty-{f}.tar.gz", .{cfg.version}),
);
// The check step to ensure the archive works.
@@ -101,7 +101,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
// i.e. this is way `build.zig` is.
const extract_dir = check
.addOutputDirectoryArg("ghostty")
.path(b, b.fmt("ghostty-{}", .{cfg.version}));
.path(b, b.fmt("ghostty-{f}", .{cfg.version}));
// Check that tests pass within the extracted directory. This isn't
// a fully hermetic test because we're sharing the Zig cache. In

View File

@@ -12,8 +12,8 @@ pub fn init(
b: *std.Build,
deps: *const SharedDeps,
) !GhosttyDocs {
var steps = std.ArrayList(*std.Build.Step).init(b.allocator);
errdefer steps.deinit();
var steps: std.ArrayList(*std.Build.Step) = .empty;
errdefer steps.deinit(b.allocator);
const manpages = [_]struct {
name: []const u8,
@@ -52,7 +52,7 @@ pub fn init(
const generate_markdown_step = b.addRunArtifact(generate_markdown);
const markdown_output = generate_markdown_step.captureStdOut();
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
markdown_output,
"share/ghostty/doc/" ++ manpage.name ++ "." ++ manpage.section ++ ".md",
).step);
@@ -67,7 +67,7 @@ pub fn init(
});
generate_html.addFileArg(markdown_output);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
generate_html.captureStdOut(),
"share/ghostty/doc/" ++ manpage.name ++ "." ++ manpage.section ++ ".html",
).step);
@@ -82,7 +82,7 @@ pub fn init(
});
generate_manpage.addFileArg(markdown_output);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
generate_manpage.captureStdOut(),
"share/man/man" ++ manpage.section ++ "/" ++ manpage.name ++ "." ++ manpage.section,
).step);

View File

@@ -21,6 +21,8 @@ pub fn init(b: *std.Build, cfg: *const Config, deps: *const SharedDeps) !Ghostty
.omit_frame_pointer = cfg.strip,
.unwind_tables = if (cfg.strip) .none else .sync,
}),
// Crashes on x86_64 self-hosted on 0.15.1
.use_llvm = true,
});
const install_step = b.addInstallArtifact(exe, .{});

View File

@@ -40,7 +40,10 @@ pub fn distResources(b: *std.Build) struct {
} {
const exe = b.addExecutable(.{
.name = "framegen",
.target = b.graph.host,
.root_module = b.createModule(.{
.target = b.graph.host,
}),
.use_llvm = true,
});
exe.addCSourceFile(.{
.file = b.path("src/build/framegen/main.c"),

View File

@@ -18,8 +18,8 @@ update_step: *std.Build.Step,
pub fn init(b: *std.Build, cfg: *const Config) !GhosttyI18n {
_ = cfg;
var steps = std.ArrayList(*std.Build.Step).init(b.allocator);
defer steps.deinit();
var steps: std.ArrayList(*std.Build.Step) = .empty;
defer steps.deinit(b.allocator);
inline for (locales) |locale| {
// There is no encoding suffix in the LC_MESSAGES path on FreeBSD,
@@ -33,7 +33,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyI18n {
const msgfmt = b.addSystemCommand(&.{ "msgfmt", "-o", "-" });
msgfmt.addFileArg(b.path("po/" ++ locale ++ ".po"));
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
msgfmt.captureStdOut(),
std.fmt.comptimePrint(
"share/locale/{s}/LC_MESSAGES/{s}.mo",
@@ -45,7 +45,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyI18n {
return .{
.owner = b,
.update_step = try createUpdateStep(b),
.steps = try steps.toOwnedSlice(),
.steps = try steps.toOwnedSlice(b.allocator),
};
}

View File

@@ -28,7 +28,9 @@ pub fn initStatic(
.omit_frame_pointer = deps.config.strip,
.unwind_tables = if (deps.config.strip) .none else .sync,
}),
.linkage = .static,
// Fails on self-hosted x86_64 on macOS
.use_llvm = true,
});
lib.linkLibC();
@@ -40,7 +42,7 @@ pub fn initStatic(
// 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());
try lib_list.append(b.allocator, lib.getEmittedBin());
if (!deps.config.target.result.os.tag.isDarwin()) return .{
.step = &lib.step,
@@ -69,8 +71,9 @@ pub fn initShared(
b: *std.Build,
deps: *const SharedDeps,
) !GhosttyLib {
const lib = b.addSharedLibrary(.{
const lib = b.addLibrary(.{
.name = "ghostty",
.linkage = .dynamic,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main_c.zig"),
.target = deps.config.target,
@@ -79,6 +82,9 @@ pub fn initShared(
.omit_frame_pointer = deps.config.strip,
.unwind_tables = if (deps.config.strip) .none else .sync,
}),
// Fails on self-hosted x86_64
.use_llvm = true,
});
_ = try deps.add(lib);

View File

@@ -24,8 +24,9 @@ pub fn initShared(
zig: *const GhosttyZig,
) !GhosttyLibVt {
const target = zig.vt.resolved_target.?;
const lib = b.addSharedLibrary(.{
const lib = b.addLibrary(.{
.name = "ghostty-vt",
.linkage = .dynamic,
.root_module = zig.vt_c,
.version = std.SemanticVersion{ .major = 0, .minor = 1, .patch = 0 },
});

View File

@@ -10,8 +10,8 @@ const RunStep = std.Build.Step.Run;
steps: []*std.Build.Step,
pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
var steps = std.ArrayList(*std.Build.Step).init(b.allocator);
errdefer steps.deinit();
var steps: std.ArrayList(*std.Build.Step) = .empty;
errdefer steps.deinit(b.allocator);
// This is the exe used to generate some build data.
const build_data_exe = b.addExecutable(.{
@@ -49,7 +49,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
"share/terminfo/ghostty.terminfo",
);
try steps.append(&source_install.step);
try steps.append(b.allocator, &source_install.step);
}
// Windows doesn't have the binaries below.
@@ -73,7 +73,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
"share/terminfo/ghostty.termcap",
);
try steps.append(&cap_install.step);
try steps.append(b.allocator, &cap_install.step);
}
// Compile the terminfo source into a terminfo database
@@ -99,7 +99,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.{ b.install_path, terminfo_share_dir },
));
try steps.append(&mkdir_step.step);
try steps.append(b.allocator, &mkdir_step.step);
// Use cp -R instead of Step.InstallDir because we need to preserve
// symlinks in the terminfo database. Zig's InstallDir step doesn't
@@ -109,7 +109,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
copy_step.addFileArg(path);
copy_step.addArg(b.fmt("{s}/share", .{b.install_path}));
copy_step.step.dependOn(&mkdir_step.step);
try steps.append(&copy_step.step);
try steps.append(b.allocator, &copy_step.step);
}
}
@@ -121,7 +121,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_subdir = b.pathJoin(&.{ "ghostty", "shell-integration" }),
.exclude_extensions = &.{".md"},
});
try steps.append(&install_step.step);
try steps.append(b.allocator, &install_step.step);
}
// Themes
@@ -132,7 +132,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_subdir = b.pathJoin(&.{ "ghostty", "themes" }),
.exclude_extensions = &.{".md"},
});
try steps.append(&install_step.step);
try steps.append(b.allocator, &install_step.step);
}
// Fish shell completions
@@ -147,7 +147,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_dir = .prefix,
.install_subdir = "share/fish/vendor_completions.d",
});
try steps.append(&install_step.step);
try steps.append(b.allocator, &install_step.step);
}
// zsh shell completions
@@ -162,7 +162,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_dir = .prefix,
.install_subdir = "share/zsh/site-functions",
});
try steps.append(&install_step.step);
try steps.append(b.allocator, &install_step.step);
}
// bash shell completions
@@ -177,7 +177,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_dir = .prefix,
.install_subdir = "share/bash-completion/completions",
});
try steps.append(&install_step.step);
try steps.append(b.allocator, &install_step.step);
}
// Vim and Neovim plugin
@@ -210,14 +210,14 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_dir = .prefix,
.install_subdir = "share/vim/vimfiles",
});
try steps.append(&vim_step.step);
try steps.append(b.allocator, &vim_step.step);
const neovim_step = b.addInstallDirectory(.{
.source_dir = wf.getDirectory(),
.install_dir = .prefix,
.install_subdir = "share/nvim/site",
});
try steps.append(&neovim_step.step);
try steps.append(b.allocator, &neovim_step.step);
}
// Sublime syntax highlighting for bat cli tool
@@ -237,7 +237,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
.install_dir = .prefix,
.install_subdir = "share/bat/syntaxes",
});
try steps.append(&install_step.step);
try steps.append(b.allocator, &install_step.step);
}
// App (Linux)
@@ -286,16 +286,17 @@ fn addLinuxAppResources(
// second element of the tuple.
const Template = struct { std.Build.LazyPath, []const u8 };
const templates: []const Template = templates: {
var ts: std.ArrayList(Template) = .init(b.allocator);
var ts: std.ArrayList(Template) = .empty;
defer ts.deinit(b.allocator);
// Desktop file so that we have an icon and other metadata
try ts.append(.{
try ts.append(b.allocator, .{
b.path("dist/linux/app.desktop.in"),
b.fmt("share/applications/{s}.desktop", .{app_id}),
});
// Service for DBus activation.
try ts.append(.{
try ts.append(b.allocator, .{
if (cfg.flatpak)
b.path("dist/linux/dbus.service.flatpak.in")
else
@@ -320,7 +321,7 @@ fn addLinuxAppResources(
// See the following code:
//
// https://github.com/flatpak/xdg-desktop-portal/blob/7d4d48cf079147c8887da17ec6c3954acd5a285c/src/xdp-utils.c#L152-L220
if (!cfg.flatpak) try ts.append(.{
if (!cfg.flatpak) try ts.append(b.allocator, .{
b.path("dist/linux/systemd.service.in"),
b.fmt(
"{s}/systemd/user/app-{s}.service",
@@ -333,12 +334,12 @@ fn addLinuxAppResources(
// AppStream metainfo so that application has rich metadata
// within app stores
try ts.append(.{
try ts.append(b.allocator, .{
b.path("dist/linux/com.mitchellh.ghostty.metainfo.xml.in"),
b.fmt("share/metainfo/{s}.metainfo.xml", .{app_id}),
});
break :templates ts.items;
break :templates try ts.toOwnedSlice(b.allocator);
};
// Process all our templates
@@ -361,65 +362,65 @@ fn addLinuxAppResources(
template[1],
);
try steps.append(&copy.step);
try steps.append(b.allocator, &copy.step);
}
// Right click menu action for Plasma desktop
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("dist/linux/ghostty_dolphin.desktop"),
"share/kio/servicemenus/com.mitchellh.ghostty.desktop",
).step);
// Right click menu action for Nautilus. Note that this _must_ be named
// `ghostty.py`. Using the full app id causes problems (see #5468).
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("dist/linux/ghostty_nautilus.py"),
"share/nautilus-python/extensions/ghostty.py",
).step);
// Various icons that our application can use, including the icon
// that will be used for the desktop.
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/16.png"),
"share/icons/hicolor/16x16/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/32.png"),
"share/icons/hicolor/32x32/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/128.png"),
"share/icons/hicolor/128x128/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/256.png"),
"share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/512.png"),
"share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png",
).step);
// Flatpaks only support icons up to 512x512.
if (!cfg.flatpak) {
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/1024.png"),
"share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png",
).step);
}
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/32.png"),
"share/icons/hicolor/16x16@2/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/64.png"),
"share/icons/hicolor/32x32@2/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/256.png"),
"share/icons/hicolor/128x128@2/apps/com.mitchellh.ghostty.png",
).step);
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
b.path("images/gnome/512.png"),
"share/icons/hicolor/256x256@2/apps/com.mitchellh.ghostty.png",
).step);

View File

@@ -12,8 +12,8 @@ pub fn init(
b: *std.Build,
deps: *const SharedDeps,
) !GhosttyWebdata {
var steps = std.ArrayList(*std.Build.Step).init(b.allocator);
errdefer steps.deinit();
var steps: std.ArrayList(*std.Build.Step) = .empty;
errdefer steps.deinit(b.allocator);
{
const webgen_config = b.addExecutable(.{
@@ -43,7 +43,7 @@ pub fn init(
const webgen_config_step = b.addRunArtifact(webgen_config);
const webgen_config_out = webgen_config_step.captureStdOut();
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
webgen_config_out,
"share/ghostty/webdata/config.mdx",
).step);
@@ -52,8 +52,10 @@ pub fn init(
{
const webgen_actions = b.addExecutable(.{
.name = "webgen_actions",
.root_source_file = b.path("src/main.zig"),
.target = b.graph.host,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = b.graph.host,
}),
});
deps.help_strings.addImport(webgen_actions);
@@ -72,7 +74,7 @@ pub fn init(
const webgen_actions_step = b.addRunArtifact(webgen_actions);
const webgen_actions_out = webgen_actions_step.captureStdOut();
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
webgen_actions_out,
"share/ghostty/webdata/actions.mdx",
).step);
@@ -81,8 +83,10 @@ pub fn init(
{
const webgen_commands = b.addExecutable(.{
.name = "webgen_commands",
.root_source_file = b.path("src/main.zig"),
.target = b.graph.host,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = b.graph.host,
}),
});
deps.help_strings.addImport(webgen_commands);
@@ -101,7 +105,7 @@ pub fn init(
const webgen_commands_step = b.addRunArtifact(webgen_commands);
const webgen_commands_out = webgen_commands_step.captureStdOut();
try steps.append(&b.addInstallFile(
try steps.append(b.allocator, &b.addInstallFile(
webgen_commands_out,
"share/ghostty/webdata/commands.mdx",
).step);

View File

@@ -44,7 +44,7 @@ pub fn create(b: *std.Build, opts: Options) ?*MetallibStep {
const self = b.allocator.create(MetallibStep) catch @panic("OOM");
const min_version = if (opts.target.query.os_version_min) |v|
b.fmt("{}", .{v.semver})
b.fmt("{f}", .{v.semver})
else switch (opts.target.result.os.tag) {
.macos => "10.14",
.ios => "11.0",

View File

@@ -113,8 +113,8 @@ pub fn add(
// We maintain a list of our static libraries and return it so that
// we can build a single fat static library for the final app.
var static_libs = LazyPathList.init(b.allocator);
errdefer static_libs.deinit();
var static_libs: LazyPathList = .empty;
errdefer static_libs.deinit(b.allocator);
// WARNING: This is a hack!
// If we're cross-compiling to Darwin then we don't add any deps.
@@ -154,6 +154,7 @@ pub fn add(
} else {
step.linkLibrary(freetype_dep.artifact("freetype"));
try static_libs.append(
b.allocator,
freetype_dep.artifact("freetype").getEmittedBin(),
);
}
@@ -178,6 +179,7 @@ pub fn add(
} else {
step.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));
try static_libs.append(
b.allocator,
harfbuzz_dep.artifact("harfbuzz").getEmittedBin(),
);
}
@@ -201,6 +203,7 @@ pub fn add(
} else {
step.linkLibrary(fontconfig_dep.artifact("fontconfig"));
try static_libs.append(
b.allocator,
fontconfig_dep.artifact("fontconfig").getEmittedBin(),
);
}
@@ -218,6 +221,7 @@ pub fn add(
})) |libpng_dep| {
step.linkLibrary(libpng_dep.artifact("png"));
try static_libs.append(
b.allocator,
libpng_dep.artifact("png").getEmittedBin(),
);
}
@@ -231,6 +235,7 @@ pub fn add(
})) |zlib_dep| {
step.linkLibrary(zlib_dep.artifact("z"));
try static_libs.append(
b.allocator,
zlib_dep.artifact("z").getEmittedBin(),
);
}
@@ -250,6 +255,7 @@ pub fn add(
} else {
step.linkLibrary(oniguruma_dep.artifact("oniguruma"));
try static_libs.append(
b.allocator,
oniguruma_dep.artifact("oniguruma").getEmittedBin(),
);
}
@@ -270,6 +276,7 @@ pub fn add(
} else {
step.linkLibrary(glslang_dep.artifact("glslang"));
try static_libs.append(
b.allocator,
glslang_dep.artifact("glslang").getEmittedBin(),
);
}
@@ -289,6 +296,7 @@ pub fn add(
} else {
step.linkLibrary(spirv_cross_dep.artifact("spirv_cross"));
try static_libs.append(
b.allocator,
spirv_cross_dep.artifact("spirv_cross").getEmittedBin(),
);
}
@@ -307,6 +315,7 @@ pub fn add(
);
step.linkLibrary(sentry_dep.artifact("sentry"));
try static_libs.append(
b.allocator,
sentry_dep.artifact("sentry").getEmittedBin(),
);
@@ -316,6 +325,7 @@ pub fn add(
.optimize = optimize,
})) |breakpad_dep| {
try static_libs.append(
b.allocator,
breakpad_dep.artifact("breakpad").getEmittedBin(),
);
}
@@ -443,6 +453,7 @@ pub fn add(
macos_dep.artifact("macos"),
);
try static_libs.append(
b.allocator,
macos_dep.artifact("macos").getEmittedBin(),
);
}
@@ -461,6 +472,7 @@ pub fn add(
})) |libintl_dep| {
step.linkLibrary(libintl_dep.artifact("intl"));
try static_libs.append(
b.allocator,
libintl_dep.artifact("intl").getEmittedBin(),
);
}
@@ -473,7 +485,10 @@ pub fn add(
})) |cimgui_dep| {
step.root_module.addImport("cimgui", cimgui_dep.module("cimgui"));
step.linkLibrary(cimgui_dep.artifact("cimgui"));
try static_libs.append(cimgui_dep.artifact("cimgui").getEmittedBin());
try static_libs.append(
b.allocator,
cimgui_dep.artifact("cimgui").getEmittedBin(),
);
}
// Fonts
@@ -697,6 +712,7 @@ pub fn addSimd(
})) |simdutf_dep| {
m.linkLibrary(simdutf_dep.artifact("simdutf"));
if (static_libs) |v| try v.append(
b.allocator,
simdutf_dep.artifact("simdutf").getEmittedBin(),
);
}
@@ -708,7 +724,10 @@ pub fn addSimd(
.optimize = optimize,
})) |highway_dep| {
m.linkLibrary(highway_dep.artifact("highway"));
if (static_libs) |v| try v.append(highway_dep.artifact("highway").getEmittedBin());
if (static_libs) |v| try v.append(
b.allocator,
highway_dep.artifact("highway").getEmittedBin(),
);
}
// utfcpp - This is used as a dependency on our hand-written C++ code
@@ -717,7 +736,10 @@ pub fn addSimd(
.optimize = optimize,
})) |utfcpp_dep| {
m.linkLibrary(utfcpp_dep.artifact("utfcpp"));
if (static_libs) |v| try v.append(utfcpp_dep.artifact("utfcpp").getEmittedBin());
if (static_libs) |v| try v.append(
b.allocator,
utfcpp_dep.artifact("utfcpp").getEmittedBin(),
);
}
// SIMD C++ files
@@ -761,16 +783,20 @@ pub fn gtkNgDistResources(
const gresource_xml = gresource_xml: {
const xml_exe = b.addExecutable(.{
.name = "generate_gresource_xml",
.root_source_file = b.path("src/apprt/gtk/build/gresource.zig"),
.target = b.graph.host,
.root_module = b.createModule(.{
.root_source_file = b.path("src/apprt/gtk/build/gresource.zig"),
.target = b.graph.host,
}),
});
const xml_run = b.addRunArtifact(xml_exe);
// Run our blueprint compiler across all of our blueprint files.
const blueprint_exe = b.addExecutable(.{
.name = "gtk_blueprint_compiler",
.root_source_file = b.path("src/apprt/gtk/build/blueprint.zig"),
.target = b.graph.host,
.root_module = b.createModule(.{
.root_source_file = b.path("src/apprt/gtk/build/blueprint.zig"),
.target = b.graph.host,
}),
});
blueprint_exe.linkLibC();
blueprint_exe.linkSystemLibrary2("gtk4", dynamic_link_opts);

View File

@@ -21,6 +21,9 @@ pub fn init(b: *std.Build, uucode_tables: std.Build.LazyPath) !UnicodeTables {
.omit_frame_pointer = false,
.unwind_tables = .sync,
}),
// TODO: x86_64 self-hosted crashes
.use_llvm = true,
});
const symbols_exe = b.addExecutable(.{
@@ -32,6 +35,9 @@ pub fn init(b: *std.Build, uucode_tables: std.Build.LazyPath) !UnicodeTables {
.omit_frame_pointer = false,
.unwind_tables = .sync,
}),
// TODO: x86_64 self-hosted crashes
.use_llvm = true,
});
if (b.lazyDependency("uucode", .{

View File

@@ -29,10 +29,10 @@ COPY ./build.zig /src
# Install zig
# https://ziglang.org/download/
RUN export ZIG_VERSION=$(sed -n -e 's/^.*requireZig("\(.*\)").*$/\1/p' build.zig) && curl -L -o /tmp/zig.tar.xz "https://ziglang.org/download/$ZIG_VERSION/zig-linux-$(uname -m)-$ZIG_VERSION.tar.xz" && \
RUN export ZIG_VERSION=$(sed -n -e 's/^.*requireZig("\(.*\)").*$/\1/p' build.zig) && curl -L -o /tmp/zig.tar.xz "https://ziglang.org/download/$ZIG_VERSION/zig-$(uname -m)-linux-$ZIG_VERSION.tar.xz" && \
tar -xf /tmp/zig.tar.xz -C /opt && \
rm /tmp/zig.tar.xz && \
ln -s "/opt/zig-linux-$(uname -m)-$ZIG_VERSION/zig" /usr/local/bin/zig
ln -s "/opt/zig-$(uname -m)-linux-$ZIG_VERSION/zig" /usr/local/bin/zig
COPY . /src

View File

@@ -2,12 +2,15 @@ const std = @import("std");
const gen = @import("mdgen.zig");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init;
const alloc = gpa.allocator();
const writer = std.io.getStdOut().writer();
var buffer: [1024]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const writer = &stdout_writer.interface;
try gen.substitute(alloc, @embedFile("ghostty_1_header.md"), writer);
try gen.genActions(writer);
try gen.genConfig(writer, true);
try gen.substitute(alloc, @embedFile("ghostty_1_footer.md"), writer);
try writer.flush();
}

View File

@@ -2,12 +2,15 @@ const std = @import("std");
const gen = @import("mdgen.zig");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init;
const alloc = gpa.allocator();
const output = std.io.getStdOut().writer();
try gen.substitute(alloc, @embedFile("ghostty_5_header.md"), output);
try gen.genConfig(output, false);
try gen.genKeybindActions(output);
try gen.substitute(alloc, @embedFile("ghostty_5_footer.md"), output);
var buffer: [1024]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const writer = &stdout_writer.interface;
try gen.substitute(alloc, @embedFile("ghostty_5_header.md"), writer);
try gen.genConfig(writer, false);
try gen.genKeybindActions(writer);
try gen.substitute(alloc, @embedFile("ghostty_5_footer.md"), writer);
try writer.flush();
}

View File

@@ -5,7 +5,7 @@ const Config = @import("../../config/Config.zig");
const Action = @import("../../cli/ghostty.zig").Action;
const KeybindAction = @import("../../input/Binding.zig").Action;
pub fn substitute(alloc: std.mem.Allocator, input: []const u8, writer: anytype) !void {
pub fn substitute(alloc: std.mem.Allocator, input: []const u8, writer: *std.Io.Writer) !void {
const output = try alloc.alloc(u8, std.mem.replacementSize(
u8,
input,
@@ -18,7 +18,7 @@ pub fn substitute(alloc: std.mem.Allocator, input: []const u8, writer: anytype)
try writer.writeAll(output);
}
pub fn genConfig(writer: anytype, cli: bool) !void {
pub fn genConfig(writer: *std.Io.Writer, cli: bool) !void {
try writer.writeAll(
\\
\\# CONFIGURATION OPTIONS
@@ -48,7 +48,7 @@ pub fn genConfig(writer: anytype, cli: bool) !void {
}
}
pub fn genActions(writer: anytype) !void {
pub fn genActions(writer: *std.Io.Writer) !void {
try writer.writeAll(
\\
\\# COMMAND LINE ACTIONS
@@ -83,7 +83,7 @@ pub fn genActions(writer: anytype) !void {
}
}
pub fn genKeybindActions(writer: anytype) !void {
pub fn genKeybindActions(writer: *std.Io.Writer) !void {
try writer.writeAll(
\\
\\# KEYBIND ACTIONS

View File

@@ -3,6 +3,8 @@ const help_strings = @import("help_strings");
const helpgen_actions = @import("../../input/helpgen_actions.zig");
pub fn main() !void {
const output = std.io.getStdOut().writer();
try helpgen_actions.generate(output, .markdown, true, std.heap.page_allocator);
var buffer: [2048]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const stdout = &stdout_writer.interface;
try helpgen_actions.generate(stdout, .markdown, true, std.heap.page_allocator);
}

View File

@@ -3,14 +3,16 @@ const Action = @import("../../cli/ghostty.zig").Action;
const help_strings = @import("help_strings");
pub fn main() !void {
const output = std.io.getStdOut().writer();
try genActions(output);
var buffer: [2048]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const stdout = &stdout_writer.interface;
try genActions(stdout);
}
// 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
// the files to edit.
pub fn genActions(writer: anytype) !void {
pub fn genActions(writer: *std.Io.Writer) !void {
// Write the header
try writer.writeAll(
\\---

View File

@@ -3,11 +3,13 @@ const Config = @import("../../config/Config.zig");
const help_strings = @import("help_strings");
pub fn main() !void {
const output = std.io.getStdOut().writer();
try genConfig(output);
var buffer: [2048]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const stdout = &stdout_writer.interface;
try genConfig(stdout);
}
pub fn genConfig(writer: anytype) !void {
pub fn genConfig(writer: *std.Io.Writer) !void {
// Write the header
try writer.writeAll(
\\---
@@ -122,7 +124,7 @@ pub fn genConfig(writer: anytype) !void {
}
}
fn endBlock(writer: anytype, block: anytype) !void {
fn endBlock(writer: *std.Io.Writer, block: anytype) !void {
if (block) |v| switch (v) {
.text => {},
.code => try writer.writeAll("```\n"),

View File

@@ -162,10 +162,11 @@ pub fn parse(
error.InvalidField => "unknown field",
error.ValueRequired => formatValueRequired(T, arena_alloc, key) catch "value required",
error.InvalidValue => formatInvalidValue(T, arena_alloc, key, value) catch "invalid value",
else => try std.fmt.allocPrintZ(
else => try std.fmt.allocPrintSentinel(
arena_alloc,
"unknown error {}",
.{err},
0,
),
};
@@ -235,14 +236,16 @@ fn formatValueRequired(
comptime T: type,
arena_alloc: std.mem.Allocator,
key: []const u8,
) std.mem.Allocator.Error![:0]const u8 {
var buf = std.ArrayList(u8).init(arena_alloc);
errdefer buf.deinit();
const writer = buf.writer();
) std.Io.Writer.Error![:0]const u8 {
var stream: std.Io.Writer.Allocating = .init(arena_alloc);
const writer = &stream.writer;
try writer.print("value required", .{});
try formatValues(T, key, writer);
try writer.writeByte(0);
return buf.items[0 .. buf.items.len - 1 :0];
const written = stream.written();
return written[0 .. written.len - 1 :0];
}
fn formatInvalidValue(
@@ -250,17 +253,23 @@ fn formatInvalidValue(
arena_alloc: std.mem.Allocator,
key: []const u8,
value: ?[]const u8,
) std.mem.Allocator.Error![:0]const u8 {
var buf = std.ArrayList(u8).init(arena_alloc);
errdefer buf.deinit();
const writer = buf.writer();
) std.Io.Writer.Error![:0]const u8 {
var stream: std.Io.Writer.Allocating = .init(arena_alloc);
const writer = &stream.writer;
try writer.print("invalid value \"{?s}\"", .{value});
try formatValues(T, key, writer);
try writer.writeByte(0);
return buf.items[0 .. buf.items.len - 1 :0];
const written = stream.written();
return written[0 .. written.len - 1 :0];
}
fn formatValues(comptime T: type, key: []const u8, writer: anytype) std.mem.Allocator.Error!void {
fn formatValues(
comptime T: type,
key: []const u8,
writer: *std.Io.Writer,
) std.Io.Writer.Error!void {
@setEvalBranchQuota(2000);
const typeinfo = @typeInfo(T);
inline for (typeinfo.@"struct".fields) |f| {
@@ -324,7 +333,7 @@ pub fn parseIntoField(
return;
}
const raw = field.default_value_ptr orelse break :default;
const ptr: *const field.type = @alignCast(@ptrCast(raw));
const ptr: *const field.type = @ptrCast(@alignCast(raw));
@field(dst, field.name) = ptr.*;
return;
}
@@ -542,8 +551,8 @@ pub fn parseAutoStruct(
const key = std.mem.trim(u8, entry[0..idx], whitespace);
// used if we need to decode a double-quoted string.
var buf: std.ArrayListUnmanaged(u8) = .empty;
defer buf.deinit(alloc);
var buf: std.Io.Writer.Allocating = .init(alloc);
defer buf.deinit();
const value = value: {
const value = std.mem.trim(u8, entry[idx + 1 ..], whitespace);
@@ -554,10 +563,9 @@ pub fn parseAutoStruct(
value[value.len - 1] == '"')
{
// Decode a double-quoted string as a Zig string literal.
const writer = buf.writer(alloc);
const parsed = try std.zig.string_literal.parseWrite(writer, value);
const parsed = try std.zig.string_literal.parseWrite(&buf.writer, value);
if (parsed == .failure) return error.InvalidValue;
break :value buf.items;
break :value buf.written();
}
break :value value;
@@ -586,7 +594,7 @@ pub fn parseAutoStruct(
break :default @field(default, field.name);
} else {
const default_ptr = field.default_value_ptr orelse return error.InvalidValue;
const typed_ptr: *const field.type = @alignCast(@ptrCast(default_ptr));
const typed_ptr: *const field.type = @ptrCast(@alignCast(default_ptr));
break :default typed_ptr.*;
}
};
@@ -795,15 +803,13 @@ test "parse: diagnostic location" {
} = .{};
defer if (data._arena) |arena| arena.deinit();
var fbs = std.io.fixedBufferStream(
var r: std.Io.Reader = .fixed(
\\a=42
\\what
\\b=two
);
const r = fbs.reader();
const Iter = LineIterator(@TypeOf(r));
var iter: Iter = .{ .r = r, .filepath = "test" };
var iter: LineIterator = .{ .r = &r, .filepath = "test" };
try parse(@TypeOf(data), testing.allocator, &data, &iter);
try testing.expect(data._arena != null);
try testing.expectEqualStrings("42", data.a);
@@ -1208,18 +1214,7 @@ test "parseIntoField: struct with basic fields" {
try testing.expectEqual(84, data.value.b);
try testing.expectEqual(24, data.value.c);
// Set with explicit default
data.value = try parseAutoStruct(
@TypeOf(data.value),
alloc,
"a:hello",
.{ .a = "oh no", .b = 42 },
);
try testing.expectEqualStrings("hello", data.value.a);
try testing.expectEqual(42, data.value.b);
try testing.expectEqual(12, data.value.c);
// Missing required field
// Missing require dfield
try testing.expectError(
error.InvalidValue,
parseIntoField(@TypeOf(data), alloc, &data, "value", "a:hello"),
@@ -1395,115 +1390,119 @@ test "ArgsIterator" {
/// Returns an iterator (implements "next") that reads CLI args by line.
/// Each CLI arg is expected to be a single line. This is used to implement
/// configuration files.
pub fn LineIterator(comptime ReaderType: type) type {
return struct {
const Self = @This();
pub const LineIterator = struct {
const Self = @This();
/// The maximum size a single line can be. We don't expect any
/// CLI arg to exceed this size. Can't wait to git blame this in
/// like 4 years and be wrong about this.
pub const MAX_LINE_SIZE = 4096;
/// The maximum size a single line can be. We don't expect any
/// CLI arg to exceed this size. Can't wait to git blame this in
/// like 4 years and be wrong about this.
pub const MAX_LINE_SIZE = 4096;
/// Our stateful reader.
r: ReaderType,
/// Our stateful reader.
r: *std.Io.Reader,
/// Filepath that is used for diagnostics. This is only used for
/// diagnostic messages so it can be formatted however you want.
/// It is prefixed to the messages followed by the line number.
filepath: []const u8 = "",
/// Filepath that is used for diagnostics. This is only used for
/// diagnostic messages so it can be formatted however you want.
/// It is prefixed to the messages followed by the line number.
filepath: []const u8 = "",
/// The current line that we're on. This is 1-indexed because
/// lines are generally 1-indexed in the real world. The value
/// can be zero if we haven't read any lines yet.
line: usize = 0,
/// The current line that we're on. This is 1-indexed because
/// lines are generally 1-indexed in the real world. The value
/// can be zero if we haven't read any lines yet.
line: usize = 0,
/// This is the buffer where we store the current entry that
/// is formatted to be compatible with the parse function.
entry: [MAX_LINE_SIZE]u8 = [_]u8{ '-', '-' } ++ ([_]u8{0} ** (MAX_LINE_SIZE - 2)),
/// This is the buffer where we store the current entry that
/// is formatted to be compatible with the parse function.
entry: [MAX_LINE_SIZE]u8 = [_]u8{ '-', '-' } ++ ([_]u8{0} ** (MAX_LINE_SIZE - 2)),
pub fn next(self: *Self) ?[]const u8 {
// TODO: detect "--" prefixed lines and give a friendlier error
const buf = buf: {
while (true) {
// Read the full line
var entry = self.r.readUntilDelimiterOrEof(self.entry[2..], '\n') catch |err| switch (err) {
inline else => |e| {
log.warn("cannot read from \"{s}\": {}", .{ self.filepath, e });
return null;
},
} orelse return null;
pub fn init(reader: *std.Io.Reader) Self {
return .{ .r = reader };
}
// Increment our line counter
self.line += 1;
pub fn next(self: *Self) ?[]const u8 {
// First prime the reader.
// File readers at least are initialized with a size of 0,
// and this will actually prompt the reader to get the actual
// size of the file, which will be used in the EOF check below.
//
// This will also optimize reads down the line as we're
// more likely to beworking with buffered data.
self.r.fillMore() catch {};
// Trim any whitespace (including CR) around it
const trim = std.mem.trim(u8, entry, whitespace ++ "\r");
if (trim.len != entry.len) {
std.mem.copyForwards(u8, entry, trim);
entry = entry[0..trim.len];
}
var writer: std.Io.Writer = .fixed(self.entry[2..]);
// Ignore blank lines and comments
if (entry.len == 0 or entry[0] == '#') continue;
var entry = while (self.r.seek != self.r.end) {
// Reset write head
writer.end = 0;
// Trim spaces around '='
if (mem.indexOf(u8, entry, "=")) |idx| {
const key = std.mem.trim(u8, entry[0..idx], whitespace);
const value = value: {
var value = std.mem.trim(u8, entry[idx + 1 ..], whitespace);
_ = self.r.streamDelimiterEnding(&writer, '\n') catch |e| {
log.warn("cannot read from \"{s}\": {}", .{ self.filepath, e });
return null;
};
_ = self.r.discardDelimiterInclusive('\n') catch {};
// Detect a quoted string.
if (value.len >= 2 and
value[0] == '"' and
value[value.len - 1] == '"')
{
// Trim quotes since our CLI args processor expects
// quotes to already be gone.
value = value[1 .. value.len - 1];
}
var entry = writer.buffered();
self.line += 1;
break :value value;
};
// Trim any whitespace (including CR) around it
const trim = std.mem.trim(u8, entry, whitespace ++ "\r");
if (trim.len != entry.len) {
std.mem.copyForwards(u8, entry, trim);
entry = entry[0..trim.len];
}
const len = key.len + value.len + 1;
if (entry.len != len) {
std.mem.copyForwards(u8, entry, key);
entry[key.len] = '=';
std.mem.copyForwards(u8, entry[key.len + 1 ..], value);
entry = entry[0..len];
}
}
// Ignore blank lines and comments
if (entry.len == 0 or entry[0] == '#') continue;
break entry;
} else return null;
break :buf entry;
if (mem.indexOf(u8, entry, "=")) |idx| {
const key = std.mem.trim(u8, entry[0..idx], whitespace);
const value = value: {
var value = std.mem.trim(u8, entry[idx + 1 ..], whitespace);
// Detect a quoted string.
if (value.len >= 2 and
value[0] == '"' and
value[value.len - 1] == '"')
{
// Trim quotes since our CLI args processor expects
// quotes to already be gone.
value = value[1 .. value.len - 1];
}
break :value value;
};
// We need to reslice so that we include our '--' at the beginning
// of our buffer so that we can trick the CLI parser to treat it
// as CLI args.
return self.entry[0 .. buf.len + 2];
const len = key.len + value.len + 1;
if (entry.len != len) {
std.mem.copyForwards(u8, entry, key);
entry[key.len] = '=';
std.mem.copyForwards(u8, entry[key.len + 1 ..], value);
entry = entry[0..len];
}
}
/// Returns a location for a diagnostic message.
pub fn location(
self: *const Self,
alloc: Allocator,
) Allocator.Error!?diags.Location {
// If we have no filepath then we have no location.
if (self.filepath.len == 0) return null;
// We need to reslice so that we include our '--' at the beginning
// of our buffer so that we can trick the CLI parser to treat it
// as CLI args.
return self.entry[0 .. entry.len + 2];
}
return .{ .file = .{
.path = try alloc.dupe(u8, self.filepath),
.line = self.line,
} };
}
};
}
/// Returns a location for a diagnostic message.
pub fn location(
self: *const Self,
alloc: Allocator,
) Allocator.Error!?diags.Location {
// If we have no filepath then we have no location.
if (self.filepath.len == 0) return null;
// Constructs a LineIterator (see docs for that).
fn lineIterator(reader: anytype) LineIterator(@TypeOf(reader)) {
return .{ .r = reader };
}
return .{ .file = .{
.path = try alloc.dupe(u8, self.filepath),
.line = self.line,
} };
}
};
/// An iterator valid for arg parsing from a slice.
pub const SliceIterator = struct {
@@ -1526,7 +1525,7 @@ pub fn sliceIterator(slice: []const []const u8) SliceIterator {
test "LineIterator" {
const testing = std.testing;
var fbs = std.io.fixedBufferStream(
var reader: std.Io.Reader = .fixed(
\\A
\\B=42
\\C
@@ -1541,7 +1540,7 @@ test "LineIterator" {
\\F= "value "
);
var iter = lineIterator(fbs.reader());
var iter: LineIterator = .init(&reader);
try testing.expectEqualStrings("--A", iter.next().?);
try testing.expectEqualStrings("--B=42", iter.next().?);
try testing.expectEqualStrings("--C", iter.next().?);
@@ -1554,9 +1553,9 @@ test "LineIterator" {
test "LineIterator end in newline" {
const testing = std.testing;
var fbs = std.io.fixedBufferStream("A\n\n");
var reader: std.Io.Reader = .fixed("A\n\n");
var iter = lineIterator(fbs.reader());
var iter: LineIterator = .init(&reader);
try testing.expectEqualStrings("--A", iter.next().?);
try testing.expectEqual(@as(?[]const u8, null), iter.next());
try testing.expectEqual(@as(?[]const u8, null), iter.next());
@@ -1564,9 +1563,9 @@ test "LineIterator end in newline" {
test "LineIterator spaces around '='" {
const testing = std.testing;
var fbs = std.io.fixedBufferStream("A = B\n\n");
var reader: std.Io.Reader = .fixed("A = B\n\n");
var iter = lineIterator(fbs.reader());
var iter: LineIterator = .init(&reader);
try testing.expectEqualStrings("--A=B", iter.next().?);
try testing.expectEqual(@as(?[]const u8, null), iter.next());
try testing.expectEqual(@as(?[]const u8, null), iter.next());
@@ -1574,18 +1573,18 @@ test "LineIterator spaces around '='" {
test "LineIterator no value" {
const testing = std.testing;
var fbs = std.io.fixedBufferStream("A = \n\n");
var reader: std.Io.Reader = .fixed("A = \n\n");
var iter = lineIterator(fbs.reader());
var iter: LineIterator = .init(&reader);
try testing.expectEqualStrings("--A=", iter.next().?);
try testing.expectEqual(@as(?[]const u8, null), iter.next());
}
test "LineIterator with CRLF line endings" {
const testing = std.testing;
var fbs = std.io.fixedBufferStream("A\r\nB = C\r\n");
var reader: std.Io.Reader = .fixed("A\r\nB = C\r\n");
var iter = lineIterator(fbs.reader());
var iter: LineIterator = .init(&reader);
try testing.expectEqualStrings("--A", iter.next().?);
try testing.expectEqualStrings("--B=C", iter.next().?);
try testing.expectEqual(@as(?[]const u8, null), iter.next());

View File

@@ -6,7 +6,7 @@ const Allocator = std.mem.Allocator;
const help_strings = @import("help_strings");
const vaxis = @import("vaxis");
const framedata = @import("framedata");
const framedata = @embedFile("framedata");
const vxfw = vaxis.vxfw;
@@ -218,17 +218,20 @@ var frames: []const []const u8 = undefined;
/// Decompress the frames into a slice of individual frames
fn decompressFrames(gpa: Allocator) !void {
var fbs = std.io.fixedBufferStream(framedata.compressed);
var list = std.ArrayList(u8).init(gpa);
var src: std.Io.Reader = .fixed(framedata);
try std.compress.flate.decompress(fbs.reader(), list.writer());
decompressed_data = try list.toOwnedSlice();
// var buf: [std.compress.flate.max_window_len]u8 = undefined;
var decompress: std.compress.flate.Decompress = .init(&src, .raw, &.{});
var frame_list = try std.ArrayList([]const u8).initCapacity(gpa, 235);
var out: std.Io.Writer.Allocating = .init(gpa);
_ = try decompress.reader.streamRemaining(&out.writer);
decompressed_data = try out.toOwnedSlice();
var frame_list: std.ArrayList([]const u8) = try .initCapacity(gpa, 235);
var frame_iter = std.mem.splitScalar(u8, decompressed_data, '\x01');
while (frame_iter.next()) |frame| {
try frame_list.append(frame);
try frame_list.append(gpa, frame);
}
frames = try frame_list.toOwnedSlice();
frames = try frame_list.toOwnedSlice(gpa);
}

View File

@@ -38,21 +38,35 @@ pub fn run(alloc_gpa: Allocator) !u8 {
try args.parse(Options, alloc_gpa, &opts, &iter);
}
var buffer: [1024]u8 = undefined;
var stdout_file: std.fs.File = .stdout();
var stdout_writer = stdout_file.writer(&buffer);
const stdout = &stdout_writer.interface;
const result = runInner(alloc, &stdout_file, stdout);
stdout.flush() catch {};
return result;
}
fn runInner(
alloc: Allocator,
stdout_file: *std.fs.File,
stdout: *std.Io.Writer,
) !u8 {
const crash_dir = try crash.defaultDir(alloc);
var reports = std.ArrayList(crash.Report).init(alloc);
var reports: std.ArrayList(crash.Report) = .empty;
errdefer reports.deinit(alloc);
var it = try crash_dir.iterator();
while (try it.next()) |report| try reports.append(.{
while (try it.next()) |report| try reports.append(alloc, .{
.name = try alloc.dupe(u8, report.name),
.mtime = report.mtime,
});
const stdout = std.io.getStdOut();
// If we have no reports, then we're done. If we have a tty then we
// print a message, otherwise we do nothing.
if (reports.items.len == 0) {
if (std.posix.isatty(stdout.handle)) {
if (std.posix.isatty(stdout_file.handle)) {
try stdout.writeAll("No crash reports! 👻\n");
}
return 0;
@@ -60,16 +74,15 @@ pub fn run(alloc_gpa: Allocator) !u8 {
std.mem.sort(crash.Report, reports.items, {}, lt);
const writer = stdout.writer();
for (reports.items) |report| {
var buf: [128]u8 = undefined;
const now = std.time.nanoTimestamp();
const diff = now - report.mtime;
const since = if (diff <= 0) "now" else s: {
const d = Config.Duration{ .duration = @intCast(diff) };
break :s try std.fmt.bufPrint(&buf, "{s} ago", .{d.round(std.time.ns_per_s)});
break :s try std.fmt.bufPrint(&buf, "{f} ago", .{d.round(std.time.ns_per_s)});
};
try writer.print("{s} ({s})\n", .{ report.name, since });
try stdout.print("{s} ({s})\n", .{ report.name, since });
}
return 0;

View File

@@ -16,7 +16,7 @@ pub const Diagnostic = struct {
message: [:0]const u8,
/// Write the full user-friendly diagnostic message to the writer.
pub fn write(self: *const Diagnostic, writer: anytype) !void {
pub fn format(self: *const Diagnostic, writer: *std.Io.Writer) !void {
switch (self.location) {
.none => {},
.cli => |index| try writer.print("cli:{}:", .{index}),
@@ -157,11 +157,14 @@ pub const DiagnosticList = struct {
errdefer _ = self.list.pop();
if (comptime precompute_enabled) {
var buf = std.ArrayList(u8).init(alloc);
defer buf.deinit();
try diag.write(buf.writer());
var stream: std.Io.Writer.Allocating = .init(alloc);
defer stream.deinit();
diag.format(&stream.writer) catch |err| switch (err) {
// WriteFailed in this instance can only mean an OOM
error.WriteFailed => return error.OutOfMemory,
};
const owned: [:0]const u8 = try buf.toOwnedSliceSentinel(0);
const owned: [:0]const u8 = try stream.toOwnedSliceSentinel(0);
errdefer alloc.free(owned);
try self.precompute.messages.append(alloc, owned);

View File

@@ -47,7 +47,9 @@ pub fn run(alloc: Allocator) !u8 {
// not using `exec` anymore and because this command isn't performance
// critical where setting up the defer cleanup is a problem.
const stderr = std.io.getStdErr().writer();
var buffer: [1024]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&buffer);
const stderr = &stderr_writer.interface;
var opts: Options = .{};
defer opts.deinit();
@@ -58,6 +60,13 @@ pub fn run(alloc: Allocator) !u8 {
try args.parse(Options, alloc, &opts, &iter);
}
const result = runInner(alloc, stderr);
// Flushing *shouldn't* fail but...
stderr.flush() catch {};
return result;
}
fn runInner(alloc: Allocator, stderr: *std.Io.Writer) !u8 {
// We load the configuration once because that will write our
// default configuration files to disk. We don't use the config.
var config = try Config.load(alloc);
@@ -133,23 +142,13 @@ pub fn run(alloc: Allocator) !u8 {
// so this is not a big deal.
comptime assert(builtin.link_libc);
var buf: std.ArrayListUnmanaged(u8) = .empty;
errdefer buf.deinit(alloc);
const writer = buf.writer(alloc);
var shellescape: internal_os.ShellEscapeWriter(std.ArrayListUnmanaged(u8).Writer) = .init(writer);
var shellescapewriter = shellescape.writer();
try writer.writeAll(editor);
try writer.writeByte(' ');
try shellescapewriter.writeAll(path);
const command = try buf.toOwnedSliceSentinel(alloc, 0);
defer alloc.free(command);
const editorZ = try alloc.dupeZ(u8, editor);
defer alloc.free(editorZ);
const pathZ = try alloc.dupeZ(u8, path);
defer alloc.free(pathZ);
const err = std.posix.execvpeZ(
"sh",
&.{ "sh", "-c", command },
editorZ,
&.{ editorZ, pathZ },
std.c.environ,
);

View File

@@ -107,12 +107,18 @@ pub const Action = enum {
// for all commands by just changing this one place.
if (std.mem.eql(u8, field.name, @tagName(self))) {
const stdout = std.io.getStdOut().writer();
var buffer: [1024]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const stdout = &stdout_writer.interface;
const text = @field(help_strings.Action, field.name) ++ "\n";
stdout.writeAll(text) catch |write_err| {
std.log.warn("failed to write help text: {}\n", .{write_err});
break :err 1;
};
stdout.flush() catch |flush_err| {
std.log.warn("failed to flush help text: {}\n", .{flush_err});
break :err 1;
};
break :err 0;
}

View File

@@ -30,7 +30,9 @@ pub fn run(alloc: Allocator) !u8 {
try args.parse(Options, alloc, &opts, &iter);
}
const stdout = std.io.getStdOut().writer();
var buffer: [2048]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&buffer);
const stdout = &stdout_writer.interface;
try stdout.writeAll(
\\Usage: ghostty [+action] [options]
\\
@@ -70,6 +72,7 @@ pub fn run(alloc: Allocator) !u8 {
\\where `<action>` is one of actions listed above.
\\
);
try stdout.flush();
return 0;
}

Some files were not shown because too many files have changed in this diff Show More