zigzap / zap

blazingly fast backends in zig
MIT License
2.23k stars 75 forks source link

Broken examples due to std.mem.span #4

Closed ckrowland closed 1 year ago

ckrowland commented 1 year ago

The serve and routes examples on macOS x86_64 with zig version 0.11.0-dev.1622+fc48467a9 produces the following error

.../zig/std/mem.zig:654:33: error: invalid type given to std.mem.span: *const [14:0]u8
                .One, .Slice => @compileError("invalid type given to std.mem.span: " ++ @typeName(T)),
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../zig/std/mem.zig:679:31: note: called from here
pub fn span(ptr: anytype) Span(@TypeOf(ptr)) {

Removing std.mem.span from the examples works for me. I don't really know what Span does so opened an issue instead of a PR.

renerocksai commented 1 year ago

Thanks for pointing that out! I think I need to set up CI jobs for all build targets to catch such errors as early as possible, as zig is really in flux these days.

It's already quite late here but I'll have a look at it tomorrow and will fix it then; very likely as you suggested: by removing the calls to std.mem.span() which iirc I used to turn C string buffers into zig slices.

ckrowland commented 1 year ago

Ok cool, no rush. My little project works with zap but thought I should open an issue.