jetzig-framework / jetzig

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

An error occurred while using initialization #91

Open xzlinux opened 4 months ago

xzlinux commented 4 months ago

[exec] zig fetch --save https://github.com/jetzig-framework/jetzig/archive/68656fae355406f62f08b2f63e903dfe0450afbe.tar.gz

Error running command: zig fetch --save https://github.com/jetzig-framework/jetzig/archive/68656fae355406f62f08b2f63e903dfe0450afbe.tar.gz

[stdout]:

[stderr]:

error: invalid HTTP response: EndOfStream

z1fire commented 4 months ago

Do you mind providing more details on your error

Zig version OS Steps you took to get to error

bobf commented 4 months ago

@xzlinux The error you're seeing is actually coming from Zig itself running zig fetch ... - something caused the remote end (GitHub) to hang up the connection.

If you're running on Windows, this might me a firewall thing, but I'm not sure. Either GitHub was having a temporary issue or your computer's configuration prevented it from connecting to GitHub.

Let us know if you're still having trouble - if you would like to join our Discord we can give you some commands to try to help diagnose the problem.

lockbox commented 4 months ago

what version of zig is this supposed to work on? i also had errors bootstrapping a new webapp.

i tried using 0.13.0(linux) and it fails during the link step after doing:

jetzig init .
zig build run

which results in:

➜  zig build run
warning: [zmpl] Templates path not found: `src/app/mailers` - skipping.
[jetzig] Imported 1 route(s)
[jetzig] Mailers directory not found, no mailers generated: `/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/src/app/mailers`
[jetzig] Imported 4 job(s)
run
└─ run .
   └─ zig build-exe . Debug native
      └─ run static (static.zig) stderr
[jetzig] Compiled 0 static output(s)
run
└─ run .
   └─ zig build-exe . Debug native 1 errors
error: ld.lld: cannot open output file /home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/o/728ef2dcb64a835bbfdd2431963f1539/.: Is a directory
error: the following command failed with 1 compilation errors:
/home/lockbox/zig/0.13.0/files/zig build-exe -ODebug --dep jetzig --dep zmpl --dep zmd --dep routes --dep static -Mroot=/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/src/main.zig --dep mime_types --dep zmpl --dep args --dep zmd --dep jetkv --dep smtp --dep httpz -Mjetzig=/home/lockbox/.cache/zig/p/122099e96e4a48c8ec6463a2659b617f3f5a972c2b73510ea3bb244d0ee0fa443cae/src/jetzig.zig --dep zmd --dep zmpl.manifest -Mzmpl=/home/lockbox/.cache/zig/p/12207c30c6fbcb8c7519719fc47ff9d0acca72a3557ec671984d16260bdf1c832740/src/zmpl.zig -Mzmd=/home/lockbox/.cache/zig/p/12203b56c2e17a2fd62ea3d3d9be466f43921a3aef88b381cf58f41251815205fdb5/src/zmd.zig --dep jetzig --dep zmpl --dep zmd --dep routes -Mroutes=/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/o/63976c2c189c0f0ad056d3893843e54b/routes.zig -Mstatic=/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/o/c24d3e475fa19ddc63c850e936f504a1/static.zig -Mmime_types=/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/o/516810b03bc2bae265a2581b28132586/mime_types.zig -Margs=/home/lockbox/.cache/zig/p/1220904d2fdcd970dd0d216211d092eb3ef6da01117163cc9393ab845a1d66c029d9/args.zig -Mjetkv=/home/lockbox/.cache/zig/p/12201944769794b2f18e3932ec3d5031066d0ccb3293cf7c3fb1f5b269e56b76c57e/src/jetkv.zig -Msmtp=/home/lockbox/.cache/zig/p/1220d4f1c2472769b0d689ea878f41f0a66cb07f28569a138aea2c0a648a5c90dd4e/src/smtp.zig --dep metrics --dep websocket --dep build -Mhttpz=/home/lockbox/.cache/zig/p/122089946af5ba1cdfae3f515f0fa1c96327f42a462515fbcecc719fe94fab38d9b8/src/httpz.zig --dep zmpl --dep zmd -Mzmpl.manifest=/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/o/f57c85d43e30949e5a8f6ee22327ccc0/zmpl.manifest.zig -Mmetrics=/home/lockbox/.cache/zig/p/1220232ab38d0c2cfb10680115c17ad2fa1a8531dbaf8bbfb359ec67e80c7d5f5758/src/metrics.zig -Mwebsocket=/home/lockbox/.cache/zig/p/12208720b772330f309cfb48957f4152ee0930b716837d0c1d07fee2dea2f4dc712e/src/websocket.zig -Mbuild=/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/c/0a991cbb44bf1c4520ed99cc54c5dead/options.zig --cache-dir /home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache --global-cache-dir /home/lockbox/.cache/zig --name . --listen=-
Build Summary: 9/14 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run . transitive failure
   ├─ zig build-exe . Debug native 1 errors
   └─ install transitive failure
      └─ install . transitive failure
         └─ zig build-exe . Debug native (+14 more reused dependencies)
