From 64805c5e92fc270ce01afd6980a8fa8a604f2ac8 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Sat, 11 Nov 2023 03:06:48 +0100 Subject: [PATCH] Use go -trimpath per golang/go#63851 this is the recommended way to achieve reproducible builds. This patch was done while working on reproducible builds for openSUSE. --- Makefile | 4 ++-- script/build | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dfcbf6323..8bf73f831 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ export GO111MODULE=on unexport GOPATH export LDFLAGS := -extldflags '$(LDFLAGS)' -export GCFLAGS := all=-trimpath '$(PWD)' -export ASMFLAGS := all=-trimpath '$(PWD)' +export GCFLAGS := +export ASMFLAGS := MIN_COVERAGE = 90.2 diff --git a/script/build b/script/build index 058a1874f..9ef27ee26 100755 --- a/script/build +++ b/script/build @@ -17,6 +17,7 @@ build_hub() { -ldflags "-X github.com/github/hub/v2/version.Version=`./script/version` $LDFLAGS" \ -gcflags "$GCFLAGS" \ -asmflags "$ASMFLAGS" \ + -trimpath \ -o "$1" }