www.ziglang.org icon indicating copy to clipboard operation
www.ziglang.org copied to clipboard

Some build system examples can cause website build failure

Open Atomk opened this issue 1 year ago • 1 comments

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.

  1. 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:

Atomk avatar Sep 20 '24 13:09 Atomk

Workaround: in the three failing build.zig files, turn // build=succeed into // build=fail.

Atomk avatar Sep 24 '24 22:09 Atomk

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.zig and change // build=succeed to // build=fail
  • On macOS, I also needed to install jq with brew install jq

After these steps it worked here!

joaovitor123jv avatar Dec 03 '24 12:12 joaovitor123jv

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'

jdeokkim avatar Feb 05 '25 08:02 jdeokkim

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.

kristoff-it avatar May 10 '25 10:05 kristoff-it