error: the following build command failed with exit code 1:
/home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache/o/97cb89f5a656c12d1995196be78aa84d/build /home/lockbox/zig/0.13.0/files/zig /home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh /home/lockbox/d/s/zig-dev/tapdance/tapdance-mesh/.zig-cache /home/lockbox/.cache/zig --seed 0x354a5e86 -Z8cba218ade314d99 run

and updating to latest nightly (0.14.0-dev.185+c40708a2c) gives:

home/lockbox/.cache/zig/p/122099e96e4a48c8ec6463a2659b617f3f5a972c2b73510ea3bb244d0ee0fa443cae/src/jetzig/http/Request.zig:19:22: error: root struct of file 'build' has no member named 'Request'
httpz_request: *httpz.Request,
                ~~~~~^~~~~~~~
/home/lockbox/.cache/zig/p/122089946af5ba1cdfae3f515f0fa1c96327f42a462515fbcecc719fe94fab38d9b8/build.zig:1:1: note: struct declared here
const std = @import("std");
^~~~~
referenced by:
    Request: /home/lockbox/.cache/zig/p/122099e96e4a48c8ec6463a2659b617f3f5a972c2b73510ea3bb244d0ee0fa443cae/src/jetzig/http.zig:5:29
    src.jetzig.views.Route: /home/lockbox/.cache/zig/p/122099e96e4a48c8ec6463a2659b617f3f5a972c2b73510ea3bb244d0ee0fa443cae/src/jetzig/views/Route.zig:51:20
    13 reference(s) hidden; use '-freference-trace=15' to see all references
/home/lockbox/.cache/zig/p/122099e96e4a48c8ec6463a2659b617f3f5a972c2b73510ea3bb244d0ee0fa443cae/src/jetzig/http/Headers.zig:8:22: error: root struct of file 'build' has no member named 'key_value'
httpz_headers: *httpz.key_value.KeyValue,
                ~~~~~^~~~~~~~~~
/home/lockbox/.cache/zig/p/122089946af5ba1cdfae3f515f0fa1c96327f42a462515fbcecc719fe94fab38d9b8/build.zig:1:1: note: struct declared here
const std = @import("std");
^~~~~
/home/lockbox/.cache/zig/p/122099e96e4a48c8ec6463a2659b617f3f5a972c2b73510ea3bb244d0ee0fa443cae/src/jetzig/kv/Store.zig:6:20: error: root struct of file 'build' has no member named 'JetKV'
store: jetzig.jetkv.JetKV,
       ~~~~~~~~~~~~^~~~~~
/home/lockbox/.cache/zig/p/12201944769794b2f18e3932ec3d5031066d0ccb3293cf7c3fb1f5b269e56b76c57e/build.zig:1:1: note: struct declared here
const std = @import("std");
xzlinux commented 4 months ago

Do you mind providing more details on your error

Zig version OS Steps you took to get to error

You're right, if I use Linux it's OK, but if I use mac it's not OK...