From 8704767ac5e58c704ced76a25f49ccdbbf414b0b Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Wed, 30 Jul 2025 16:44:34 +0200 Subject: [PATCH] [dx] Allow to not specify BUILDER for makefile if PLATFORM specified Signed-off-by: Andrei Kvapil --- scripts/common-envs.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/common-envs.mk b/scripts/common-envs.mk index bdff841b..ec11ada4 100644 --- a/scripts/common-envs.mk +++ b/scripts/common-envs.mk @@ -17,6 +17,8 @@ endif # Get the name of the selected docker buildx builder BUILDER ?= $(shell docker buildx inspect --bootstrap | head -n2 | awk '/^Name:/{print $$NF}') -# Get platforms supported by the builder -PLATFORM ?= $(shell docker buildx ls --format=json | jq -r 'select(.Name == "$(BUILDER)") | [.Nodes[].Platforms // []] | flatten | unique | map(select(test("^linux/amd64$$|^linux/arm64$$"))) | join(",")') +# Get platforms supported by the builder (only if PLATFORM is not provided) +ifeq ($(origin PLATFORM), undefined) +PLATFORM := $(shell docker buildx ls --format=json | jq -r 'select(.Name == "$(BUILDER)") | [.Nodes[].Platforms // []] | flatten | unique | map(select(test("^linux/amd64$$|^linux/arm64$$"))) | join(",")') +endif