Skip to content

build: reduce release binary size by stripping symbols, trimming paths, and upx on release#19

Merged
Code0x58 merged 2 commits intomasterfrom
codex/optimize-build-size-in-release-tooling
Feb 17, 2026
Merged

build: reduce release binary size by stripping symbols, trimming paths, and upx on release#19
Code0x58 merged 2 commits intomasterfrom
codex/optimize-build-size-in-release-tooling

Conversation

@Code0x58
Copy link
Copy Markdown
Owner

Motivation

  • Reduce the size of release artifacts by removing debug symbols and embedded build metadata while keeping runtime compatibility intact.
  • Ensure reproducible and smaller Docker/GoReleaser builds for an infrequently used, network-bound tool where runtime speed is not a priority.

Description

  • Added build flags in .goreleaser.yml to remove local path and VCS metadata (-trimpath, -buildvcs=false) and to pass linker flags (-s -w -buildid=) while injecting main.version at link time via -X main.version={{ .Version }}.
  • Updated the Dockerfile build command to align with the same size-focused flags (-trimpath -buildvcs=false -tags netgo -ldflags '-s -w -buildid=') to produce smaller release images.
  • Kept CGO_ENABLED=0 and target platforms unchanged to preserve compatibility and static build behavior.

Testing

  • Ran go build ./... which completed successfully.

Codex Task

@Code0x58 Code0x58 changed the title build: reduce release binary size by stripping symbols and trimming paths build: reduce release binary size by stripping symbols, trimming paths, and upx on release Feb 17, 2026
@Code0x58 Code0x58 merged commit f2a39da into master Feb 17, 2026
2 checks passed
@Code0x58 Code0x58 deleted the codex/optimize-build-size-in-release-tooling branch February 17, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant