Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.zig issue - reached unreachable code #33

Open
senyai opened this issue Oct 27, 2024 · 2 comments
Open

build.zig issue - reached unreachable code #33

senyai opened this issue Oct 27, 2024 · 2 comments

Comments

@senyai
Copy link

senyai commented Oct 27, 2024

First time trying to use zig.

const prefix = comptime std.fs.path.dirname(@src().file) orelse unreachable;

/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
Copy link
Owner

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

@senyai
Copy link
Author

senyai commented Oct 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants