Closed mitteneer closed 2 months ago
@mitteneer Thanks for reporting - just replicated with latest Zig on my local setup. Will try to get this fixed this evening !
@mitteneer Thanks a lot for reporting this ! Latest Zig introduced a change to remove some usage of comptime pointers at runtime, so I've done an overhaul of how we generate our routes file and it is much, much simpler now - no more comptime needed.
You can get this working one of two ways:
jetzig init
to create a new project - this will pull latest main
automatically for you.Run jetzig update
inside your project directory to update to latest Jetzig and then make these changes to your src/main.zig
:
@@ -2,7 +2,7 @@ const std = @import("std");
pub const jetzig = @import("jetzig");
-pub const routes = @import("routes").routes; +pub const routes = @import("routes");
// Override default settings in jetzig.config
here:
pub const jetzig_options = struct {
@@ -92,5 +92,5 @@ pub fn main() !void {
const app = try jetzig.init(allocator);
defer app.deinit();
Since I couldn't avoid breaking backward-compatibility here I took the opportunity to add a second arg to app.start
- this will help us a lot in future if we want to add any extra optional arguments, so you did Jetzig a favour here, as much as I hate breaking backward compatibility. :-)
If it wasn't me, it would have been someone else, but I'm glad I could help!
On latest jetzig version, and zig
0.12.0-dev.3508+a6ed3e6d2
:jetzig init
.zig build run
I see a somewhat similar issue in Zig regarding globals, not sure if that related though (still very much a small fish in a big pond haha).