jetzig-framework / jetzig.dev

Jetzig website written in Jetzig
4 stars 3 forks source link

required Zig version? errors on zig build run #5

Closed devara-gheist closed 2 months ago

devara-gheist commented 2 months ago

I'm using Zig version 0.12 and I followed the instruction both from Jetzig's youtube and website. Everything went fine until i execute: zig build run.

Got these error messages:

warning: [zmpl] Templates path not found: src/app/mailers - skipping. run └─ run demo └─ install └─ install demo └─ zig build-exe demo Debug native 6 errors /home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/worker.zig:1388:57: error: no field named 'sec' in struct 'os.linux.x86_64.timeval' const timeout = std.mem.toBytes(std.posix.timeval{ .sec = 5, .usec = 0 }); ^~~ /home/mxlinux/.zig/lib/std/os/linux/x86_64.zig:274:28: note: struct declared here pub const timeval = extern struct {


referenced by:
    serverError__anon_19861: /home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/worker.zig:1379:22
    requestParseError: /home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/worker.zig:1370:35
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/worker.zig:1334:24: error: no field named 'sec' in struct 'os.linux.timespec'
    return @intCast(ts.sec);
                       ^~~
/home/mxlinux/.zig/lib/std/os/linux.zig:6086:29: note: struct declared here
pub const timespec = extern struct {
                     ~~~~~~~^~~~~~
/home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/worker.zig:1388:57: error: no field named 'sec' in struct 'os.linux.x86_64.timeval'
    const timeout = std.mem.toBytes(std.posix.timeval{ .sec = 5, .usec = 0 });
                                                        ^~~
/home/mxlinux/.zig/lib/std/os/linux/x86_64.zig:274:28: note: struct declared here
pub const timeval = extern struct {
                    ~~~~~~~^~~~~~
/home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/worker.zig:1388:57: error: no field named 'sec' in struct 'os.linux.x86_64.timeval'
    const timeout = std.mem.toBytes(std.posix.timeval{ .sec = 5, .usec = 0 });
                                                        ^~~
/home/mxlinux/.zig/lib/std/os/linux/x86_64.zig:274:28: note: struct declared here
pub const timeval = extern struct {
                    ~~~~~~~^~~~~~
/home/mxlinux/.cache/zig/p/1220a36b9f1be391d474a22f7f52a3e8bd8027ac523d2db19c987328a03041ab1412/src/server/server.zig:1277:17: error: no field named 'len' in struct 'posix.iovec_const'
            .{ .len = buf.len, .base = &buf },
                ^~~
/home/mxlinux/.zig/lib/std/posix.zig:180:32: note: struct declared here
pub const iovec_const = extern struct {
                        ~~~~~~~^~~~~~
/home/mxlinux/.cache/zig/p/1220a36b9f1be391d474a22f7f52a3e8bd8027ac523d2db19c987328a03041ab1412/src/server/server.zig:1299:17: error: no field named 'len' in struct 'posix.iovec_const'
            .{ .len = header.len, .base = header.ptr },
                ^~~
/home/mxlinux/.zig/lib/std/posix.zig:180:32: note: struct declared here
pub const iovec_const = extern struct {
                        ~~~~~~~^~~~~~
error: the following command failed with 6 compilation errors:
/home/mxlinux/.zig/zig build-exe -ODebug --dep jetzig --dep zmpl --dep zmd --dep routes --dep static -Mroot=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/src/main.zig --dep mime_types --dep zmpl --dep args --dep zmd --dep jetkv --dep smtp --dep httpz -Mjetzig=/home/mxlinux/.cache/zig/p/1220ffe0c1f7a7d3a7b6d87346e945bbf818cfb6c03601110d91a069ab7da741dd82/src/jetzig.zig --dep zmd --dep zmpl.manifest -Mzmpl=/home/mxlinux/.cache/zig/p/12207c30c6fbcb8c7519719fc47ff9d0acca72a3557ec671984d16260bdf1c832740/src/zmpl.zig -Mzmd=/home/mxlinux/.cache/zig/p/12203b56c2e17a2fd62ea3d3d9be466f43921a3aef88b381cf58f41251815205fdb5/src/zmd.zig --dep jetzig --dep zmpl --dep zmd --dep routes -Mroutes=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/o/8f03171ddcfa0f662ec5ce819d464db1/routes.zig -Mstatic=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/o/24445ad921dee9b77e678d0cd7a67830/static.zig -Mmime_types=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/o/72b25efd1d10b0e9b932ba7abe9814d6/mime_types.zig -Margs=/home/mxlinux/.cache/zig/p/1220904d2fdcd970dd0d216211d092eb3ef6da01117163cc9393ab845a1d66c029d9/args.zig -Mjetkv=/home/mxlinux/.cache/zig/p/1220434169bfbfbb3a0bbe7073f9bcff5401979a967d25ba3915046f6ea44e40839d/src/jetkv.zig -Msmtp=/home/mxlinux/.cache/zig/p/1220cebfcf6c63295819df92ec54abe62aad91b1d16666781194c29a7874bb7bbbda/src/smtp.zig --dep metrics --dep websocket --dep build -Mhttpz=/home/mxlinux/.cache/zig/p/1220efbc744de6e13e57ab9fa6370ea9690601e55ba6ced74179c081a295c99fd422/src/httpz.zig --dep zmpl --dep zmd -Mzmpl.manifest=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/o/4e1ae03e9522554ad85e061535a065a8/zmpl.manifest.zig -Mmetrics=/home/mxlinux/.cache/zig/p/1220232ab38d0c2cfb10680115c17ad2fa1a8531dbaf8bbfb359ec67e80c7d5f5758/src/metrics.zig --dep build=build0 -Mwebsocket=/home/mxlinux/.cache/zig/p/1220a36b9f1be391d474a22f7f52a3e8bd8027ac523d2db19c987328a03041ab1412/src/websocket.zig -Mbuild=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/c/c3224a9469deeb49ba950b1e58a2caf5/options.zig -Mbuild0=/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/c/d485b2be29cea3d49688178f61cc1037/options.zig --cache-dir /home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache --global-cache-dir /home/mxlinux/.cache/zig --name demo --listen=-
Build Summary: 11/16 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run demo transitive failure
   ├─ zig build-exe demo Debug native 6 errors
   └─ install transitive failure
      └─ install demo transitive failure
         └─ zig build-exe demo Debug native (+21 more reused dependencies)
error: the following build command failed with exit code 1:
/home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache/o/24762782203da7ee5d436aadc2b6f087/build /home/mxlinux/.zig/zig /home/mxlinux/Documents/programming/languages/zig/jetzig/demo /home/mxlinux/Documents/programming/languages/zig/jetzig/demo/zig-cache /home/mxlinux/.cache/zig --seed 0x8c13b624 -Z816b2868d8c7c0a1 run
devara-gheist commented 2 months ago

using ZVM i've tried zig build run using version 0.13.0 and master. The 0.13.0 got similar error messages to the 0.12.0 in the previous post, while master still encountering error:

/home/mxlinux/.cache/zig/p/12207c30c6fbcb8c7519719fc47ff9d0acca72a3557ec671984d16260bdf1c832740/build.zig:156:10: error: no field named 'Struct' in enum '@typeInfo(builtin.Type).@"union".tag_type.?' .Struct => |info| info.fields, ~^~ /home/mxlinux/.zvm/master/lib/std/builtin.zig:259:18: note: enum declared here pub const Type = union(enum) { ^~~~~ referenced by: build: /home/mxlinux/.cache/zig/p/1220ffe0c1f7a7d3a7b6d87346e945bbf818cfb6c03601110d91a069ab7da741dd82/build.zig:48:66 runBuild__anon_60776: /home/mxlinux/.zvm/master/lib/std/Build.zig:2155:44 15 reference(s) hidden; use '-freference-trace=17' to see all references

Please advise.

devara-gheist commented 2 months ago

sorry I posted in the wrong repo. This supposed to be in the main jetzig repo, I don't know how it got here. Cheers!