MoAlyousef / zfltk

Zig bindings for the FLTK gui library
MIT License
58 stars 7 forks source link

build.zig issue - reached unreachable code #33

Open senyai opened 1 month ago

senyai commented 1 month ago

First time trying to use zig. https://github.com/MoAlyousef/zfltk/blob/fa777e7fa40e689c2908c8fd34b838280b6e6c47/build.zig#L59

/home/senyai/.cache/zig/p/1220ed324e831cbcfffdade82d578f2c24eac577facb481951a8f6a8e491eb51d1b8/build.zig:59:69: error: reached unreachable code
    const prefix = comptime std.fs.path.dirname(@src().file) orelse unreachable;
                                                                    ^~~~~~~~~~~

I bet the issue is on my side, but I don't know where to look. I replaced unreachable with @compileError(@src().file ++ " has no directory"); and got "error: build.zig has no directory". So, why do I need to have a dirname?

MoAlyousef commented 1 month ago

Hello It might be a change in zig. The package management there is still evolving. What version are you on?

senyai commented 1 month ago

I clicked on the first link on the Zig download page. It's 0.14.0-dev.2051+b1361f237. Downgrading to 0.13.0 solved this issue.