From 8799dcbdf9d14803562f50bf4d4cc335ec2ea799 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Thu, 9 Jul 2026 11:41:54 +0200 Subject: [PATCH 1/8] Update to Zig 0.17.0 Doesn't compile :( Signed-off-by: AnErrupTion --- build.zig | 4 ++-- build.zig.zon | 8 ++++---- ly-core/build.zig.zon | 8 ++++---- ly-ui/build.zig.zon | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.zig b/build.zig index cdb0d1f..3faa646 100644 --- a/build.zig +++ b/build.zig @@ -130,7 +130,7 @@ pub fn build(b: *std.Build) !void { const run_cmd = b.addRunArtifact(exe); run_cmd.step.dependOn(b.getInstallStep()); - if (b.args) |args| run_cmd.addArgs(args); + run_cmd.addPassthruArgs(); const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); @@ -195,7 +195,7 @@ fn getVersionStr(b: *std.Build, name: []const u8, version: std.SemanticVersion) const git_describe_raw = b.runAllowFail(&[_][]const u8{ "git", "-C", - b.build_root.path orelse ".", + try b.root.toString(b.allocator), "describe", "--match", "*.*.*", diff --git a/build.zig.zon b/build.zig.zon index 1d19b69..211ed75 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -8,12 +8,12 @@ .path = "ly-ui", }, .clap = .{ - .url = "git+https://github.com/Hejsil/zig-clap#fc1e5cc3f6d9d3001112385ee6256d694e959d2f", - .hash = "clap-0.11.0-oBajB7foAQC3Iyn4IVCkUdYaOVVng5IZkSncySTjNig1", + .url = "git+https://github.com/Hejsil/zig-clap?ref=master#e91d66b1abba2024cd2e816426f14d233d3dad9a", + .hash = "clap-0.12.0-oBajB2LpAQD1BQpAukHcuwhIUoHWYNy2DzU6lDW2v2N8", }, .zlua = .{ - .url = "git+https://github.com/natecraddock/ziglua?ref=zig-0.16#8f271c82baa5fc43aa02a72f6da020c2025d9436", - .hash = "zlua-0.1.0-hGRpC2aABQD4D9PBVH3wAW8k32-I4969MRQ0CpOwoley", + .url = "git+https://github.com/AnErrupTion/ziglua?ref=zig-0.17#134fd6110e860672c32703d9c76588a1d5f6a3fa", + .hash = "zlua-0.1.0-hGRpC1mUBQDugHDyWzXaCjnAwr9wKKArY06QpVOFTFUM", }, }, .paths = .{ diff --git a/ly-core/build.zig.zon b/ly-core/build.zig.zon index 0d84326..d12c8ca 100644 --- a/ly-core/build.zig.zon +++ b/ly-core/build.zig.zon @@ -5,12 +5,12 @@ .minimum_zig_version = "0.16.0", .dependencies = .{ .zigini = .{ - .url = "git+https://github.com/AshAmetrine/zigini?ref=master#a665d081dda42664a96da2840ea09c5ccf9d0692", - .hash = "zigini-0.5.0-BSkB7e9WAACfyCBABNZiWL3gFMw18GKn3qBcPs8L1Ec1", + .url = "git+https://github.com/AnErrupTion/zigini?ref=zig-0.17#950eab7d96bb364379acca763695700670d75382", + .hash = "zigini-0.5.0-BSkB7eVXAADQTfcUPT8TUu79sONGQk1Xbaz4_Tu0VvQx", }, .translate_c = .{ - .url = "git+https://codeberg.org/ziglang/translate-c?ref=zig-0.16.x#6fe0ffc4549f15c5f2d9432c2b4460ba90ff85ac", - .hash = "translate_c-1.0.0-Q_BUWo_5BgD4flHdUhA31zOz0XvZk9k7lQv1ouzyNXj2", + .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#ba4288f6c0e8054d7894266949d4fa08bfc0212a", + .hash = "translate_c-0.0.0-Q_BUWvI3BwAFZWG2aNKspzHT7uv3yKuNMC5sP4C0hoYl", }, }, .paths = .{ diff --git a/ly-ui/build.zig.zon b/ly-ui/build.zig.zon index 68131d1..e082936 100644 --- a/ly-ui/build.zig.zon +++ b/ly-ui/build.zig.zon @@ -12,8 +12,8 @@ .hash = "N-V-__8AAAUXBQD6Fwpi9m0MBqWXFFaqW5l1lVrJC2Ynj7a-", }, .translate_c = .{ - .url = "git+https://codeberg.org/ziglang/translate-c?ref=zig-0.16.x#6fe0ffc4549f15c5f2d9432c2b4460ba90ff85ac", - .hash = "translate_c-1.0.0-Q_BUWo_5BgD4flHdUhA31zOz0XvZk9k7lQv1ouzyNXj2", + .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#ba4288f6c0e8054d7894266949d4fa08bfc0212a", + .hash = "translate_c-0.0.0-Q_BUWvI3BwAFZWG2aNKspzHT7uv3yKuNMC5sP4C0hoYl", }, }, .paths = .{ From f89e79c7f8e4df0b3db9d898faa132d877f3c518 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 12 Jul 2026 12:06:43 +0200 Subject: [PATCH 2/8] Fix compilation Signed-off-by: AnErrupTion --- build.zig.zon | 6 +++--- ly-core/build.zig.zon | 10 +++++----- ly-core/src/LogFile.zig | 4 ++-- ly-core/src/SharedError.zig | 4 ++-- ly-core/src/interop.zig | 6 +++--- ly-ui/build.zig.zon | 6 +++--- src/auth.zig | 30 +++++++++++++++--------------- src/main.zig | 9 +++++---- 8 files changed, 38 insertions(+), 37 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 211ed75..63d15f1 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,7 +2,7 @@ .name = .ly, .version = "1.5.0", .fingerprint = 0xa148ffcc5dc2cb59, - .minimum_zig_version = "0.16.0", + .minimum_zig_version = "0.17.0", .dependencies = .{ .ly_ui = .{ .path = "ly-ui", @@ -12,8 +12,8 @@ .hash = "clap-0.12.0-oBajB2LpAQD1BQpAukHcuwhIUoHWYNy2DzU6lDW2v2N8", }, .zlua = .{ - .url = "git+https://github.com/AnErrupTion/ziglua?ref=zig-0.17#134fd6110e860672c32703d9c76588a1d5f6a3fa", - .hash = "zlua-0.1.0-hGRpC1mUBQDugHDyWzXaCjnAwr9wKKArY06QpVOFTFUM", + .url = "git+https://github.com/AnErrupTion/ziglua?ref=zig-0.17#4cca15ac75967115830708ca28d1d3dcde729f04", + .hash = "zlua-0.1.0-hGRpC-aUBQCrVgFkeX-mNintLyM1i9_4FJU4mGSw0DgC", }, }, .paths = .{ diff --git a/ly-core/build.zig.zon b/ly-core/build.zig.zon index d12c8ca..897fe14 100644 --- a/ly-core/build.zig.zon +++ b/ly-core/build.zig.zon @@ -2,15 +2,15 @@ .name = .ly_core, .version = "1.1.0", .fingerprint = 0xddda7afda795472, - .minimum_zig_version = "0.16.0", + .minimum_zig_version = "0.17.0", .dependencies = .{ .zigini = .{ - .url = "git+https://github.com/AnErrupTion/zigini?ref=zig-0.17#950eab7d96bb364379acca763695700670d75382", - .hash = "zigini-0.5.0-BSkB7eVXAADQTfcUPT8TUu79sONGQk1Xbaz4_Tu0VvQx", + .url = "git+https://github.com/AnErrupTion/zigini?ref=zig-0.17.0#29b30ec37efccb022a57e7acda83d63fa5832dd8", + .hash = "zigini-0.6.0-BSkB7UtYAAB6b6HEm3Pjj5WIy-uiuBYsNTNCUENVwL1t", }, .translate_c = .{ - .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#ba4288f6c0e8054d7894266949d4fa08bfc0212a", - .hash = "translate_c-0.0.0-Q_BUWvI3BwAFZWG2aNKspzHT7uv3yKuNMC5sP4C0hoYl", + .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#2d71d6e68dd9e9ee1da2a248a1dcb5aeba683dec", + .hash = "translate_c-0.0.0-Q_BUWtI4BwDTFS7O6WTn-3qixa_s81nw_C0FHbf2aLqj", }, }, .paths = .{ diff --git a/ly-core/src/LogFile.zig b/ly-core/src/LogFile.zig index 192f338..885aa22 100644 --- a/ly-core/src/LogFile.zig +++ b/ly-core/src/LogFile.zig @@ -54,7 +54,7 @@ pub fn info(self: *LogFile, io: std.Io, category: []const u8, comptime message: } else { var buffer: [1024]u8 = undefined; const slice = try std.fmt.bufPrint(&buffer, message, args); - const msg = try std.fmt.bufPrintZ(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice }); + const msg = try std.fmt.bufPrintSentinel(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice }, 0); std.posix.system.syslog(std.posix.LOG.INFO, msg.ptr); } @@ -72,7 +72,7 @@ pub fn err(self: *LogFile, io: std.Io, category: []const u8, comptime message: [ } else { var buffer: [1024]u8 = undefined; const slice = try std.fmt.bufPrint(&buffer, message, args); - const msg = try std.fmt.bufPrintZ(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice }); + const msg = try std.fmt.bufPrintSentinel(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice }, 0); std.posix.system.syslog(std.posix.LOG.ERR, msg.ptr); } diff --git a/ly-core/src/SharedError.zig b/ly-core/src/SharedError.zig index c3ce088..75ad8d8 100644 --- a/ly-core/src/SharedError.zig +++ b/ly-core/src/SharedError.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const ErrInt = std.meta.Int(.unsigned, @bitSizeOf(anyerror)); -const PaddingInt = std.meta.Int(.unsigned, 8 - (@bitSizeOf(ErrInt) + @bitSizeOf(bool)) % 8); +const ErrInt = @Int(.unsigned, @bitSizeOf(anyerror)); +const PaddingInt = @Int(.unsigned, 8 - (@bitSizeOf(ErrInt) + @bitSizeOf(bool)) % 8); const ErrorHandler = packed struct { has_error: bool = false, diff --git a/ly-core/src/interop.zig b/ly-core/src/interop.zig index d894485..f4d6868 100644 --- a/ly-core/src/interop.zig +++ b/ly-core/src/interop.zig @@ -355,7 +355,7 @@ pub fn setNumlock(val: bool) !void { } pub fn setUserContext(allocator: std.mem.Allocator, entry: UsernameEntry) !void { - const username_z = try allocator.dupeZ(u8, entry.username.?); + const username_z = try allocator.dupeSentinel(u8, entry.username.?, 0); defer allocator.free(username_z); return platform_struct.setUserContextImpl(username_z.ptr, entry); @@ -371,10 +371,10 @@ pub fn setUserShell(entry: *UsernameEntry) void { } pub fn setEnvironmentVariable(allocator: std.mem.Allocator, name: []const u8, value: []const u8, replace: bool) !void { - const name_z = try allocator.dupeZ(u8, name); + const name_z = try allocator.dupeSentinel(u8, name, 0); defer allocator.free(name_z); - const value_z = try allocator.dupeZ(u8, value); + const value_z = try allocator.dupeSentinel(u8, value, 0); defer allocator.free(value_z); const status = stdlib.setenv(name_z.ptr, value_z.ptr, @intFromBool(replace)); diff --git a/ly-ui/build.zig.zon b/ly-ui/build.zig.zon index e082936..d328567 100644 --- a/ly-ui/build.zig.zon +++ b/ly-ui/build.zig.zon @@ -2,7 +2,7 @@ .name = .ly_ui, .version = "1.1.0", .fingerprint = 0x8d11bf85a74ec803, - .minimum_zig_version = "0.16.0", + .minimum_zig_version = "0.17.0", .dependencies = .{ .ly_core = .{ .path = "../ly-core", @@ -12,8 +12,8 @@ .hash = "N-V-__8AAAUXBQD6Fwpi9m0MBqWXFFaqW5l1lVrJC2Ynj7a-", }, .translate_c = .{ - .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#ba4288f6c0e8054d7894266949d4fa08bfc0212a", - .hash = "translate_c-0.0.0-Q_BUWvI3BwAFZWG2aNKspzHT7uv3yKuNMC5sP4C0hoYl", + .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#2d71d6e68dd9e9ee1da2a248a1dcb5aeba683dec", + .hash = "translate_c-0.0.0-Q_BUWtI4BwDTFS7O6WTn-3qixa_s81nw_C0FHbf2aLqj", }, }, .paths = .{ diff --git a/src/auth.zig b/src/auth.zig index c9abf15..6b122bf 100644 --- a/src/auth.zig +++ b/src/auth.zig @@ -41,7 +41,7 @@ pub fn authenticate(allocator: std.mem.Allocator, io: std.Io, log_file: *LogFile const tty_str = try std.fmt.bufPrint(&tty_buffer, "{d}", .{options.tty}); var pam_tty_buffer: [6]u8 = undefined; - const pam_tty_str = try std.fmt.bufPrintZ(&pam_tty_buffer, "tty{d}", .{options.tty}); + const pam_tty_str = try std.fmt.bufPrintSentinel(&pam_tty_buffer, "tty{d}", .{options.tty}, 0); // Set the XDG environment variables try log_file.info(io, "auth/env", "setting xdg environment variables", .{}); @@ -49,10 +49,10 @@ pub fn authenticate(allocator: std.mem.Allocator, io: std.Io, log_file: *LogFile // Open the PAM session try log_file.info(io, "auth/pam", "encoding credentials", .{}); - const login_z = try allocator.dupeZ(u8, login); + const login_z = try allocator.dupeSentinel(u8, login, 0); defer allocator.free(login_z); - const password_z = try allocator.dupeZ(u8, password); + const password_z = try allocator.dupeSentinel(u8, password, 0); defer allocator.free(password_z); var credentials = [_:null]?[*:0]const u8{ login_z, password_z }; @@ -199,7 +199,7 @@ fn startSession( } } - const home_z = try allocator.dupeZ(u8, user_entry.home.?); + const home_z = try allocator.dupeSentinel(u8, user_entry.home.?, 0); defer allocator.free(home_z); // Change to the user's home directory @@ -294,7 +294,7 @@ fn loginConv( switch (messages[i].?.msg_style) { interop.pam.PAM_PROMPT_ECHO_ON => { const data: [*][*:0]u8 = @ptrCast(@alignCast(appdata_ptr)); - username = allocator.dupeZ(u8, std.mem.span(data[0])) catch { + username = allocator.dupeSentinel(u8, std.mem.span(data[0]), 0) catch { status = interop.pam.PAM_BUF_ERR; break :set_credentials; }; @@ -302,7 +302,7 @@ fn loginConv( }, interop.pam.PAM_PROMPT_ECHO_OFF => { const data: [*][*:0]u8 = @ptrCast(@alignCast(appdata_ptr)); - password = allocator.dupeZ(u8, std.mem.span(data[1])) catch { + password = allocator.dupeSentinel(u8, std.mem.span(data[1]), 0) catch { status = interop.pam.PAM_BUF_ERR; break :set_credentials; }; @@ -332,7 +332,7 @@ fn getFreeDisplay() !u8 { var buf: [15]u8 = undefined; var i: u8 = 0; while (i < 200) : (i += 1) { - const xlock = try std.fmt.bufPrintZ(&buf, "/tmp/.X{d}-lock", .{i}); + const xlock = try std.fmt.bufPrintSentinel(&buf, "/tmp/.X{d}-lock", .{i}, 0); if (interop.isError(std.posix.system.access(xlock.ptr, std.posix.F_OK))) break; } return i; @@ -433,7 +433,7 @@ fn xauth(log_file: *LogFile, allocator: std.mem.Allocator, io: std.Io, display_n try log_file.reinit(io); var cmd_buffer: [1024]u8 = undefined; - const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} add {s} . {s}", .{ options.xauth_cmd, display_name, magic_cookie }) catch std.process.exit(1); + const cmd_str = std.fmt.bufPrintSentinel(&cmd_buffer, "{s} add {s} . {s}", .{ options.xauth_cmd, display_name, magic_cookie }, 0) catch std.process.exit(1); try log_file.info(io, "auth/x11", "executing: {s} -c {s}", .{ shell, cmd_str }); const args = [_:null]?[*:0]const u8{ shell, "-c", cmd_str }; @@ -469,7 +469,7 @@ fn executeX11Cmd(log_file: *LogFile, allocator: std.mem.Allocator, io: std.Io, s const display_name = try std.fmt.bufPrint(&buf, ":{d}", .{display_num}); try log_file.info(io, "auth/x11", "got free display: {d}", .{display_num}); - const shell_z = try allocator.dupeZ(u8, shell); + const shell_z = try allocator.dupeSentinel(u8, shell, 0); defer allocator.free(shell_z); try log_file.info(io, "auth/x11", "creating xauth file", .{}); @@ -479,7 +479,7 @@ fn executeX11Cmd(log_file: *LogFile, allocator: std.mem.Allocator, io: std.Io, s const pid = std.posix.system.fork(); if (pid == 0) { var cmd_buffer: [1024]u8 = undefined; - const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s} -auth {s}", .{ options.x_cmd, display_name, vt, xauthority }) catch std.process.exit(1); + const cmd_str = std.fmt.bufPrintSentinel(&cmd_buffer, "{s} {s} {s} -auth {s}", .{ options.x_cmd, display_name, vt, xauthority }, 0) catch std.process.exit(1); try log_file.info(io, "auth/x11", "executing: {s} -c {s} -auth {s}", .{ shell, cmd_str, xauthority }); const args = [_:null]?[*:0]const u8{ shell_z, "-c", cmd_str }; @@ -508,7 +508,7 @@ fn executeX11Cmd(log_file: *LogFile, allocator: std.mem.Allocator, io: std.Io, s xorg_pid = std.posix.system.fork(); if (xorg_pid == 0) { var cmd_buffer: [1024]u8 = undefined; - const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s} {s}", .{ if (options.use_kmscon_vt) "kmscon-launch-gui" else "", options.setup_cmd, options.login_cmd orelse "", desktop_cmd }) catch std.process.exit(1); + const cmd_str = std.fmt.bufPrintSentinel(&cmd_buffer, "{s} {s} {s} {s}", .{ if (options.use_kmscon_vt) "kmscon-launch-gui" else "", options.setup_cmd, options.login_cmd orelse "", desktop_cmd }, 0) catch std.process.exit(1); try log_file.info(io, "auth/x11", "executing: {s} -c {s}", .{ shell, cmd_str }); const args = [_:null]?[*:0]const u8{ shell_z, "-c", cmd_str }; @@ -559,11 +559,11 @@ fn executeCmd(global_log_file: *LogFile, allocator: std.mem.Allocator, io: std.I } defer if (maybe_log_file) |log_file| log_file.close(io); - const shell_z = try allocator.dupeZ(u8, shell); + const shell_z = try allocator.dupeSentinel(u8, shell, 0); defer allocator.free(shell_z); var cmd_buffer: [1024]u8 = undefined; - const cmd_str = try std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s} {s}", .{ if (!is_terminal and options.use_kmscon_vt) "kmscon-launch-gui" else "", options.setup_cmd, options.login_cmd orelse "", exec_cmd orelse shell }); + const cmd_str = try std.fmt.bufPrintSentinel(&cmd_buffer, "{s} {s} {s} {s}", .{ if (!is_terminal and options.use_kmscon_vt) "kmscon-launch-gui" else "", options.setup_cmd, options.login_cmd orelse "", exec_cmd orelse shell }, 0); try global_log_file.info(io, "auth/sys", "executing: {s} -c {s}", .{ shell, cmd_str }); const args = [_:null]?[*:0]const u8{ shell_z, "-c", cmd_str }; @@ -604,7 +604,7 @@ fn addUtmpEntry(io: std.Io, entry: *Utmp, username: []const u8, pid: c_int) !voi // Get the TTY name (i.e. without the /dev/ prefix) var ttyname_buf: [@sizeOf(@TypeOf(entry.ut_line))]u8 = undefined; - _ = try std.fmt.bufPrintZ(&ttyname_buf, "{s}", .{tty_path["/dev/".len..]}); + _ = try std.fmt.bufPrintSentinel(&ttyname_buf, "{s}", .{tty_path["/dev/".len..]}, 0); entry.ut_line = ttyname_buf; // Get the TTY ID (i.e. without the tty prefix) and truncate it to the size @@ -612,7 +612,7 @@ fn addUtmpEntry(io: std.Io, entry: *Utmp, username: []const u8, pid: c_int) !voi entry.ut_id = ttyname_buf["tty".len..(@sizeOf(@TypeOf(entry.ut_id)) + "tty".len)].*; var username_buf: [@sizeOf(@TypeOf(entry.ut_user))]u8 = undefined; - _ = try std.fmt.bufPrintZ(&username_buf, "{s}", .{username}); + _ = try std.fmt.bufPrintSentinel(&username_buf, "{s}", .{username}, 0); entry.ut_user = username_buf; diff --git a/src/main.zig b/src/main.zig index 31a8519..da97f0f 100644 --- a/src/main.zig +++ b/src/main.zig @@ -303,7 +303,7 @@ pub fn main(init: std.process.Init) !void { const username_line = reader.takeDelimiterInclusive('\n') catch break :read_save_file; - if (std.mem.containsAtLeastScalar2(u8, username_line, '-', 1)) read_username: { + if (std.mem.containsAtLeastScalar(u8, username_line, '-', 1)) read_username: { var iterator = std.mem.splitScalar(u8, username_line[0..(username_line.len - 1)], '-'); if (iterator.next() == null) break :read_username; // Would be index @@ -1202,8 +1202,8 @@ pub fn main(init: std.process.Init) !void { var iter = custom.binds.iterator(); while (iter.next()) |i| { var concat = try std.mem.concat(state.allocator, u8, &[_][]const u8{ i.key_ptr.*, " ", i.value_ptr.name }); - inline for (@typeInfo(Lang).@"struct".fields) |lang_key| { - const new = try std.mem.replaceOwned(u8, state.allocator, concat, "$" ++ lang_key.name, @field(state.lang, lang_key.name)); + inline for (@typeInfo(Lang).@"struct".field_names) |lang_key| { + const new = try std.mem.replaceOwned(u8, state.allocator, concat, "$" ++ lang_key, @field(state.lang, lang_key)); state.allocator.free(concat); concat = new; } @@ -1885,7 +1885,7 @@ fn updateBigClock(self: *BigLabel, ptr: *anyopaque) !void { const time = try interop.getTimeOfDay(); const animate_time = @divTrunc(time.microseconds, 500_000); const separator = if (state.animate and animate_time != 0) " " else ":"; - const format = try std.fmt.bufPrintZ( + const format = try std.fmt.bufPrintSentinel( &state.bigclock_format_buf, "{s}{s}{s}{s}{s}{s}", .{ @@ -1896,6 +1896,7 @@ fn updateBigClock(self: *BigLabel, ptr: *anyopaque) !void { if (state.config.bigclock_seconds) "%S" else "", if (state.config.bigclock_12hr) "%P" else "", }, + 0, ); const clock_str = interop.timeAsString(state.io, &state.bigclock_buf, format); From bcc2cdfcdc5688942aa99b18503823c5f0c8b548 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 12 Jul 2026 12:10:47 +0200 Subject: [PATCH 3/8] Fix installation Signed-off-by: AnErrupTion --- install.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.zig b/install.zig index b5649cd..8bb4835 100644 --- a/install.zig +++ b/install.zig @@ -384,7 +384,7 @@ fn installText( destination_directory: std.Io.Dir, destination_directory_path: []const u8, destination_file: []const u8, - options: std.Io.File.CreateFlags, + options: std.Io.Dir.CreateFileOptions, ) !void { var file = try destination_directory.createFile(io, destination_file, options); defer file.close(io); From 79bb0cacf14d88d0f6c8dc9a06c4143505258b56 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 12 Jul 2026 12:17:51 +0200 Subject: [PATCH 4/8] Remove C compilation hacks Signed-off-by: AnErrupTion --- ly-ui/build.zig | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ly-ui/build.zig b/ly-ui/build.zig index b13633f..f3727a8 100644 --- a/ly-ui/build.zig +++ b/ly-ui/build.zig @@ -38,18 +38,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); termbox2.defineCMacro("TB_IMPL", null); - // TODO 0.16.0: Workaround until Aro gets better... - // https://codeberg.org/ziglang/translate-c/issues/319 - termbox2.defineCMacro("_XOPEN_SOURCE", "700"); termbox2.defineCMacro("TB_OPT_ATTR_W", "32"); // Enable 24-bit color support + styling (32-bit) - // TODO 0.16.0: Including with -OReleaseSafe causes - // __attribute__(__error__()) to be called. Below - // is the workaround. - termbox2.defineCMacro("_FORTIFY_SOURCE", "0"); - // TODO 0.16.0: Needed for now - if (target.result.os.tag == .freebsd) { - termbox2.defineCMacro("__BSD_VISIBLE", "1"); - } mod.addImport("termbox2", termbox2.mod); const mod_tests = b.addTest(.{ From e01fc945a2e0e9aba8f8666c816da91d414bcafb Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 12 Jul 2026 12:19:44 +0200 Subject: [PATCH 5/8] Simplify tarball script Signed-off-by: AnErrupTion --- create_vendor_tarball.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_vendor_tarball.sh b/create_vendor_tarball.sh index b42f58c..65cb233 100755 --- a/create_vendor_tarball.sh +++ b/create_vendor_tarball.sh @@ -1,2 +1,2 @@ #!/bin/sh -tar --zstd -cvf vendor.tar.zst zig-pkg ly-ui/zig-pkg ly-core/zig-pkg +tar --zstd -cvf vendor.tar.zst zig-pkg From 3dcd883c103f346be51ee508de3d651f53b4c851 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 12 Jul 2026 12:21:27 +0200 Subject: [PATCH 6/8] termbox2: Remove Zig 0.16.0 workaround Signed-off-by: AnErrupTion --- ly-ui/build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ly-ui/build.zig.zon b/ly-ui/build.zig.zon index d328567..44f24ec 100644 --- a/ly-ui/build.zig.zon +++ b/ly-ui/build.zig.zon @@ -8,8 +8,8 @@ .path = "../ly-core", }, .termbox2 = .{ - .url = "git+https://github.com/AnErrupTion/termbox2?ref=master#c7f241e8888ce243e1748b05c26a42fcfaaad936", - .hash = "N-V-__8AAAUXBQD6Fwpi9m0MBqWXFFaqW5l1lVrJC2Ynj7a-", + .url = "git+https://github.com/AnErrupTion/termbox2?ref=master#496730697c662893eec43192f48ff616c2539da6", + .hash = "N-V-__8AAOEWBQDt5tNdIzIFY6n8DdZsCP-6MyLoNS20wgpA", }, .translate_c = .{ .url = "git+https://codeberg.org/ziglang/translate-c?ref=master#2d71d6e68dd9e9ee1da2a248a1dcb5aeba683dec", From b6fba46b087cd27fefa4d67c0a3b0eb084c7b016 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Tue, 28 Jul 2026 01:38:48 +0200 Subject: [PATCH 7/8] GPA: Add more tracking in Debug Signed-off-by: AnErrupTion --- src/main.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index 31a8519..1d0db99 100644 --- a/src/main.zig +++ b/src/main.zig @@ -149,8 +149,11 @@ pub fn main(init: std.process.Init) !void { } } - var gpa = std.heap.DebugAllocator(.{}).init; - defer _ = gpa.deinit(); + var gpa: std.heap.DebugAllocator(.{ + .never_unmap = builtin.mode == .Debug, + .retain_metadata = builtin.mode == .Debug, + }) = .init; + defer if (gpa.deinit() == .leak) std.log.err("attention please, memory has been leaked!", .{}); state.allocator = gpa.allocator(); From a22805d44b7f277d5901036edc11d01d88b749ab Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Fri, 31 Jul 2026 23:52:19 +0200 Subject: [PATCH 8/8] Auth: Handle symlinks for session log Signed-off-by: AnErrupTion --- src/auth.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/auth.zig b/src/auth.zig index c9abf15..7d9c66c 100644 --- a/src/auth.zig +++ b/src/auth.zig @@ -574,7 +574,15 @@ fn executeCmd(global_log_file: *LogFile, allocator: std.mem.Allocator, io: std.I fn redirectStandardStreams(global_log_file: *LogFile, io: std.Io, session_log: []const u8, create: bool) !std.Io.File { create_session_log_dir: { const session_log_dir = std.Io.Dir.path.dirname(session_log) orelse break :create_session_log_dir; - std.Io.Dir.cwd().createDirPath(io, session_log_dir) catch |err| { + + var buffer = std.mem.zeroes([std.Io.Dir.max_path_bytes]u8); + const len = std.Io.Dir.cwd().realPathFile(io, session_log_dir, &buffer) catch |err| { + try global_log_file.err(io, "auth/sys", "failed to resolve path for session log file directory: {s}", .{@errorName(err)}); + return err; + }; + const resolved_path = buffer[0..len]; + + std.Io.Dir.cwd().createDirPath(io, resolved_path) catch |err| { try global_log_file.err(io, "auth/sys", "failed to create session log file directory: {s}", .{@errorName(err)}); return err; };