From 201a6ea6511b6ece0198fb5d46db7af4743f01a1 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 3 Oct 2023 17:38:50 +0200 Subject: [PATCH] build: use codesign -f Running 'make' twice currently results in an error: ``` % make CGO_ENABLED=1 CGO_CFLAGS=-mmacosx-version-min=11.0 GOOS=darwin GOARCH=amd64 go build -o out/vfkit-amd64 ./cmd/vfkit codesign --entitlements vf.entitlements -s - out/vfkit-amd64 out/vfkit-amd64: is already signed make: *** [out/vfkit-amd64] Error 1 ``` This commit makes use of "codesign -f" to force the re-generation of a signature even if the binarie did not change. This works around the previous error. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ed4cd3a4..43d30163 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ clean: out/vfkit-amd64 out/vfkit-arm64: out/vfkit-%: force-build @mkdir -p $(@D) CGO_ENABLED=1 CGO_CFLAGS=$(CGO_CFLAGS) GOOS=darwin GOARCH=$* go build -o $@ ./cmd/vfkit - codesign --entitlements vf.entitlements -s - $@ + codesign -f --entitlements vf.entitlements -s - $@ out/vfkit: out/vfkit-amd64 out/vfkit-arm64 cd $(@D) && lipo -create $(^F) -output $(@F)