From 4171e2999505a42f70f2dc07e8b2573d5c3f84eb Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Thu, 23 Oct 2025 22:15:43 +0200 Subject: [PATCH] Fix build error when runit service symlink already exists Signed-off-by: AnErrupTion --- build.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index cb54f55..b8e1b8d 100644 --- a/build.zig +++ b/build.zig @@ -283,7 +283,13 @@ fn install_service(allocator: std.mem.Allocator, patch_map: PatchMap) !void { const patched_run = try patchFile(allocator, "res/ly-runit-service/run", patch_map); try installText(patched_run, service_dir, service_path, "run", .{ .mode = 0o755 }); - try std.fs.cwd().symLink("/run/runit/supervise.ly", supervise_path, .{}); + std.fs.cwd().symLink("/run/runit/supervise.ly", supervise_path, .{}) catch |err| { + if (err == error.PathAlreadyExists) { + std.debug.print("warn: /run/runit/supervise.ly already exists as a symbolic link.\n", .{}); + } else { + return err; + } + }; std.debug.print("info: installed symlink /run/runit/supervise.ly\n", .{}); }, .s6 => {