Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Copy link
Contributor

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

Copy link
Member Author

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 :(

Copy link
Contributor

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 ?

Copy link
Member Author

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?

Copy link
Contributor

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

Copy link
Member Author

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.


# Set a specific PLATFORM
ifeq ($(origin PLATFORM), undefined)
Expand Down
2 changes: 1 addition & 1 deletion tools/make/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IMAGE_PLATFORMS ?= linux_amd64 linux_arm64

BUILDX_CONTEXT = gateway-build-tools-builder
# Convert to linux/arm64,linux/amd64
$(eval BUILDX_PLATFORMS = $(shell echo "${IMAGE_PLATFORMS}" | sed "s# #,#;s#_#/#g"))
$(eval BUILDX_PLATFORMS = $(shell echo "${IMAGE_PLATFORMS}" | sed "s# #,#g;s#_#/#g"))
EMULATE_PLATFORMS = amd64 arm64
EMULATE_TARGETS = $(addprefix image.multiarch.emulate.,$(EMULATE_PLATFORMS))

Expand Down
Loading