mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
zero out the build id for reproducible builds
We have been having issues with making builds reproducible, especially with the `.note.go.buildid` ELF section. One tip from a golang issue was to set `-ldflags=-buildid=` which seems to work well. You can confirm that the buildid is set to empty by inspecting the binaries with the go command example `go tool buildid _output/local/go/bin/kubectl` Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
parent
84dc704679
commit
d70d04f92b
@ -784,7 +784,7 @@ kube::golang::build_binaries() {
|
||||
# Disable SC2153 for this, as it will throw a warning that the local
|
||||
# variable goldflags will exist, and it suggest changing it to this.
|
||||
# shellcheck disable=SC2153
|
||||
goldflags="${GOLDFLAGS=-s -w} $(kube::version::ldflags)"
|
||||
goldflags="${GOLDFLAGS=-s -w -buildid=} $(kube::version::ldflags)"
|
||||
goasmflags="-trimpath=${KUBE_ROOT}"
|
||||
gogcflags="${GOGCFLAGS:-} -trimpath=${KUBE_ROOT}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user