Skip to content

Commit

Permalink
Merge pull request #134 from jetzig-framework/zig-build-fixes
Browse files Browse the repository at this point in the history
Zig build fixes for latest Zig nightly build
  • Loading branch information
bobf authored Dec 22, 2024
2 parents 475ed26 + 76f14a8 commit 413fd30
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
9 changes: 3 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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", .{
Expand Down Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions cli/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .{
Expand Down
2 changes: 1 addition & 1 deletion src/jetzig/App.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
6 changes: 3 additions & 3 deletions src/jetzig/http/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/jetzig/jobs/Job.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 413fd30

Please sign in to comment.