Skip to content

Strip symbol/debugging info from production builds#42

Merged
kevinmcconnell merged 1 commit intomainfrom
strip-symbols
Apr 3, 2026
Merged

Strip symbol/debugging info from production builds#42
kevinmcconnell merged 1 commit intomainfrom
strip-symbols

Conversation

@kevinmcconnell
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 12:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Go linker flags used by the Makefile to strip symbol and DWARF debugging information from the produced binaries, reducing artifact size.

Changes:

  • Add -s -w to the go build -ldflags used by Make targets (via LDFLAGS).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
ARCHITECTURES = amd64 arm64
VERSION := $(shell git describe --tags --always)
LDFLAGS := -ldflags "-X 'github.com/basecamp/once/internal/version.Version=$(VERSION)'"
LDFLAGS := -ldflags "-s -w -X 'github.com/basecamp/once/internal/version.Version=$(VERSION)'"
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title says this is for “production builds”, but LDFLAGS is used by both make build (also run in CI) and make dist/build-all, so -s -w will apply to all builds (including local dev builds). Consider scoping the stripped flags to the release targets (e.g., a separate RELEASE_LDFLAGS used only by build-all/dist, or a STRIP ?= 0/1 toggle), or update the PR title to match the behavior.

Copilot uses AI. Check for mistakes.
@kevinmcconnell kevinmcconnell merged commit a29e66d into main Apr 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants