Skip to content

Commit f6c7d4e

Browse files
committed
target correct zig arch during windows build
Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
1 parent 0e17331 commit f6c7d4e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ COPY . ./
5353
RUN --mount=type=cache,target=/root/.cache,id=docker-ai-$TARGETPLATFORM \
5454
--mount=type=cache,target=/go/pkg/mod <<EOT
5555
set -ex
56-
CC="zig cc -target x86_64-windows-gnu" CXX="zig c++ -target x86_64-windows-gnu" xx-go build -trimpath -ldflags "-s -w -X 'github.com/docker/cagent/pkg/version.Version=$GIT_TAG' -X 'github.com/docker/cagent/pkg/version.Commit=$GIT_COMMIT'" -o /binaries/cagent-$TARGETOS-$TARGETARCH .
56+
if [ "$TARGETARCH" = "arm64" ]; then
57+
ZIG_TARGET="aarch64-windows-gnu"
58+
else
59+
ZIG_TARGET="x86_64-windows-gnu"
60+
fi
61+
CC="zig cc -target $ZIG_TARGET" CXX="zig c++ -target $ZIG_TARGET" xx-go build -trimpath -ldflags "-s -w -X 'github.com/docker/cagent/pkg/version.Version=$GIT_TAG' -X 'github.com/docker/cagent/pkg/version.Commit=$GIT_COMMIT'" -o /binaries/cagent-$TARGETOS-$TARGETARCH .
5762
mv /binaries/cagent-$TARGETOS-$TARGETARCH /binaries/cagent-$TARGETOS-$TARGETARCH.exe
5863
xx-verify --static /binaries/cagent-windows-$TARGETARCH.exe
5964
EOT

0 commit comments

Comments
 (0)