Skip to content

Make thornode binary build deterministic

Asmund THORSec requested to merge asmund/determinism into develop

The story for deterministic builds in Go has improved dramatically over the last couple years.

The end result of this change is that any individual clones of the repository will always produce the same thornode binary from the same commit, when using make docker-gitlab-build

The material changes:

  • Remove build time as a build arg
  • Trim prefixes off of embedded filenames so they are now relative to repo root
  • override the Golang native buildid

To verify, check out this branch locally and run the following:

$ git checkout -b testing  # Necessary because the docker build doesn't like slashes in branch name
$ make docker-gitlab-build
$ docker run --rm -it registry.gitlab.com/thorchain/thornode:testing /bin/sh -c 'cat /usr/bin/thornode' | sha256sum
4abd605c7e536559b2b7a0e731dc1f60afa0d86ec2457c7ccca57a0b5e912ccb  -

Merge request reports