From a846665599c439249f123fdc84ef9089b1c0b55d Mon Sep 17 00:00:00 2001 From: Jamie Sinn Date: Mon, 1 Jun 2026 22:28:23 -0400 Subject: [PATCH] Add --strip option to build_dist Add support for --strip option to strip symbols. Building a rather custom binary with custom flags needs some additional work, and thought to contribute this back up. Signed-off-by: Jamie Sinn --- build_dist.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_dist.sh b/build_dist.sh index c05644711..a32fe419e 100755 --- a/build_dist.sh +++ b/build_dist.sh @@ -51,6 +51,13 @@ while [ "$#" -gt 1 ]; do ldflags="$ldflags -w -s" tags="${tags:+$tags,},$(GOOS= GOARCH= $go run ./cmd/featuretags --min)" ;; + --strip) + # --min overrides your flags, when you're using custom tags and want to + # additionally strip symbols to help reduce the size, this is the easiest + # way to do it. + shift + ldflags="$ldflags -w -s" + ;; --box) if [ ! -z "${TAGS:-}" ]; then echo "set either --box or \$TAGS, but not both"