Skip to content

Commit

Permalink
Make the build consistent across archs for Go to correctly report the…
Browse files Browse the repository at this point in the history
… package path inside the binary

Signed-off-by: Guilherme Macedo <[email protected]>
(cherry picked from commit 4a9d4cd)
  • Loading branch information
macedogm authored and Vicente-Cheng committed Dec 18, 2024
1 parent 1aec0b3 commit df3e0d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ LINKFLAGS="-X github.com/harvester/node-disk-manager/pkg/version.Version=$VERSIO
-X github.com/harvester/node-disk-manager/pkg/version.GitCommit=$COMMIT $LINKFLAGS"

for arch in "amd64" "arm64"; do
GOARCH="$arch" CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/node-disk-manager-"$arch" cmd/node-disk-manager/main.go
GOARCH="$arch" CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/node-disk-manager-webhook-"$arch" cmd/node-disk-manager-webhook/main.go
done
GOARCH="$arch" CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/node-disk-manager-"$arch" ./cmd/node-disk-manager
GOARCH="$arch" CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/node-disk-manager-webhook-"$arch" ./cmd/node-disk-manager-webhook
done

0 comments on commit df3e0d0

Please sign in to comment.