From 6db66654fdad8af7012a85678d5a3afa54e5f43e Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Thu, 12 Nov 2026 19:39:28 +0100 Subject: [PATCH 1/2] Add s390x binary build support Allow building linux/s390x binaries via `make build-linux-s390x` and include them in GitHub releases. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 4 ++++ Makefile | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66d875fb..69fe76a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,9 @@ jobs: # Linux arm64 GOOS=linux GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o roxie-linux-arm64 ./cmd + # Linux s390x + GOOS=linux GOARCH=s390x go build -ldflags "${LDFLAGS}" -o roxie-linux-s390x ./cmd + # macOS amd64 GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o roxie-darwin-amd64 ./cmd @@ -62,6 +65,7 @@ jobs: files: | roxie-linux-amd64 roxie-linux-arm64 + roxie-linux-s390x roxie-darwin-amd64 roxie-darwin-arm64 checksums.txt diff --git a/Makefile b/Makefile index 50237322..acade1fc 100644 --- a/Makefile +++ b/Makefile @@ -57,9 +57,9 @@ build-%: ## Build the roxie binary for a specific OS/ARCH (e.g., build-linux-amd echo "Supported: linux, darwin"; \ exit 1; \ fi - @if ! echo "amd64 arm64" | grep -qw "$(TARGET_ARCH)"; then \ + @if ! echo "amd64 arm64 s390x" | grep -qw "$(TARGET_ARCH)"; then \ echo "❌ Unsupported ARCH: $(TARGET_ARCH)"; \ - echo "Supported: amd64, arm64"; \ + echo "Supported: amd64, arm64, s390x"; \ exit 1; \ fi @echo "🔨 Building roxie for $(TARGET_OS)/$(TARGET_ARCH)..." From 57748087541474b4df03e0fc6c84273afa81ca58 Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Wed, 18 Nov 2026 12:59:53 +0100 Subject: [PATCH 2/2] Validate build-% against an explicit platform allowlist Checking OS and ARCH independently accepted impossible combinations such as darwin-s390x. Replace both checks with a single list of the exact os-arch pairs we support. Co-Authored-By: Claude Opus 5.5 --- Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index acade1fc..ac3099f5 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ BUILD_DIR := . BINARY := $(BUILD_DIR)/$(BINARY_NAME) INSTALLED_BINARY := $(GOPATH)/bin/$(BINARY_NAME) +# Platforms supported by build--. +SUPPORTED_PLATFORMS := linux-amd64 linux-arm64 linux-s390x darwin-amd64 darwin-arm64 + # Convention is that the git tags are of the form # v..--[-dirty] # or v.. @@ -52,14 +55,9 @@ build-%: ## Build the roxie binary for a specific OS/ARCH (e.g., build-linux-amd @$(eval PARTS := $(subst -, ,$*)) @$(eval TARGET_OS := $(word 1,$(PARTS))) @$(eval TARGET_ARCH := $(word 2,$(PARTS))) - @if ! echo "linux darwin" | grep -qw "$(TARGET_OS)"; then \ - echo "❌ Unsupported OS: $(TARGET_OS)"; \ - echo "Supported: linux, darwin"; \ - exit 1; \ - fi - @if ! echo "amd64 arm64 s390x" | grep -qw "$(TARGET_ARCH)"; then \ - echo "❌ Unsupported ARCH: $(TARGET_ARCH)"; \ - echo "Supported: amd64, arm64, s390x"; \ + @if [ -z "$(filter $*,$(SUPPORTED_PLATFORMS))" ]; then \ + echo "❌ Unsupported platform: $*"; \ + echo "Supported: $(SUPPORTED_PLATFORMS)"; \ exit 1; \ fi @echo "🔨 Building roxie for $(TARGET_OS)/$(TARGET_ARCH)..."