Skip to main content
Version: 0.17.0

Building

Yoke's programs are Go, and building them takes the Go toolchain and a clone of the yoke repository at a release's tag. Every program but yoke-auth is statically linked, and yoke-auth is built without a C toolchain all the same, so one machine builds for both architectures.

A program states its version from the clone it was built in, which is why the build starts from a clone and not from the source archive. Go writes into each program the version its module has there: the tag when the clone is exactly at it, a version derived from the tag and the commit when it is past it, and +dirty added when the tree holds a file git does not have. A program built where there is no repository states (devel), which is no version at all, and the manager refuses a Core that states none when an application is installed, naming the binary. The programs are therefore written outside the clone, into ~/yoke-stage, so that a second build does not find the first one's files and call the tree dirty.

Clone the repository at the release's tag:

version=0.17.0
git clone --branch v$version https://github.com/yoke-project/yoke.git
cd yoke
mkdir -p ~/yoke-stage

This machine needs Go 1.26 or newer and git.

CGO_ENABLED=0 go build -trimpath -o ~/yoke-stage/ ./cmd/yoke ./cmd/yoke-core ./cmd/yoke-guardian ./cmd/yoke-auth ./cmd/yoke-compose

Check the version each program states, before anything runs it:

go version -m ~/yoke-stage/yoke-core | awk '$1 == "mod"'
mod github.com/yoke-project/yoke v0.17.0

For the other architecture, name it — a 64-bit Raspberry Pi OS is arm64 — and build into another directory, since these programs will not run here:

CGO_ENABLED=0 GOARCH=arm64 go build -trimpath -o ~/yoke-stage-arm64/ ./cmd/yoke ./cmd/yoke-core ./cmd/yoke-guardian ./cmd/yoke-auth

The packaging inputs go beside the programs, as a release's archive carries them; the next step installs from ~/yoke-stage:

cp -r packaging ~/yoke-stage/

Building to change Yoke​

Somebody changing Yoke works in a clone at main, not at a tag, and runs the repository's own commands: just build compiles every package, just test runs every check and test, just lint and just fmt keep it clean. A program built there states a version derived from the newest tag and the commit, which is what it is. Contributing says what each command does and what a change has to pass.

Next: install what was built.