From c0a57339be1046e9ca01272e2e12755ff552b37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Thu, 13 Aug 2026 20:16:12 +0000 Subject: [PATCH] build: strip and -Os the Spinel native binary --- Makefile | 6 ++++-- README.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 864ce9f..72da122 100644 --- a/Makefile +++ b/Makefile @@ -119,14 +119,16 @@ i: install ## Shortcut for install # Native binary via Spinel (optional) SPINEL ?= spinel -NATIVE = dist/try +SPINEL_FLAGS ?= -O s +NATIVE = dist/try .PHONY: native native-test native: $(NATIVE) $(NATIVE): try.rb lib/tui.rb lib/fuzzy.rb mkdir -p dist - $(SPINEL) try.rb -o $(NATIVE) + $(SPINEL) $(SPINEL_FLAGS) try.rb -o $(NATIVE) + strip $(NATIVE) native-test: $(NATIVE) bash spec/tests/runner.sh $(NATIVE) diff --git a/README.md b/README.md index aa06a44..4eb0e66 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ echo '~/.local/try.rb init ~/src/tries | source' >> ~/.config/fish/config.fish Compile a native `try` with [Spinel](https://github.com/matz/spinel). Build Spinel from source; [PR 3906](https://github.com/matz/spinel/pull/3906) is required so `IO#tty?` / `#winsize` work on handles that are not statically typed IO. ```bash -make native SPINEL=/path/to/spinel +make native SPINEL=/path/to/spinel # -O s, then strip ./dist/try --help eval "$(./dist/try init)" # wires the shell function to the binary, not MRI make native-test SPINEL=/path/to/spinel