From e4ca8b8db4147def9483d23c544d606f01ed4d1b Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 24 Mar 2023 10:50:12 -0400 Subject: [PATCH 1/2] Makefile: date format of log should not show signatures if user's have git configurations like `git config --global log.showSignature=true` it will cause an issue in the Makefile variable output, like: ```shell vbatts@possibly:~/src/github.com/sigstore/cosign$ make [288/1916] /bin/sh: 1: Syntax error: "(" unexpected CGO_ENABLED=0 go build -trimpath -ldflags "-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=v2.0.0-63-ge71faa1a -X sigs.k8s.io/release-utils/version.gitCommit=e71faa1af0383d860481f569ef2c01694d37b00b -X sigs.k8s.io/release-utils/version.gitTreeState="clean" -X sigs.k8s.io/release-utils/version.buildDate=" -o cosign ./cmd/cosign ``` Signed-off-by: Vincent Batts --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad0217b969d..a355435f3b0 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ GIT_TAG ?= dirty-tag GIT_VERSION ?= $(shell git describe --tags --always --dirty) GIT_HASH ?= $(shell git rev-parse HEAD) DATE_FMT = +%Y-%m-%dT%H:%M:%SZ -SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) +SOURCE_DATE_EPOCH ?= $(shell git log -1 --no-show-signature --pretty=%ct) ifdef SOURCE_DATE_EPOCH BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") else From 2ed0492548be8f08518312189e9d1b6a4420d629 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 24 Mar 2023 11:03:51 -0400 Subject: [PATCH 2/2] Makefile: add the ability to DEBUG the `make` build Signed-off-by: Vincent Batts --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index a355435f3b0..04254f00583 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +ifeq (,$(shell echo $$DEBUG)) +else +SHELL = bash -x +endif + # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) GOBIN=$(shell go env GOPATH)/bin