Skip to content

Commit

Permalink
Fix Makefile build cmd to create static binaries
Browse files Browse the repository at this point in the history
The previous build command produces dynamic executables
instead of the intended (but not well noted in the Makefile)
static executables. This commit includes changes noted in
upstream `golang/go` issues which appear to work as intended
for others.

- refs GH-94
- refs golang/go#38789
- refs golang/go#26492
  • Loading branch information
atc0005 committed Oct 3, 2020
1 parent 50c2fd5 commit 2c2f3d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ VERSION = $(shell git describe --always --long --dirty)

# The default `go build` process embeds debugging information. Building
# without that debugging information reduces the binary size by around 28%.
BUILDCMD = go build -mod=vendor -a -ldflags="-s -w -X $(VERSION_VAR_PKG).version=$(VERSION)"
BUILDCMD = go build -mod=vendor -tags 'osusergo netgo' -a -ldflags="-s -w -X $(VERSION_VAR_PKG).version=$(VERSION)"
GOCLEANCMD = go clean -mod=vendor ./...
GITCLEANCMD = git clean -xfd
CHECKSUMCMD = sha256sum -b
Expand Down

0 comments on commit 2c2f3d1

Please sign in to comment.