From c75f2a204106d19563cee7d752ee9b54834fa5dc Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Mon, 7 Oct 2024 16:54:17 +0200 Subject: [PATCH] build: fix empty platform in dagger Signed-off-by: Mark Sagi-Kazar --- .dagger/build.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.dagger/build.go b/.dagger/build.go index 7a28ffe6f..daf5eac4f 100644 --- a/.dagger/build.go +++ b/.dagger/build.go @@ -215,8 +215,14 @@ func (m *Binary) build(platform dagger.Platform, version string, pkg string) *da } return goModule(). + With(func(m *dagger.Go) *dagger.Go { + if platform != "" { + m = m.WithPlatform(platform) + } + + return m + }). WithSource(m.Source). - WithPlatform(platform). Build(dagger.GoWithSourceBuildOpts{ Pkg: pkg, Trimpath: true,