From 58d90f81e1dd7530d8da9ee8166d1264a76a1185 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Wed, 13 Mar 2024 01:06:46 +0000 Subject: [PATCH] Keep symbols tables for fips builds Signed-off-by: Dimitri John Ledkov --- pkg/build/pipelines/go/build.yaml | 7 +++++++ pkg/build/pipelines/go/install.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/pkg/build/pipelines/go/build.yaml b/pkg/build/pipelines/go/build.yaml index ae926c689..aa334aef2 100644 --- a/pkg/build/pipelines/go/build.yaml +++ b/pkg/build/pipelines/go/build.yaml @@ -94,6 +94,13 @@ pipeline: - runs: | LDFLAGS="${{inputs.strip}} ${{inputs.ldflags}}" + # Make fips binaries have symbols table by default + case "${{inputs.go-package}}" in + *-fips*) + LDFLAGS="$(echo $LDFLAGS | sed 's/-s //g')" + ;; + esac + BASE_PATH="${{inputs.prefix}}/${{inputs.install-dir}}/${{inputs.output}}" # Take advantage of melange's buid cache for downloaded modules diff --git a/pkg/build/pipelines/go/install.yaml b/pkg/build/pipelines/go/install.yaml index e2dd816e6..9a50545c4 100644 --- a/pkg/build/pipelines/go/install.yaml +++ b/pkg/build/pipelines/go/install.yaml @@ -72,6 +72,13 @@ pipeline: LDFLAGS="${{inputs.strip}} ${{inputs.ldflags}}" VERSION="" + # Make fips binaries have symbols table by default + case "${{inputs.go-package}}" in + *-fips*) + LDFLAGS="$(echo $LDFLAGS | sed 's/-s //g')" + ;; + esac + # Installed binaries will be stored in a tmp dir export GOBIN=$(mktemp -d)