zigster64 / zig-zag-zoe

Multiplayer TicTacToe - in Zig - using HTMX for that zero-javascript experience
http://zig-zag-zoe.com
MIT License
19 stars 1 forks source link

can't build with zig 0.11.0, deps hash mismatches #19

Open phanirithvij opened 5 months ago

phanirithvij commented 5 months ago

I think you should pin to a commit? As it is pointing to the master branch, as it changed there is a hash mismatch. I tried to find the commit which gave this particular hash but finding it doesn't seem trivial.

https://github.com/zigster64/zig-zag-zoe/blame/a4314c79ac3968b532b8bb99fd379f8415056d61/build.zig.zon#L8

(devbox) ⚬ zig version
0.11.0
(devbox) ⚬ rm -rf zig-cache/ ~/.cache/zig/
(devbox) ⚬ zig build
Fetch Packages [1/2] http... /home/rithvij/Projects/htmx-star/zighx/zig-zag-zoe-hx/build.zig.zon:8:21: error: hash mismatch: expected: 1220304c177483b73776af162e589c050a54695bd10cf9c7ab913d9c3a5cae728fe3, found: 1220a06b79fe8996ccfab3017f535f0ebc4976055e5b753fdfb2d8b0830aeb2d9a32
            .hash = "1220304c177483b73776af162e589c050a54695bd10cf9c7ab913d9c3a5cae728fe3",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On a side note. I Tried changing to the suggested hash and am encountering this issue https://github.com/karlseguin/http.zig/issues/29

Then tried the rm -rf zig-cache fix mentioned there with no luck, the issue still persists.

And with zig master version 0.12.0-dev, there are breaking changes in the build as usual.

⚫ zig version
0.12.0-dev.2327+b0c8a3f31
⚫ rm -rf ~/.cache/zig/ zig-cache/
⚫ zig build -Doptimize=ReleaseSmall; and notify-send 'zig build finished'
/home/rithvij/Projects/htmx-star/zighx/zig-zag-zoe-hx/build.zig.zon:1:2: error: missing top-level 'paths' field
.{
 ^
zigster64 commented 5 months ago

Thanks for raising that !

will look into it and sort it out.

I did get a build compiling ok with 0.12 and httpz latest, but gameplay was broken so haven’t pushed that to master yet. Might be related to non-blocking io .. not sure yet.

hopefully get some time to sort it out, update docs, debug it and pin the versions. I should probably add some decent unit tests too ! Slacker that I am.

yeah, build changes have been fun :)

zigster64 commented 5 months ago

I have patched up the build to work with 0.12.dev, and tested it against http.zig official (blocking branch only)

Seems broken with the master (non-blocking experimental async) branch of http.zig, but the original blocking IO branch of http.zig is fine

Please check that out at your leisure and see if it works for you

In the meantime, will use this as an opportunity to test/debug the async branch of http.zig using this demo game as a reference. Excellent !

zigster64 commented 5 months ago

After a quick chat with Karl ...

https://github.com/zigster64/zig-zag-zoe/releases/tag/v0.12.2139-async

This builds against latest master of http.zig, which uses non-blocking / async IO. Just needed a minor tweak at this end to run the SSE event handler inside its own thread.

So there are 2 releases now, using zig 0.12.dev that reference the official http.zig repo

One does purely blocking IO and threads The other does async IO with threads for the SSE stuff only

:)