From d8b8217afa016d593925fdc5b7c819b397de483b Mon Sep 17 00:00:00 2001 From: James Nesbitt Date: Mon, 1 Jun 2026 21:12:57 +0300 Subject: [PATCH] Fix CGO_ENABLED in release build; remove unused goreleaser config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release workflow built binaries without CGO_ENABLED=0, causing the Linux binary to be dynamically linked against the Ubuntu CI runner's glibc (2.32/2.34). The resulting binary fails on RHEL 8 (glibc 2.28) with 'version GLIBC_2.34 not found'. - Set CGO_ENABLED=0 on the go build invocation so all release binaries are statically linked, consistent with what the (now-unused) goreleaser config was doing. - Add -trimpath to strip local build paths from the binary, matching the goreleaser config behaviour. - Remove .goreleaser.local.yml and .goreleaser.release.yml — goreleaser is not referenced in the Makefile or any workflow and has not been used since the release workflow was rewritten. Fixes #638 --- .github/workflows/release.yml | 2 +- .goreleaser.local.yml | 26 -------------------------- .goreleaser.release.yml | 32 -------------------------------- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 .goreleaser.local.yml delete mode 100644 .goreleaser.release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce0667b3..178d3340 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: output_name+=".exe" fi echo "Building $output_name" - GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-X github.com/Mirantis/launchpad/version.Version=${VERSION#v} -X github.com/Mirantis/launchpad/version.GitCommit=$GITHUB_SHA" -o "$output_name" ./main.go + CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -ldflags "-X github.com/Mirantis/launchpad/version.Version=${VERSION#v} -X github.com/Mirantis/launchpad/version.GitCommit=$GITHUB_SHA" -o "$output_name" ./main.go done - name: Generate checksums run: | diff --git a/.goreleaser.local.yml b/.goreleaser.local.yml deleted file mode 100644 index 77c2a496..00000000 --- a/.goreleaser.local.yml +++ /dev/null @@ -1,26 +0,0 @@ -# -# GoRelease instructions for local builds -# -project_name: launchpad -version: 2 -builds: - - env: - - CGO_ENABLED=0 - mod_timestamp: "{{ .CommitTimestamp }}" - flags: - - -trimpath - ldflags: - - -X github.com/Mirantis/launchpad/version.Environment=development - - -X github.com/Mirantis/launchpad/version.GitCommit={{ .FullCommit }} - - -X github.com/Mirantis/launchpad/version.Version={{ .Version }} - # if segment analytics is to be active, set an env variable for the token - - -X github.com/Mirantis/launchpad/pkg/analytics.SegmentToken={{ .Env.SEGMENT_TOKEN }} - binary: "{{ .ProjectName }}" - goos: - - linux - - darwin - - windows - - freebsd - goarch: - - amd64 - - arm64 diff --git a/.goreleaser.release.yml b/.goreleaser.release.yml deleted file mode 100644 index e18cff01..00000000 --- a/.goreleaser.release.yml +++ /dev/null @@ -1,32 +0,0 @@ -# -# GOReleaser instructions for build -# -# We use only the build components of goreleaser because; -# 1. we need to use digicert to sign, no option here -# 2. we would need the pro version to use the prebuilt -# option to get the signing and packaging features -# -project_name: launchpad -version: 2 -builds: - - env: - # goreleaser does not work with CGO, it could also complicate CI/CD - - CGO_ENABLED=0 - mod_timestamp: "{{ .CommitTimestamp }}" - flags: - - -trimpath - ldflags: - - -X github.com/Mirantis/launchpad/version.GitCommit={{ .FullCommit }} - - -X github.com/Mirantis/launchpad/version.Version={{ .Version }} - # if segment analytics is to be active, set an env variable for the token - - -X github.com/Mirantis/launchpad/pkg/analytics.SegmentToken={{ .Env.SEGMENT_TOKEN }} - goos: - - linux - - darwin - - windows - - freebsd - goarch: - - amd64 - - arm64 - no_unique_dist_dir: true - binary: "release/{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}_{{ .Version }}"