Bazel If you use Bazelisk (recommended), it will automatically download and use the right version of Bazel for building workerd.
On Linux: We use the clang/LLVM toolchain to build workerd and support version 16 and higher. Earlier versions of clang may still work, but are not officially supported.
Clang 16+ (e.g. package clang-16 on Debian Bookworm). If clang is installed as clang-<version> please create a symlink to it in your PATH named clang, or use --action_env=CC=clang-<version> on bazel command lines to specify the compiler name.
libc++ 16+ (e.g. packages libc++-16-dev and libc++abi-16-dev)
LLD 16+ (e.g. package lld-16).
python3, python3-distutils, and tcl8.6
You may then build workerd at the command-line with:
➜ helloworld git:(main) ../../bazel-bin/src/workerd/server/workerd serve config.capnp ^Ckj/exception.c++:357: warning: llvm-symbolizer was not found. To symbolize stack traces, install it in your $PATH or set $LLVM_SYMBOLIZER to the location of the binary. When running tests under bazel, use `--test_env=LLVM_SYMBOLIZER=<path>`. *** Received signal #2: Interrupt stack: /lib/x86_64-linux-gnu/libc.so.6@108c1d ../../bazel-bin/src/workerd/server/workerd@a82418a ../../bazel-bin/src/workerd/server/workerd@a77784d ../../bazel-bin/src/workerd/server/workerd@a778ee8 ../../bazel-bin/src/workerd/server/workerd@3e9458e ../../bazel-bin/src/workerd/server/workerd@3ea9112 ../../bazel-bin/src/workerd/server/workerd@3ea8bac ../../bazel-bin/src/workerd/server/workerd@3ea8b88 ../../bazel-bin/src/workerd/server/workerd@3ea8b5e ../../bazel-bin/src/workerd/server/workerd@3ea8ab3 ../../bazel-bin/src/workerd/server/workerd@3ea8a83 ../../bazel-bin/src/workerd/server/workerd@a86356f ../../bazel-bin/src/workerd/server/workerd@a862035 ../../bazel-bin/src/workerd/server/workerd@a86a690 ../../bazel-bin/src/workerd/server/workerd@a863c51 ../../bazel-bin/src/workerd/server/workerd@a860f86 ../../bazel-bin/src/workerd/server/workerd@a86a690 ../../bazel-bin/src/workerd/server/workerd@a863c51 ../../bazel-bin/src/workerd/server/workerd@a86742b ../../bazel-bin/src/workerd/server/workerd@a85d52c ../../bazel-bin/src/workerd/server/workerd@a85d31a ../../bazel-bin/src/workerd/server/workerd@3e63189 /lib/x86_64-linux-gnu/libc.so.6@27249 /lib/x86_64-linux-gnu/libc.so.6@27304 ../../bazel-bin/src/workerd/server/workerd@3e63020