From ec8a0c45847da494187a60a982e5dd15de77abf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Wed, 5 Feb 2025 08:36:57 +0100 Subject: [PATCH] directly generate cws_instrumentatio binary with the expected name --- .gitlab/binary_build/cws_instrumentation.yml | 3 +-- tasks/cws_instrumentation.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab/binary_build/cws_instrumentation.yml b/.gitlab/binary_build/cws_instrumentation.yml index e1616f2d9ff080..40a89abaab900b 100644 --- a/.gitlab/binary_build/cws_instrumentation.yml +++ b/.gitlab/binary_build/cws_instrumentation.yml @@ -4,8 +4,7 @@ needs: ["go_mod_tidy_check"] script: - inv check-go-version - - inv -e cws-instrumentation.build - - mv $CI_PROJECT_DIR/$CWS_INSTRUMENTATION_BINARIES_DIR/cws-instrumentation $CI_PROJECT_DIR/$CWS_INSTRUMENTATION_BINARIES_DIR/cws-instrumentation.$ARCH + - inv -e cws-instrumentation.build --arch-suffix artifacts: paths: - $CWS_INSTRUMENTATION_BINARIES_DIR/cws-instrumentation.$ARCH diff --git a/tasks/cws_instrumentation.py b/tasks/cws_instrumentation.py index 2726b9b753c25f..47d0afe217f81c 100644 --- a/tasks/cws_instrumentation.py +++ b/tasks/cws_instrumentation.py @@ -34,6 +34,7 @@ def build( static=False, fips_mode=False, no_strip_binary=False, + arch_suffix=False, ): """ Build cws-instrumentation @@ -60,6 +61,9 @@ def build( build_type = "-a" if rebuild else "" go_build_tags = " ".join(build_tags) agent_bin = BIN_PATH + if arch_suffix: + arch = CONTAINER_PLATFORM_MAPPING.get(platform.machine().lower()) + agent_bin = f'{agent_bin}.{arch}' strip_flags = "" if no_strip_binary else "-s -w"