-
Notifications
You must be signed in to change notification settings - Fork 437
chore: sync make target #5647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: sync make target #5647
Conversation
Signed-off-by: Loong <[email protected]>
root:[gateway]$ make image-multiarch -n
make --warn-undefined-variables -f tools/make/common.mk image-multiarch
make[1]: Entering directory '/root/gateway'
echo -e "\033[0;32m===========> Running image.verify ... \033[0m"
if [ 1 -ne 1 ]; then \
docker -v ;\
echo -e "\033[36m===========> Unsupported docker version. Docker API version should be greater than 1.32\033[0m"; \
exit 1; \
fi
echo -e "\033[0;32m===========> Running image.multiarch.verify ... \033[0m"
if [ -z "Usage: docker buildx [OPTIONS] COMMAND Run 'docker buildx COMMAND --help' for more information on a command." ]; then \
echo -e "\033[36m===========> Cannot find docker buildx\033[0m"; \
exit 1;\
fi
echo -e "\033[0;32m===========> Running image.multiarch.emulate.amd64 ... \033[0m"
docker run --rm --privileged tonistiigi/binfmt --install linux/amd64
echo -e "\033[0;32m===========> Running image.multiarch.emulate.arm64 ... \033[0m"
docker run --rm --privileged tonistiigi/binfmt --install linux/arm64
echo -e "\033[0;32m===========> Running image.multiarch.setup ... \033[0m"
docker buildx rm gateway-build-tools-builder || :
docker buildx create --use --name gateway-build-tools-builder --platform "linux/amd64,linux/arm64"
echo -e "\033[0;32m===========> Running go.build.darwin_amd64.egctl ... \033[0m"
echo -e "\033[36m===========> "Building binary egctl with commit e7164505 for darwin amd64"\033[0m"
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o /root/gateway/bin/darwin/amd64/egctl -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/egctl
echo -e "\033[0;32m===========> Running go.build.darwin_amd64.envoy-gateway ... \033[0m"
echo -e "\033[36m===========> "Building binary envoy-gateway with commit e7164505 for darwin amd64"\033[0m"
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o /root/gateway/bin/darwin/amd64/envoy-gateway -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/envoy-gateway
echo -e "\033[0;32m===========> Running go.build.darwin_arm64.egctl ... \033[0m"
echo -e "\033[36m===========> "Building binary egctl with commit e7164505 for darwin arm64"\033[0m"
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /root/gateway/bin/darwin/arm64/egctl -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/egctl
echo -e "\033[0;32m===========> Running go.build.darwin_arm64.envoy-gateway ... \033[0m"
echo -e "\033[36m===========> "Building binary envoy-gateway with commit e7164505 for darwin arm64"\033[0m"
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /root/gateway/bin/darwin/arm64/envoy-gateway -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/envoy-gateway
echo -e "\033[0;32m===========> Running go.build.linux_amd64.egctl ... \033[0m"
echo -e "\033[36m===========> "Building binary egctl with commit e7164505 for linux amd64"\033[0m"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /root/gateway/bin/linux/amd64/egctl -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/egctl
echo -e "\033[0;32m===========> Running go.build.linux_amd64.envoy-gateway ... \033[0m"
echo -e "\033[36m===========> "Building binary envoy-gateway with commit e7164505 for linux amd64"\033[0m"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /root/gateway/bin/linux/amd64/envoy-gateway -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/envoy-gateway
echo -e "\033[0;32m===========> Running go.build.linux_arm64.egctl ... \033[0m"
echo -e "\033[36m===========> "Building binary egctl with commit e7164505 for linux arm64"\033[0m"
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /root/gateway/bin/linux/arm64/egctl -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/egctl
echo -e "\033[0;32m===========> Running go.build.linux_arm64.envoy-gateway ... \033[0m"
echo -e "\033[36m===========> "Building binary envoy-gateway with commit e7164505 for linux arm64"\033[0m"
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /root/gateway/bin/linux/arm64/envoy-gateway -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/envoy-gateway
echo -e "\033[0;32m===========> Running go.build.windows_amd64.egctl ... \033[0m"
echo -e "\033[36m===========> "Building binary egctl with commit e7164505 for windows amd64"\033[0m"
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o /root/gateway/bin/windows/amd64/egctl -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/egctl
echo -e "\033[0;32m===========> Running go.build.windows_amd64.envoy-gateway ... \033[0m"
echo -e "\033[36m===========> "Building binary envoy-gateway with commit e7164505 for windows amd64"\033[0m"
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o /root/gateway/bin/windows/amd64/envoy-gateway -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/envoy-gateway
echo -e "\033[0;32m===========> Running go.build.windows_arm64.egctl ... \033[0m"
echo -e "\033[36m===========> "Building binary egctl with commit e7164505 for windows arm64"\033[0m"
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o /root/gateway/bin/windows/arm64/egctl -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/egctl
echo -e "\033[0;32m===========> Running go.build.windows_arm64.envoy-gateway ... \033[0m"
echo -e "\033[36m===========> "Building binary envoy-gateway with commit e7164505 for windows arm64"\033[0m"
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o /root/gateway/bin/windows/arm64/envoy-gateway -ldflags "-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=v1.3.2 -X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=e7164505a9116d87287a09ddd23682d480468f54" github.com/envoyproxy/gateway/cmd/envoy-gateway
echo -e "\033[0;32m===========> Running image.build.multiarch ... \033[0m"
docker buildx build bin -f "/root/gateway/tools/docker/envoy-gateway/Dockerfile" -t "docker.io/envoyproxy/gateway-dev:e7164505" --platform "linux/amd64,linux/arm64"
make[1]: Leaving directory '/root/gateway' |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5647 +/- ##
==========================================
+ Coverage 65.27% 65.32% +0.05%
==========================================
Files 213 213
Lines 34076 34132 +56
==========================================
+ Hits 22243 22297 +54
Misses 10500 10500
- Partials 1333 1335 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -39,6 +39,7 @@ REV=$(shell git rev-parse --short HEAD) | |||
|
|||
# Supported Platforms for building multiarch binaries. | |||
PLATFORMS ?= darwin_amd64 darwin_arm64 linux_amd64 linux_arm64 windows_amd64 windows_arm64 | |||
IMAGE_PLATFORMS ?= ${PLATFORMS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why this is needed ?
the default seems to be IMAGE_PLATFORMS ?= linux_amd64 linux_arm64
in L14 in image.mk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As description said, although we only build linux image as default, go binary will build for all arches :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im still unable to understand why IMAGE_PLATFORMS
needs to be set here ? so we can build all image types by default ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not set here, build image with default value will build:
- binaries for all arch
- images only for Linux
I think should only build binaries only for Linux as well, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, how does setting L42 to all values in L41 solve this though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this way, the default behavior will keep sync.
What type of PR is this?
Now
make image-multiarch
will build go binary of all platforms due to different default value.Another fix is to change the default value for go build.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Release Notes: Yes/No