jetzig-framework / jetzig

Jetzig is a web framework written in Zig
MIT License
560 stars 25 forks source link

build error #101

Closed ziyouchutuwenwu closed 1 month ago

ziyouchutuwenwu commented 1 month ago

after demo project init, i try to build and run, it failed

$ proxy jetzig init web_demo
Creating new project in /home/mmc/projects/zig/web_demo

[create] build.zig ✅
[create] src/main.zig ✅
[create] src/app/middleware/DemoMiddleware.zig ✅
[create] src/app/views/root.zig ✅
[create] src/app/views/root/index.zmpl ✅
[create] src/app/views/root/_content.zmpl ✅
[create] public/jetzig.png ✅
[create] public/zmpl.png ✅
[create] public/favicon.ico ✅
[create] public/styles.css ✅
[create] .gitignore ✅
[exec] zig fetch --save https://github.com/jetzig-framework/jetzig/archive/940bc27a93f5470007da51f248c3abfb5d52249f.tar.gz ✅

Setup complete! ✈️ 🦎

Launch your new application:

    $ cd /home/mmc/projects/zig/web_demo

    $ zig build run

And then browse to http://localhost:8080/

mmc at manjaro in ~/projects/zig (dev_env) 
$ cd web_demo 

mmc at manjaro in ~/projects/zig/web_demo (dev_env) 
$ proxy zig build run       
/home/mmc/.cache/zig/p/122007b478f550b24db9a20c807695d24ac4645ab8934ce59edffb82eabcb2cc27d0/build.zig:156:10: error: no field named 'struct' in enum '@typeInfo(builtin.Type).Union.tag_type.?'
        .@"struct" => |info| info.fields,
        ~^~~~~~~~~
/home/mmc/dev/ziglang/zig/lib/std/builtin.zig:256:18: note: enum declared here
pub const Type = union(enum) {
                 ^~~~~
referenced by:
    build: /home/mmc/.cache/zig/p/12205c4ccaa71eefad810e41ae5a1acf3e4a7433ada0cead86fe80d1479df5b6fd69/build.zig:48:66
    runBuild__anon_16128: /home/mmc/dev/ziglang/zig/lib/std/Build.zig:2117:37
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
$ zig version                                             
0.13.0
$ screenfetch

 ██████████████████  ████████     mmc@manjaro
 ██████████████████  ████████     OS: Manjaro 24.0.8 Wynsdey
 ██████████████████  ████████     Kernel: x86_64 Linux 6.6.47-1-MANJARO
 ██████████████████  ████████     Uptime: 5h 18m
 ████████            ████████     Packages: 1352
 ████████  ████████  ████████     Shell: zsh 5.9
 ████████  ████████  ████████     Resolution: 1920x1080
 ████████  ████████  ████████     DE: Xfce4
 ████████  ████████  ████████     WM: Xfwm4
 ████████  ████████  ████████     WM Theme: JacWin10
 ████████  ████████  ████████     GTK Theme: Windows10 [GTK2]
 ████████  ████████  ████████     Icon Theme: Faenza
 ████████  ████████  ████████     Font: 文泉驿等宽微米黑 10
 ████████  ████████  ████████     Disk: 316G / 1.2T (29%)
                                  CPU: Intel Core i5-9500 @ 6x 4.4GHz [36.0°C]
                                  GPU: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630]
                                  RAM: 2876MiB / 31939MiB
z1fire commented 1 month ago

try using the zig master

ziyouchutuwenwu commented 1 month ago

ok, it works.