capy-ui / capy

💻Build one codebase and get native UI on Windows, Linux and Web
https://capy-ui.org
Mozilla Public License 2.0
1.6k stars 60 forks source link

Failed to run `zig build run` with zig-template in Linux #47

Closed rrcgat closed 1 year ago

rrcgat commented 1 year ago

After following the instructions in the Installation section, I successfully installed zigmod and cloned the zig-template repository. Then, I proceeded to run zigmod fetch.

Unfortunately, the command zig build run did not execute successfully and produced the following output:

/usr/local/bin/zig build-exe /home/user/repo/capy-template/src/main.zig -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lc --cache-dir /home/user/repo/capy-template/zig-cache --global-cache-dir /home/user/.cache/zig --name capy-template --mod capy:zigimg,zigwin32:/home/user/repo/capy-template/.zigmod/deps/git/github.com/capy-ui/capy/src/main.zig --mod zigimg::/home/user/repo/capy-template/.zigmod/deps/git/github.com/capy-ui/capy/vendor/zigimg/zigimg.zig --mod zigwin32::/home/user/repo/capy-template/.zigmod/deps/git/github.com/capy-ui/capy/vendor/zigwin32/win32.zig --deps zigwin32,capy --subsystem native --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run capy-template transitive failure
   └─ zig build-exe capy-template Debug native failure
error: the following build command failed with exit code 1:
/home/user/repo/capy-template/zig-cache/o/c57cda9fce30b471e9394c5d12b926d5/build /usr/local/bin/zig /home/user/repo/capy-template /home/user/repo/capy-template/zig-cache /home/user/.cache/zig run

Zig version: 0.11.0-dev.3803+7ad104227 zigmod version: zigmod r86 linux x86_64 musl OS: Arch Linux (x86_64, 6.3.9-arch1-1)

I'm not sure if the error is related to the build argument (win32) since this is my first time using Zig.

zenith391 commented 1 year ago

This is due to a recent compiler bug which should be fixed in #16215, but for now there's a workaround in commit 2af9eb3, so just re-do zigmod fetch and it should work.