Skip to content

Commit

Permalink
-s -w on build
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 24, 2024
1 parent 16d8ca2 commit 0923737
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ endif

DATE := $(shell date '+%Y-%m-%dT%H:%M:%S')
HEAD = $(shell git rev-parse HEAD)
LD_FLAGS = -X main.SpawnVersion=$(VERSION)
# MacOS sequoia + XCode 16 causes the binary to instantly die
# Stripping the debug info with -s -w fixes this so the binary
# is properly signed
# ref: https://github.com/rollchains/spawn/issues/248
LD_FLAGS = -X main.SpawnVersion=$(VERSION) -s -w
BUILD_FLAGS = -mod=readonly -ldflags='$(LD_FLAGS)'

## mod-tidy: go mod tidy spawn, simapp, and interchaintest with proper go.mod suffixes
Expand Down
5 changes: 4 additions & 1 deletion simapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))

# process linker flags

# flags '-s -w' resolves an issue with xcode 16 and signing of go binaries
# ref: https://github.com/golang/go/issues/63997
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=wasm \
-X github.com/cosmos/cosmos-sdk/version.AppName=wasmd \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-s -w

ifeq ($(WITH_CLEVELDB),yes)
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down

0 comments on commit 0923737

Please sign in to comment.