www.ziglang.org
www.ziglang.org copied to clipboard
Some build system examples can cause website build failure
After working around #389, running zig build serve on my system (Windows) results in the following failures.
I understand these samples are not really meant to be run on any system, I just want to be able to complete a build to test my changes. If that's not possible, I would clarify in the README that Windows is not supported and/or that some dependencies are needed to build the website.
- Line:
const tool_run = b.addSystemCommand(&.{"jq"});
PS C:\...\www.ziglang.org> zig build serve
serve
└─ run server
└─ website
└─ install generated to ja-JP\learn\index.html
└─ run layout (learn\index.smd)
└─ Zine Index Content
└─ run index-assets
└─ run doctest (build-system/10.5-system-tool/build.zig) failure
install
└─ install generated to word.txt
└─ run jq failure
error: unable to spawn jq: FileNotFound
serve
└─ run server
└─ website
└─ install generated to ja-JP\learn\index.html
└─ run layout (learn\index.smd)
└─ Zine Index Content
└─ run index-assets
└─ run doctest (build-system/system-libraries/build.zig) failure
install
└─ install zip
└─ zig build-exe zip Debug native failure
error: error: unable to find dynamic system library 'z' using strategy 'paths_first'. searched paths: none
serve
└─ run server
└─ website
└─ install generated to ja-JP\learn\index.html
└─ run layout (learn\index.smd)
└─ Zine Index Content
└─ run index-assets
└─ run doctest (build-system/write-files/build.zig) failure
install
└─ install generated to project.tar.gz
└─ run tar (project.tar.gz) failure
tar: al\Programs\Python\P??U???????????????????p: Couldn't visit directory: No such file or directory
tar: Error exit delayed from previous errors.
error: the following command exited with error code 1:
Workaround: in the three failing build.zig files, turn // build=succeed into // build=fail.
I had the same issue trying to build it on macOS and debian 12 (cloned from main).
To properly run zig build serve for the cloned repo (on main), I needed to:
- Access
assets/zig-code/build-system/10-release/build.zigand change// build=succeedto// build=fail - On macOS, I also needed to install
jqwithbrew install jq
After these steps it worked here!
This issue seems to be present on WSL2 (Linux 5.15.167.4-microsoft-standard-WSL2 x86_64) too, but fortunately, I was able to successfully build this project by following the instructions from @joaovitor123jv. Thank you very much ! 😄
$ sudo apt update && sudo apt install jq
$ zigup 0.13.0 && sudo ln -s '/mnt/c/Users/jdeokkim/Ubuntu/zig/0.13.0/files/zig' '/usr/local/bin/zig'
$ git clone https://github.com/ziglang/www.ziglang.org && cd www.ziglang.org
$ sed -i -e 's/build=success/build=fail/g' assets/zig-code/build-system/10-release/build.zig
$ zig build serve
$ git add -- . ':!assets/zig-code/build-system/10-release/build.zig'
I've added a mention in the readme about extra dependencies, if anybody knows how to set them up on Windows, feel free to PR some instructions to add to the readme.