From 199f0ee0c06674f42122eb9e12f8b38dcda2ee90 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Fri, 2 Dec 2022 09:49:38 +0100 Subject: [PATCH] Build system improvements - remove cgo specific environment variables from goreleaser configuration - add -trimpath option to go build calls - add snapshot target in Makefile to run goreleaser --- .goreleaser.yaml | 11 ----------- Makefile | 7 +++++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 2bd7dbe..446e692 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,9 +13,6 @@ builds: - linux goarch: - amd64 - env: - - CC=x86_64-linux-gnu-gcc - - CXX=x86_64-linux-gnu-g++ - id: linux-arm64 main: ./cmd/signerclient binary: cacert-gosigner @@ -25,10 +22,6 @@ builds: - arm64 goarm: - "9" - env: - - CC=aarch64-linux-gnu-gcc - - CXX=aarch64-linux-gnu-g++ - - PKG_CONFIG_PATH=/usr/aarch64-linux-gnu/pkgconfig - id: linux-armhf main: ./cmd/signerclient binary: cacert-gosigner @@ -38,10 +31,6 @@ builds: - arm goarm: - "7" - env: - - CC=arm-linux-gnueabihf-gcc - - CXX=arm-linux-gnueabihf-g++ - - PKG_CONFIG_PATH=/usr/arm-linux-gnueabihf/pkgconfig archives: - id: cacert-gosignerclient builds: diff --git a/Makefile b/Makefile index 76adbf0..f38d6c7 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,12 @@ test: go test -race ./... signerclient: $(GOFILES) - go build -race -ldflags="-X 'main.date=$(BUILD_TIME)' -X 'main.commit=$(COMMIT)' -X 'main.version=$(VERSION)'" ./cmd/signerclient + go build -race -trimpath -ldflags="-X 'main.date=$(BUILD_TIME)' -X 'main.commit=$(COMMIT)' -X 'main.version=$(VERSION)'" ./cmd/signerclient clean: rm -f signerclient -.PHONY: test lint all clean \ No newline at end of file +snapshot: + goreleaser build --rm-dist --snapshot + +.PHONY: test lint all clean snapshot \ No newline at end of file