Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

From Source

If you wish to compile Venator (instead of using the binaries created by CI or attached to releases), you can do so with the handy build.sh script located at the root of this repository. While using this script in particular is not required (compiling with plain go build is sufficient), the build script conveniently injects build metadata into the binary for accurate version reporting, and offers shorthands to compile static and release-optimised builds.

Note

You do not need to compile Venator to run it. CI produces static binaries for AMD64 and ARM64 on each push to dev, and static binaries are also attached to each release.

Unless you need a dynamic binary, or are planning on hacking on Venator, you likely do not need to compile.

With the build script

To get started, make sure you have the prerequisites detailed in Getting Started § Prerequisites. Then, you can clone the repository:

git clone https://codeberg.org/timedout/venator.git && cd venator

And then run the build script to produce a binary at ./bin/venatorctl:

./build.sh
#- will build dynamically-linked binary
#- will build debug binary (without optimizations)
#- Tag associated with the latest commit: 0.1.0a1
#- Latest tag: 0.1.0a1
#- Latest commit hash: 3447d86
#- Dirty? yes
#- Build date: 2026.04.19T18.45.45Z
#- Golang version: go1.26.2-X:nodwarf5
#- OS/Arch: linux/amd64
#
#Compiling Venator
#[...]
#codeberg.org/timedout/venator/cmd/venatorctl
#
#real    0m1.731s
#user    0m3.191s
#sys     0m0.680s

Notice how the first two lines say will build dynamically-linked binary and will build debug binary (without optimizations)? This is because by default, the script will create a debug-oriented build. While this is still plenty fast, it is dynamically linked, and retains debug symbols, meaning it’s a few mebibytes larger than necessary for most people. If you aren’t planning on running through Venator with a debugger, you may wish to instead build a high-performance and/or static binary.

To compile a static binary, pass -static to build.sh:

./build.sh -static && file ./bin/venatorctl
#- will build static-linked binary without CGO (experimental!)
#- will build debug binary (without optimizations)
# ...
#./bin/venatorctl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=..., BuildID[sha1]=..., with debug_info, not stripped

To compile a “release” binary (one without debug symbols), pass -release:

./build.sh -release && file ./bin/venatorctl
#- will build dynamically-linked binary
#- will build release binary (with optimizations)
#...
#./bin/venatorctl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=..., BuildID[sha1]=..., stripped

You can even combine these flags (in any order) to compile a release+static binary:

./build.sh -static -release && file ./bin/venatorctl
#- will build static-linked binary without CGO (experimental!)
#- will build release binary (with optimizations)
#./bin/venatorctl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=..., BuildID[sha1]=..., stripped

Without the build script

If for some reason you are unable to use the build script (consider opening an issue!), you can still compile without:

go build -o ./bin/ ./cmd/venatorctl

Note that this will produce a debug dynamic binary without any metadata. You will likely be unable to report bugs found when running this binary as it will not contain version data required to accurately troubleshoot problems.