foxnne / pixi

Pixel art editor made with Zig.
https://foxnne.github.io/pixi/
MIT License
645 stars 20 forks source link

Build error related to libdawn #12

Closed jwhear closed 1 year ago

jwhear commented 1 year ago

Compiler version:

⟩ zig-master version
0.10.0-dev.4476+0f0076666

OS info: Fedora 36, Linux 5.19.15-201.fc36.x86_64

Compile error:

zig-master build run
LLD Link... ld.lld: error: /home/justin/workspace/pixi/src/deps/zig-gamedev/zgpu/libs/dawn/x86_64-linux-gnu/libdawn.a:1: unknown directive: version
>>> version https://git-lfs.github.com/spec/v1
>>> ^
error: FileNotFound
/home/justin/system/zig-master/lib/std/os.zig:2755:19: 0x2c54e6 in mkdiratZ (build)
        .EXIST => return error.PathAlreadyExists,
                  ^
/home/justin/system/zig-master/lib/std/os.zig:2715:9: 0x2af627 in mkdirat (build)
        return mkdiratZ(dir_fd, &sub_dir_path_c, mode);
        ^
/home/justin/system/zig-master/lib/std/fs.zig:1402:9: 0x2af51b in makeDir (build)
        try os.mkdirat(self.fd, sub_path, default_new_dir_mode);
        ^
/home/justin/system/zig-master/lib/std/os.zig:2755:19: 0x2c54e6 in mkdiratZ (build)
        .EXIST => return error.PathAlreadyExists,
                  ^
/home/justin/system/zig-master/lib/std/os.zig:2715:9: 0x2af627 in mkdirat (build)
        return mkdiratZ(dir_fd, &sub_dir_path_c, mode);
        ^
/home/justin/system/zig-master/lib/std/fs.zig:1402:9: 0x2af51b in makeDir (build)
        try os.mkdirat(self.fd, sub_path, default_new_dir_mode);
        ^
/home/justin/system/zig-master/lib/std/build.zig:2112:13: 0x34dd6e in runPkgConfig (build)
            return error.PackageNotFound;
            ^
/home/justin/system/zig-master/lib/std/os.zig:2755:19: 0x2c54e6 in mkdiratZ (build)
        .EXIST => return error.PathAlreadyExists,
                  ^
/home/justin/system/zig-master/lib/std/os.zig:2715:9: 0x2af627 in mkdirat (build)
        return mkdiratZ(dir_fd, &sub_dir_path_c, mode);
        ^
/home/justin/system/zig-master/lib/std/fs.zig:1402:9: 0x2af51b in makeDir (build)
        try os.mkdirat(self.fd, sub_path, default_new_dir_mode);
        ^
/home/justin/system/zig-master/lib/std/build.zig:2112:13: 0x34dd6e in runPkgConfig (build)
            return error.PackageNotFound;
            ^
/home/justin/system/zig-master/lib/std/os.zig:1689:23: 0x314b78 in openatZ (build)
            .NOENT => return error.FileNotFound,
                      ^
/home/justin/system/zig-master/lib/std/fs.zig:1151:13: 0x2f8da6 in openFileZ (build)
            try os.openatZ(self.fd, sub_path, os_flags, 0);
            ^
/home/justin/system/zig-master/lib/std/fs.zig:1078:9: 0x2d64c8 in openFile (build)
        return self.openFileZ(&path_c, flags);
        ^
/home/justin/system/zig-master/lib/std/fs.zig:2508:24: 0x33a210 in updateFile (build)
        var src_file = try source_dir.openFile(source_path, .{});
                       ^
/home/justin/system/zig-master/lib/std/build.zig:1089:29: 0x33b087 in updateFile (build)
        const prev_status = try fs.Dir.updateFile(cwd, source_path, cwd, dest_path, .{});
                            ^
/home/justin/system/zig-master/lib/std/build.zig:3417:9: 0x367f34 in make (build)
        try builder.updateFile(self.artifact.getOutputSource().getPath(builder), full_dest_path);
        ^
/home/justin/system/zig-master/lib/std/build.zig:3649:9: 0x2c58f7 in make (build)
        try self.makeFn(self);
        ^
/home/justin/system/zig-master/lib/std/build.zig:509:9: 0x2b0284 in makeOneStep (build)
        try s.make();
        ^
/home/justin/system/zig-master/lib/std/build.zig:503:17: 0x2b01f2 in makeOneStep (build)
                return err;
                ^
/home/justin/system/zig-master/lib/std/build.zig:503:17: 0x2b01f2 in makeOneStep (build)
                return err;
                ^
/home/justin/system/zig-master/lib/std/build.zig:503:17: 0x2b01f2 in makeOneStep (build)
                return err;
                ^
/home/justin/system/zig-master/lib/std/build.zig:464:13: 0x2aff52 in make (build)
            try self.makeOneStep(s);
            ^
/home/justin/system/zig-master/lib/build_runner.zig:223:21: 0x2b3014 in main (build)
            else => return err,
                    ^
error: the following build command failed with exit code 1:
/home/justin/workspace/pixi/zig-cache/o/e19008840973012112d96838c813ec6d/build /home/justin/system/zig-master/zig /home/justin/workspace/pixi /home/justin/workspace/pixi/zig-cache /home/justin/.cache/zig run
jwhear commented 1 year ago

This error is due to not having git lfs installed and initialized before cloning the project. If you experience something like this, make sure you have git lfs initialized for your user account, and if necessary re-clone (recursive) the project.

foxnne commented 1 year ago

@jwhear Thanks for the issue, I see zig-gamedev's build.zig has this to ensure the user knows about the missing Git LFS requirement. I'll add these to our build.zig to help clear this up for anyone else.

foxnne commented 1 year ago

Okay, I just pushed those changes to build.zig and it should make this issue more clear for anyone that doesn't have Git LFS installed. Thanks again!