From 4d1b72d6efbe42a30d609a1d65259cc7de183c4a Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Tue, 8 Oct 2024 16:41:10 +0200 Subject: [PATCH] build statically linked binaries with CGO disabled In https://github.com/pulumi/pulumi-yaml/pull/632 we switched the build from running on MacOS to Ubuntu. On MacOS CGO is disabled by default, and switching to Ubuntu means this is turned on. We however want to build statically linked binaries since they are easier to deal with. Set that up in the goreleaser.yml directly. --- .changes/unreleased/Bug Fixes-657.yaml | 6 ++++++ .goreleaser.yml | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 .changes/unreleased/Bug Fixes-657.yaml diff --git a/.changes/unreleased/Bug Fixes-657.yaml b/.changes/unreleased/Bug Fixes-657.yaml new file mode 100644 index 00000000..15b1c573 --- /dev/null +++ b/.changes/unreleased/Bug Fixes-657.yaml @@ -0,0 +1,6 @@ +component: runtime +kind: Bug Fixes +body: Build statically linked release binary with CGO disabled +time: 2024-10-08T16:41:00.728884753+02:00 +custom: + PR: "657" diff --git a/.goreleaser.yml b/.goreleaser.yml index 4d0727b4..210edeac 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,6 +17,8 @@ archives: builds: - id: pulumi-language-yaml binary: pulumi-language-yaml + env: + - CGO_ENABLED=0 goarch: - amd64 - arm64 @@ -31,6 +33,8 @@ builds: main: ./cmd/pulumi-language-yaml/ - id: pulumi-converter-yaml binary: pulumi-converter-yaml + env: + - CGO_ENABLED=0 goarch: - amd64 - arm64