[Makefile] Support reproducible builds

Circleci is used to build the release artifacts and embeds build paths
into the binary release. To reproduce the release binaries we then need
to also build in the same path as a result.

    $ strings linux-amd64/helm  | grep "home/circleci" | wc -l
    174

Go 1.13 introduces `-trimpath` which strips the build path from all
compiled binaries. This should enable people to reproduce the
distributed helm binaries.

https://reproducible-builds.org/docs/source-date-epoch/
https://golang.org/doc/go1.13#go-command

Signed-off-by: Morten Linderud <morten@linderud.pw>
pull/6831/head
Morten Linderud 5 years ago
parent 2033853d8c
commit 065dfb0e5b
No known key found for this signature in database
GPG Key ID: E742683BA08CB2FF

@ -19,7 +19,7 @@ TAGS :=
TESTS := . TESTS := .
TESTFLAGS := TESTFLAGS :=
LDFLAGS := -w -s LDFLAGS := -w -s
GOFLAGS := GOFLAGS := -trimpath
SRC := $(shell find . -type f -name '*.go' -print) SRC := $(shell find . -type f -name '*.go' -print)
# Required for globs to work correctly # Required for globs to work correctly

Loading…
Cancel
Save