I got away from following Zig closely for a while, but now I have a project that I’m porting over from another language and want to take advantage of some of the new features coming out in 0.11. My problem is that the downloads page doesn’t have a FreeBSD binary for master, only for releases. So what’s the quickest and easiest way to bootstrap Zig these days? I’ve read about the wasm bootstrap blob, but I see zig-bootstrap is still listed among the downloads. I’ve already seen that 0.10 can’t build 0.11 due to breaking changes.
BTW, I love the multi-sequence for loops and MultiArrayList. That’s an awesome design.
Clone the repo
Run the following:
sudo pkg install -qyr FreeBSD devel/llvm16 devel/cmake archivers/zstd textproc/libxml2 archivers/lzma
cmake .. -DZIG_STATIC_LLVM=ON -DCMAKE_PREFIX_PATH="/usr/local/llvm16;/usr/local"
For MacOs + Homebrew (don’t use brew install, there’s a lot of issues with it)
cmake .. -DZIG_STATIC_LLVM=ON -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)"
Full documentation located here: Building Zig From Source · ziglang/zig Wiki · GitHub
rm -r $HOME/.zig
tar -xf x86_64-linux.tar.xz
mv zig-linux-x86* $HOME/.zig