From 02d653a1aa67ecef0954c32b181382615f814327 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 27 Nov 2019 21:12:16 -0500 Subject: [PATCH] refactor: omit DWARF symbol table and debug information from go binaries This will reduce the size of binaries in exchange for worse debugging output. This is acceptable for our users and worth it to save money on packagecloud package hosting - which is currently free under a given repository size. --- common.mk | 6 +++--- plugins/common/Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common.mk b/common.mk index d2841ffca..0b766a356 100644 --- a/common.mk +++ b/common.mk @@ -21,10 +21,10 @@ clean: find . -xtype l -delete commands: **/**/commands.go - go build $(GO_ARGS) -o commands src/commands/commands.go + go build -ldflags="-s -w" $(GO_ARGS) -o commands src/commands/commands.go subcommands: - go build $(GO_ARGS) -o subcommands/subcommands src/subcommands/subcommands.go + go build -ldflags="-s -w" $(GO_ARGS) -o subcommands/subcommands src/subcommands/subcommands.go $(MAKE) $(SUBCOMMANDS) subcommands/%: @@ -34,7 +34,7 @@ src-clean: rm -rf .gitignore src vendor Makefile *.go glide.* triggers: - go build $(GO_ARGS) -o triggers src/triggers/triggers.go + go build -ldflags="-s -w" $(GO_ARGS) -o triggers src/triggers/triggers.go $(MAKE) $(TRIGGERS) triggers/%: diff --git a/plugins/common/Makefile b/plugins/common/Makefile index 918b966ec..81bfdd798 100644 --- a/plugins/common/Makefile +++ b/plugins/common/Makefile @@ -5,6 +5,6 @@ clean-prop: rm -rf prop prop: clean-prop **/**/prop.go - go build $(GO_ARGS) -o prop src/prop/prop.go + go build -ldflags="-s -w" $(GO_ARGS) -o prop src/prop/prop.go include ../../common.mk