mach icon indicating copy to clipboard operation
mach copied to clipboard

`main` currently broken - sorry all!

Open 149-code opened this issue 3 years ago • 2 comments

Cloning the mach repo and trying to build examples doesn't work. This also happens when I try to build other examples as well.

git clone https://github.com/hexops/mach/
cd mach/
zig build run-example-triangle
/src/platform/c.zig:1:15: error: C import failed
pub const c = @cImport({
              ^
./zig-cache/o/4cb64c7e40f0c8be809e30e746611988/cimport.h:3:10: note: 'dawn_native_mach.h' file not found
#include <dawn_native_mach.h>

I checked the whole repo with find . | rg "dawn_native_mach.h" but no files were found.

I'm compiling with zig version 0.10.0-dev.3366+e6b3eae49 on macOS 12.4

149-code avatar Aug 10 '22 09:08 149-code

I have a similar issue on Arch Linux. I also tried to re-clone mach and then I got

: /theodata/projects/minecraft-mods/elementalcraft/deps/mach/gpu/libs/mach-gpu-dawn/libs/dawn/src/dawn/utils/VulkanBinding.cpp:23:10: fatal error: 'GLFW/glfw3.h' file not found\

even though /usr/include/GLFW/glfw3.h exists.

theoparis avatar Aug 11 '22 03:08 theoparis

Sorry for main being broken, y'all!

It was only supposed to be broken for ~24h while I landed the remainder of #403 (had to do this to get some other parts in), but I suddenly caught the flu, have been quite sick since, and then lost someone dear to me just yesterday.

In the meantime you can git checkout 36539d7c3db3e807047d457e65fc3aeb3145bafa and as long as you have a fairly recent Zig v0.10 version (0.10.0-dev.3027+0e26c6149) it should just work

I'll have it all working again soon-ish.

emidoots avatar Aug 11 '22 03:08 emidoots

Should be fixed now that #403 is merged! Feel free to open a new issue if you encounter any problems.

emidoots avatar Aug 12 '22 08:08 emidoots

Current main is failing to build for me. (Stumbled upon the repo and gave it a drive-by compile; don't have time to investigate, apologies.)

si@macbook ~/W/C/mach (main)> git show main --abbrev-commit | head -n 1
commit f299d87
si@macbook ~/W/C/mach (main)> zig version
0.10.0-dev.3551+92568a009
si@macbook ~/W/C/mach (main)> uname -a
Darwin macbook.local 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64
si@macbook ~/W/C/mach (main)> zig build run-example-triangle
/opt/homebrew/Cellar/zig/HEAD-92568a0_1/lib/zig/std/fmt.zig:498:17: error: cannot format optional without a specifier (i.e. {?} or {any})
                @compileError("cannot format optional without a specifier (i.e. {?} or {any})");
                ^
/opt/homebrew/Cellar/zig/HEAD-92568a0_1/lib/zig/std/fmt.zig:183:23: note: called from here
        try formatType(
                      ^
/opt/homebrew/Cellar/zig/HEAD-92568a0_1/lib/zig/std/io/writer.zig:28:34: note: called from here
            return std.fmt.format(self, format, args);
                                 ^
/opt/homebrew/Cellar/zig/HEAD-92568a0_1/lib/zig/std/debug.zig:93:27: note: called from here
    nosuspend stderr.print(fmt, args) catch return;
                          ^
./src/platform/native.zig:97:28: note: called from here
            std.debug.print("mach: failed to create GPU adapter: {s}\n", .{response.?.message});
                           ^
./src/platform/native.zig:57:70: note: called from here
    pub fn init(allocator: std.mem.Allocator, core: *Core) !Platform {
                                                                     ^

sameersismail avatar Aug 12 '22 11:08 sameersismail

@sentalis no worries, thanks for the report! #454 was just merged which should fix that, we'll start testing with the latest Zig version soon (which is what caused this)

emidoots avatar Aug 12 '22 17:08 emidoots