release: build with consistent paths

This changes the builds to always add -trimpath which removes specific
build time paths from the binary (like current directories etc).

Improves build reproducability to make the final binary independent from
the specific build path.

Lastly, when stripping debug symbols, also add -w to strip DWARF symbols
as well which aren't needed in that case either.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
This commit is contained in:
Dirkjan Bussink
2021-12-22 09:59:40 +01:00
committed by Marek Siarkowicz
parent 7ccca083eb
commit 1a9742c9c4
3 changed files with 9 additions and 5 deletions

View File

@ -87,7 +87,7 @@ function main {
export GOARCH=${TARGET_ARCH}
pushd etcd >/dev/null
GO_LDFLAGS="-s" ./build.sh
GO_LDFLAGS="-s -w" ./build.sh
popd >/dev/null
TARGET="etcd-${VER}-${GOOS}-${GOARCH}"