Cloned template doesn't build
- OS: Windows 10 x64
- Zig 0.13.0 x86_64 (installed via Chocolatey)
When building with zig build run his error is thrown:
warning: 'demo' is broken (disabled by default)
warning: 'dev-tools' is broken (disabled by default)
warning: 'fade' is broken (disabled by default)
warning: 'many-counters' is broken (disabled by default)
warning: 'notepad' is broken (disabled by default)
warning: 'osm-viewer' is broken (disabled by default)
warning: 'slide-viewer' is broken (disabled by default)
run
└─ run capy-template
└─ zig build-exe capy-template Debug native 1 errors
C:\Users\matic\AppData\Local\zig\p\12202d8a1a46e0e78dc366ba3cb9843821b65ed3d0e110cf705bdeaba9eb8f75a
c75\src\backends\win32\res\resource.rc:1:1: error: zig rc exited with code 1
error: error(compilation): zig rc failed with stderr:
error: the following build command failed with exit code 5:
C:\Users\matic\AppData\Local\zig\o\db63b730956bed3aea5ec95246af3f16\resinator.exe C:\ProgramData\cho
colatey\lib\zig\tools\zig-windows-x86_64-0.13.0\lib --zig-integration /:depfile E:\Zig\first_test\zi
g-template\.zig-cache\tmp\e352365747828c65-resource.d.json /:depfile-fmt json /x /:auto-includes any
-D_DEBUG -- C:\Users\matic\AppData\Local\zig\p\12202d8a1a46e0e78dc366ba3cb9843821b65ed3d0e110cf705b
deaba9eb8f75ac75\src\backends\win32\res\resource.rc E:\Zig\first_test\zig-template\.zig-cache\tmp\c0
bd650f42c0deba-resource.res
error: the following command failed with 1 compilation errors:
C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\zig.exe build-exe -ODebug --dep ca
py -Mroot=E:\Zig\first_test\zig-template\src\main.zig -lcomctl32 -lgdi32 -lgdiplus C:\Users\matic\Ap
pData\Local\zig\p\12202d8a1a46e0e78dc366ba3cb9843821b65ed3d0e110cf705bdeaba9eb8f75ac75\src\backends\
win32\res\resource.rc -ODebug --dep zigimg --dep zigwin32 -Mcapy=C:\Users\matic\AppData\Local\zig\p\
12202d8a1a46e0e78dc366ba3cb9843821b65ed3d0e110cf705bdeaba9eb8f75ac75\src\main.zig -Mzigimg=C:\Users\
matic\AppData\Local\zig\p\1220dc313944ea71a87b4f54f26b1427ad2992a721a221cb42f7f80b8eee4e4944b7\zigim
g.zig -Mzigwin32=C:\Users\matic\AppData\Local\zig\p\12202d8a1a46e0e78dc366ba3cb9843821b65ed3d0e110cf
705bdeaba9eb8f75ac75\vendor\zigwin32\win32.zig --cache-dir E:\Zig\first_test\zig-template\.zig-cache
--global-cache-dir C:\Users\matic\AppData\Local\zig --name capy-template --subsystem console --list
en=-
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 1 errors
error: the following build command failed with exit code 1:
E:\Zig\first_test\zig-template\.zig-cache\o\4dda4646c06de64b5be33eb088a7c991\build.exe C:\ProgramDat
a\chocolatey\lib\zig\tools\zig-windows-x86_64-0.13.0\zig.exe E:\Zig\first_test\zig-template E:\Zig\f
irst_test\zig-template\.zig-cache C:\Users\matic\AppData\Local\zig --seed 0xc37d78ee -Z8d6e7f1e777ac212 run
It looks like it's a bug in Zig itself, so the only fix I see would be to use a more recent Zig version.
Trying to run zig build run using zig version 0.14.0 on Linux (Mint 21.2 "Victoria" based on Ubuntu 22.0.4 "Jammy") produces:
xxxx@XX-X-XXXX-X:~/code/zig/zig-gui (main)$ zig build run
/home/xxxx/code/zig/zig-gui/build.zig.zon:2:13: error: expected enum literal
.name = "capy-template",
^~~~~~~~~~~~~~~
Edit: Nevermind, I see that it only supports 13.
The same error on Windows 11:
C:\repos\capy-template\build.zig.zon:2:13: error: expected enum literal
.name = "capy-template",
^~~~~~~~~~~~~~~
I'm quite new to Zig, so any ideas how to make it 0.14 compatible? I'm eager to send a pull request.
Original issue is about build fail with old format zig.zon. Should not we open another ticket for "copy-template"?
fixed by 67a530e42f5456ed68bc2a45fcd5076838ae6cef