Skip to content

Commit

Permalink
add -a flag when building release binaries
Browse files Browse the repository at this point in the history
One more step towards byte-perfect reproducibility.
The option -a tells Go to rebuild everything. Libraries in
$GOROOT/pkg/$GOOS_GOARCH could be (and are likely to) build with
other toolchain, leaking build directory of that other toolchain
into resulting binaries.

See NebulousLabs#2410
  • Loading branch information
starius committed Oct 9, 2017
1 parent cce1680 commit d67a90c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ release:
release-race:
go install -race -tags='debug profile netgo' $(pkgs)
release-std:
go install -tags 'netgo' -ldflags='-s -w' $(pkgs)
go install -tags 'netgo' -a -ldflags='-s -w' $(pkgs)

# clean removes all directories that get automatically created during
# development.
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for os in darwin linux windows; do
if [ "$os" == "windows" ]; then
bin=${pkg}.exe
fi
GOOS=${os} go build -ldflags="-s -w" -o $folder/$bin ./$pkg
GOOS=${os} go build -a -ldflags="-s -w" -o $folder/$bin ./$pkg
openssl dgst -sha256 -sign $keyfile -out $folder/${bin}.sig $folder/$bin
# verify signature
if [[ -n $pubkeyfile ]]; then
Expand Down

0 comments on commit d67a90c

Please sign in to comment.