From 3d4a6b5981eafec631c40d8608e4f4ab34c8d671 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 6 Nov 2026 19:55:44 -0500 Subject: [PATCH] refactor: define TARGETARCH once in common.mk --- Makefile | 5 +---- common.mk | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1901fe7a2..8ae4edf8b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ DOKKU_VERSION ?= master -TARGETARCH ?= $(HOST_ARCH) -GOARCH ?= $(TARGETARCH) +include common.mk DOCKER_IMAGE_LABELER_URL ?= $(shell jq -r --arg name docker-image-labeler --arg arch $(TARGETARCH) '.dependencies[] | select(.name == $$name) | .urls[$$arch]' contrib/dependencies.json) DOCKER_CONTAINER_HEALTHCHECKER_URL ?= $(shell jq -r --arg name docker-container-healthchecker --arg arch $(TARGETARCH) '.dependencies[] | select(.name == $$name) | .urls[$$arch]' contrib/dependencies.json) @@ -32,8 +31,6 @@ else BUILD_STACK_TARGETS = build-in-docker endif -include common.mk - .PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build wget include docs.mk diff --git a/common.mk b/common.mk index e68196cb2..d93a042c3 100644 --- a/common.mk +++ b/common.mk @@ -5,8 +5,10 @@ BUILD_IMAGE := golang:1.27.1 GO_BUILD_CACHE ?= /tmp/dokku-go-build-cache GO_MOD_CACHE ?= /tmp/dokku-go-mod-mod GO_ROOT_MOUNT ?= $$PWD/../..:$(GO_REPO_ROOT) -HOST_ARCH := $(shell dpkg --print-architecture 2>/dev/null || uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') -GOARCH ?= $(HOST_ARCH) +ifndef TARGETARCH +TARGETARCH := $(shell dpkg --print-architecture 2>/dev/null || uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') +endif +GOARCH ?= $(TARGETARCH) .PHONY: build-in-docker build clean src-clean