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

Zig build (for the zig compiler) panics with "unable to open '/some/path/to/zig/.zig-cache/doc/langref' directory: FileNotFound" #20611

Closed
sfiedler0 opened this issue Jul 13, 2024 · 2 comments
Labels
question No questions on the issue tracker, please.

Comments

@sfiedler0
Copy link
Contributor

sfiedler0 commented Jul 13, 2024

Zig Version

0.14.0-dev.244+0d79aa017 (on Arch Linux)

Steps to Reproduce and Observed Behavior

So, I ran git pull on the local zig repository, to get a self-built zig master build. Then, I built the Zig Compiler.

I started zig build with the regular arguments (-Denable-llvm -Dstatic-llvm -Dno-langref --zig-lib-dir lib --search-prefix /some/path/to/llvm -Doptimize=ReleaseFast), and I got an error about not supporting --zig-lib-dir anymore. So I wanted to try out zig build -h. Gave me a compiler error about the new b.addUpdateSourceFiles being missing.

Then I manually downloaded the newest Zig master archive and extracted it, set my path to that, ran zig build. Now it compiled, but I got:

thread 4466 panic: unable to open '/home/sfiedler/Executables/zig/.zig-cache/doc/langref' directory: FileNotFound
/home/sfiedler/Executables/zig/build.zig:1264:24: 0x1202ff9 in generateLangRef (build)
        std.debug.panic("unable to open '{}doc/langref' directory: {s}", .{
                       ^
/home/sfiedler/Executables/zig/build.zig:36:41: 0x11fd53e in build (build)
    const langref_file = generateLangRef(b);
                                        ^
/home/sfiedler/Executables/zig/lib/std/Build.zig:2140:43: 0x11d9d64 in runBuild__anon_8963 (build)
        .ErrorUnion => try build_zig.build(b),
                                          ^
/home/sfiedler/Executables/zig/lib/compiler/build_runner.zig:310:29: 0x11d4e45 in main (build)
        try builder.runBuild(root);
                            ^
/home/sfiedler/Executables/zig/lib/std/start.zig:515:37: 0x11b0625 in posixCallMainAndExit (build)
            const result = root.main() catch |err| {
                                    ^
/home/sfiedler/Executables/zig/lib/std/start.zig:258:5: 0x11b0141 in _start (build)
    asm volatile (switch (native_arch) {
    ^
???:?:?: 0x15 in ??? (???)
Unwind information for `???:0x15` was not available, trace may be incomplete

error: the following build command crashed:
/home/sfiedler/Executables/zig/.zig-cache/o/3b9e38818938f273e8642a694bbacd2f/build /home/sfiedler/local/zig_stable/master/zig /home/sfiedler/Executables/zig /home/sfiedler/Executables/zig/.zig-cache /home/sfiedler/.cache/zig --seed 0x1e035499 -Z6f7cb970d15aec2f install --prefix /home/sfiedler/local/zig_llvm --summary all -Denable-llvm -Dstatic-llvm -Dno-langref -- --zig-lib-dir lib --search-prefix /home/sfiedler/local/llvm18_zig -Doptimize=ReleaseFast

Clearing both local (/some/path/to/zig/.zig-cache) and global (/home/user/.cache/zig) cache didn't help either.

Expected Behavior

I expected the Zig compiler build script not to fail.

@sfiedler0 sfiedler0 added the bug Observed behavior contradicts documented or intended behavior label Jul 13, 2024
@zhylmzr
Copy link
Contributor

zhylmzr commented Jul 15, 2024

If you want to use the zig compiler to compile zig source code, run the zig with the commands and parameters in the instructions:
https://github.com/ziglang/zig/wiki/Building-Zig-From-Source#option-b-use-a-pre-built-zig-binary

@Vexu
Copy link
Member

Vexu commented Jul 15, 2024

#20580 introduced a breaking change to zig build you need to a new bootstrapped build to be able to use it properly.

@Vexu Vexu closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2024
@andrewrk andrewrk added question No questions on the issue tracker, please. and removed bug Observed behavior contradicts documented or intended behavior labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question No questions on the issue tracker, please.
Projects
None yet
Development

No branches or pull requests

4 participants