From 2ecbe970668b4a6b7e528b6513ac545186a494fd Mon Sep 17 00:00:00 2001 From: Alper Polat <101826653+gitperr@users.noreply.github.com> Date: Thu, 2 May 2024 21:13:10 +0300 Subject: [PATCH] Sign node exporter darwin binary with rcodesign (#3008) * Sign node exporter darwin binary with rcodesign Prevents SIGKILL issues on macs Signed-off-by: Alper Polat * Be explicit about checking for the binary Co-authored-by: Ben Kochie Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com> * Also attempt to sign darwin-amd64 Signed-off-by: Alper Polat --------- Signed-off-by: Alper Polat Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com> Co-authored-by: Ben Kochie --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e29a6af..8cf200b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,16 @@ jobs: - run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97 - run: promu crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX - run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX + # sign the darwin build so it doesn't get SIGKILLed on start, see: https://github.com/prometheus/node_exporter/issues/2539 + - run: + command: | + if [[ -f "$(pwd)/.build/darwin-arm64/node_exporter" ]]; then + promu codesign "$(pwd)/.build/darwin-arm64/node_exporter" + fi + + if [[ -f "$(pwd)/.build/darwin-amd64/node_exporter" ]]; then + promu codesign "$(pwd)/.build/darwin-amd64/node_exporter" + fi - persist_to_workspace: root: . paths: