From 76f14a89a1cc9d5325ce70bb67dd5f374a00a92e Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Sun, 22 Dec 2024 11:58:05 +0000 Subject: [PATCH] Zig build fixes for latest Zig nightly build --- build.zig | 9 +++------ build.zig.zon | 12 ++++++------ cli/build.zig.zon | 4 ++-- src/jetzig/App.zig | 2 +- src/jetzig/http/Server.zig | 6 +++--- src/jetzig/jobs/Job.zig | 2 +- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/build.zig b/build.zig index 3f20f31..c0e81e8 100644 --- a/build.zig +++ b/build.zig @@ -129,7 +129,7 @@ pub fn jetzigInit(b: *std.Build, exe: *std.Build.Step.Compile, options: JetzigIn return error.ZmplVersionNotSupported; } - const target = b.host; + const target = exe.root_module.resolved_target orelse @panic("Unable to detect compile target."); const optimize = exe.root_module.optimize orelse .Debug; if (optimize != .Debug) exe.linkLibC(); @@ -159,10 +159,7 @@ pub fn jetzigInit(b: *std.Build, exe: *std.Build.Step.Compile, options: JetzigIn const jetzig_dep = b.dependency( "jetzig", - .{ - .optimize = optimize, - .target = target, - }, + .{ .optimize = optimize, .target = target }, ); const jetquery_dep = jetzig_dep.builder.dependency("jetquery", .{ @@ -399,7 +396,7 @@ pub fn jetzigInit(b: *std.Build, exe: *std.Build.Step.Compile, options: JetzigIn exe_routes.root_module.addImport("jetzig", jetzig_module); exe_routes.root_module.addImport("routes", routes_module); - exe_routes.root_module.addImport("app", &exe.root_module); + exe_routes.root_module.addImport("app", exe.root_module); const run_routes_cmd = b.addRunArtifact(exe_routes); routes_step.dependOn(&run_routes_cmd.step); } diff --git a/build.zig.zon b/build.zig.zon index 7c68ef9..bcbe33f 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,16 +7,16 @@ .hash = "1220d0e8734628fd910a73146e804d10a3269e3e7d065de6bb0e3e88d5ba234eb163", }, .zmpl = .{ - .url = "https://github.com/jetzig-framework/zmpl/archive/7b5e0309ee49c06b99c242fecd218d3f3d15cd40.tar.gz", - .hash = "12204d61eb58ee860f748e5817ef9300ad56c9d5efef84864ae590c87baf2e0380a1", + .url = "https://github.com/jetzig-framework/zmpl/archive/f9a3c602d060d6b337312b820c852376cd111766.tar.gz", + .hash = "1220f61c70456b8bb7f407ff539d1d8569acea64f68db12f9245f1d4113495c33907", }, .jetkv = .{ .url = "https://github.com/jetzig-framework/jetkv/archive/acaa30db281f1c331d20c48cfe6539186549ad45.tar.gz", .hash = "1220b260b20cb65d801a00a39dc6506387f5faa1a225f85160e011bd2aabd2ce6e0b", }, .jetquery = .{ - .url = "https://github.com/jetzig-framework/jetquery/archive/52e1cf900c94f3c103727ade6ba2dab3057c8663.tar.gz", - .hash = "12208a37407d1a7548fd7e81d9f6a9d4897793918023ed559a279a7647dab2d43145", + .url = "https://github.com/jetzig-framework/jetquery/archive/387ad885bb29a16d38dbb71f5b4b5b083fa320e3.tar.gz", + .hash = "12206089a3d9de179a0d40cf35c48786eb4525a203ebf8cc131e23e430625713c402", }, .jetcommon = .{ .url = "https://github.com/jetzig-framework/jetcommon/archive/86f24cfdf2aaa0e8ada4539a6edef882708ced2b.tar.gz", @@ -27,8 +27,8 @@ .hash = "1220411a8c46d95bbf3b6e2059854bcb3c5159d428814099df5294232b9980517e9c", }, .pg = .{ - .url = "https://github.com/karlseguin/pg.zig/archive/0bfc46029c6a3e8ded7a3e0544fcbcb5baba2208.tar.gz", - .hash = "1220fb3f43073a6f9f201764c3ae78aa87b29edbc7b021c1174b29b020967d0b146c", + .url = "https://github.com/karlseguin/pg.zig/archive/a03737e8c9404d1642e9b2fdea8e719dfae5cda8.tar.gz", + .hash = "1220eff52824f32e7ab225cd50bf962324ca14c498c7c197a554dc55e5bb612f119f", }, .smtp_client = .{ .url = "https://github.com/karlseguin/smtp_client.zig/archive/3cbe8f269e4c3a6bce407e7ae48b2c76307c559f.tar.gz", diff --git a/cli/build.zig.zon b/cli/build.zig.zon index c0ebfae..9113880 100644 --- a/cli/build.zig.zon +++ b/cli/build.zig.zon @@ -9,8 +9,8 @@ .hash = "1220411a8c46d95bbf3b6e2059854bcb3c5159d428814099df5294232b9980517e9c", }, .jetquery = .{ - .url = "https://github.com/jetzig-framework/jetquery/archive/52e1cf900c94f3c103727ade6ba2dab3057c8663.tar.gz", - .hash = "12208a37407d1a7548fd7e81d9f6a9d4897793918023ed559a279a7647dab2d43145", + .url = "https://github.com/jetzig-framework/jetquery/archive/387ad885bb29a16d38dbb71f5b4b5b083fa320e3.tar.gz", + .hash = "12206089a3d9de179a0d40cf35c48786eb4525a203ebf8cc131e23e430625713c402", }, }, .paths = .{ diff --git a/src/jetzig/App.zig b/src/jetzig/App.zig index 5d6b363..3ee7cea 100644 --- a/src/jetzig/App.zig +++ b/src/jetzig/App.zig @@ -203,7 +203,7 @@ inline fn viewType(path: []const u8) enum { with_id, without_id, with_args } { pub fn createRoutes( allocator: std.mem.Allocator, comptime_routes: []const jetzig.views.Route, -) ![]*jetzig.views.Route { +) ![]const *const jetzig.views.Route { var routes = std.ArrayList(*jetzig.views.Route).init(allocator); for (comptime_routes) |const_route| { diff --git a/src/jetzig/http/Server.zig b/src/jetzig/http/Server.zig index 4c4b2cf..60f3a6f 100644 --- a/src/jetzig/http/Server.zig +++ b/src/jetzig/http/Server.zig @@ -9,8 +9,8 @@ const httpz = @import("httpz"); allocator: std.mem.Allocator, logger: jetzig.loggers.Logger, env: jetzig.Environment, -routes: []*jetzig.views.Route, -custom_routes: []jetzig.views.Route, +routes: []const *const jetzig.views.Route, +custom_routes: []const jetzig.views.Route, job_definitions: []const jetzig.JobDefinition, mailer_definitions: []const jetzig.MailerDefinition, mime_map: *jetzig.http.mime.MimeMap, @@ -20,7 +20,7 @@ job_queue: *jetzig.kv.Store.JobQueueStore, cache: *jetzig.kv.Store.CacheStore, repo: *jetzig.database.Repo, global: *anyopaque, -decoded_static_route_params: []*jetzig.data.Value = &.{}, +decoded_static_route_params: []const *jetzig.data.Value = &.{}, debug_mutex: std.Thread.Mutex = .{}, const Server = @This(); diff --git a/src/jetzig/jobs/Job.zig b/src/jetzig/jobs/Job.zig index 5f7a1c6..38d00a1 100644 --- a/src/jetzig/jobs/Job.zig +++ b/src/jetzig/jobs/Job.zig @@ -16,7 +16,7 @@ pub const JobEnv = struct { /// Environment configured at server launch vars: jetzig.Environment.Vars, /// All routes detected by Jetzig on startup - routes: []*const jetzig.Route, + routes: []const *const jetzig.Route, /// All mailers detected by Jetzig on startup mailers: []const jetzig.MailerDefinition, /// All jobs detected by Jetzig on startup