builds: fix "Killed" error with make dev (#15003)

Previously, I would sometimes get Killed errors when executing the
binary created by `make dev`. This is because we were using `cp`
and OSX has a bug where it caches the old signature and so doesn't
allow the new binary to run (see https://apple.stackexchange.com/a/428388)
This commit is contained in:
Luke Kysow 2022-10-21 11:10:11 -07:00 committed by GitHub
parent 820ae3b186
commit 19d983936c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -149,7 +149,9 @@ dev: dev-build
dev-build:
mkdir -p bin
CGO_ENABLED=0 go install -ldflags "$(GOLDFLAGS)" -tags "$(GOTAGS)"
cp -f ${MAIN_GOPATH}/bin/consul ./bin/consul
# rm needed due to signature caching (https://apple.stackexchange.com/a/428388)
rm -f ./bin/consul
cp ${MAIN_GOPATH}/bin/consul ./bin/consul
dev-docker: linux
@echo "Pulling consul container image - $(CONSUL_IMAGE_VERSION)"