Can reproduce on Windows. My guess is that this is a Windows-specific problem, and from taking a brief look at the code it seems likely that it’s line-ending related:
The www.ziglang.org repo likely needs .gitattributes so that the .zig files get checked out with LF line endings instead of CRLF.
EDIT: Yep, confirmed that’s the issue. You can fix this locally by running zig fmt . in your repo to get the line endings fixed (submitted a PR to fix it in the repo). However, it seems that the build also relies on a system-installed zlib library and jq being installed in PATH, so it’ll take more effort to get the build working on Windows.
I’ve got it running locally (when running from wsl2).
Two quickie follow ups.
When rendering locally, the ‘Documentation’ link doesn’t point to the localhost, it is still pointing to ziglang.org/documentation. I guess this would be an issue (and PR) raised to the github repo?
I see all the index.html in each of the versions. (src/documentation/0.13.0/index.html for example). Where is the index.html for ‘master’ ? And are each of those version specific index.html hand crafted or is that generated elsewhere and just committed here?
(I tried running the zig build langref and getting errors with both 0.13.0 and 0.14 dev).
/home/zendril/projects/github/ziglang/zig/build.zig:54:10: error: no field named ‘root_module’ in struct ‘Build.ObjectOptions’
.root_module = b.createModule(.{
^~~~~~~~~~~
/home/zendril/tools/zig/0.13.0/lib/std/Build.zig:697:27: note: struct declared here
pub const ObjectOptions = struct {
I haven’t cracked open the build yet so I’m assuming maybe i’ve missed some config that the build expects.
My guess is, that it was just removed, but the docs haven’t updated yet and the code of the website wasn’t updated yet.
So I think you would either have to use a Zig nightly version that is a few commits older, or wait, or change the code to use root_module.
Hmm no it is still there on master, with the deprecation warnings, which makes me think you didn’t actually run it with zig 0.14-dev, but somehow ran it with zig 0.13 both times.
With 0.14.0-dev.2851+b074fb7dd I get a whole slew of different errors like:
/home/zendril/projects/github/ziglang/zig/test/standalone/shared_library/build.zig:9:18: error: no field or member function named 'addLibrary' in 'Build'
const lib = b.addLibrary(.{
~^~~~~~~~~~~
/home/zendril/tools/zig/0.14.0-dev/lib/std/Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
/home/zendril/projects/github/ziglang/zig/test/standalone/shared_library/build.zig:9:18: note: method invocation only supports up to one level of implicit pointer dereferencing
/home/zendril/projects/github/ziglang/zig/test/standalone/shared_library/build.zig:9:18: note: use '.*' to dereference pointer