Skip to content

Commit 0f03039

Browse files
fix: macos builds not signed, strip debug info on install (#250)
* chore:update read to add troubleshooting info on M* macbooks * `-s -w` on build --------- Co-authored-by: Reece Williams <[email protected]>
1 parent 16d8ca2 commit 0f03039

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ endif
1313

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

1923
## mod-tidy: go mod tidy spawn, simapp, and interchaintest with proper go.mod suffixes

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ make get-localic
3838
# Attempt to run a command
3939
spawn help
4040

41+
# Potential workaround if spawn is immediately killed when attempting run "spawn help" on a m* macbook.
42+
# This may happen because of an xcode16 update.
43+
# To work around this as a temporary measure please change this line in the Make file.
44+
LD_FLAGS = -X main.SpawnVersion=$(VERSION)
45+
# to
46+
LD_FLAGS = -X main.SpawnVersion=$(VERSION) -s -w
47+
48+
4149
# If you get "command 'spawn' not found", add to path.
4250
# Run the following in your terminal to test
4351
# Then add to ~/.bashrc (linux / windows) or ~/.zshrc (mac)

simapp/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))
6262

6363
# process linker flags
6464

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

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

0 commit comments

Comments
 (0)