From 207deeadba2721435a21e0f68c61e522eedef26c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 23 Apr 2024 17:24:50 +0900 Subject: [PATCH] Add -trimpath to build command --- .goreleaser.yml | 6 ++++++ Makefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 1ac56108..86e821f0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,6 +12,8 @@ builds: - darwin goarch: - amd64 + flags: + - -trimpath ldflags: - "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}" hooks: @@ -36,6 +38,8 @@ builds: - darwin goarch: - arm64 + flags: + - -trimpath ldflags: - "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}" hooks: @@ -71,6 +75,8 @@ builds: - 5 - 6 - 7 + flags: + - -trimpath ldflags: - "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}" ignore: diff --git a/Makefile b/Makefile index 0416cc35..44b010c5 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ endif ifeq ($(REVISION),) $(error Not on git repository; cannot determine $$FZF_REVISION) endif -BUILD_FLAGS := -a -ldflags "-s -w -X main.version=$(VERSION) -X main.revision=$(REVISION)" -tags "$(TAGS)" +BUILD_FLAGS := -a -ldflags "-s -w -X main.version=$(VERSION) -X main.revision=$(REVISION)" -tags "$(TAGS)" -trimpath BINARY32 := fzf-$(GOOS)_386 BINARY64 := fzf-$(GOOS)_amd64