Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
chore(build): only build mac binaires on mac host
Kyle Mendellb60a87d2c4d3
diff --git a/scripts/development/build-binaries.sh b/scripts/development/build-binaries.shindex c2b5175ea..3a6f38f22 100755--- a/scripts/development/build-binaries.sh+++ b/scripts/development/build-binaries.sh@@ -4,6 +4,8 @@ set -euo pipefailcd backendmkdir -p .bin+HOST_OS="$(go env GOHOSTOS)" # added+# Read version from repo root .version (trim whitespace), fallback to "dev"VERSION=$(cat ../.version | sed 's/^\s*\|\s*$//g')REVISION=$(cat ../.revision 2>/dev/null || git rev-parse --short HEAD 2>/dev/null || echo "unknown")@@ -23,7 +25,6 @@ for arg in "${@:-}"; doesacdone-# Decide binary base name and build tagsBINARY_BASENAME="arcane"BUILD_TAGS=""if [ "$AGENT_BUILD" = true ]; then@@ -34,11 +35,16 @@ fibuild_platform() {local target="$1" os="$2" arch="$3" arm_version="${4:-}"- local ext=""- local output_path=".bin/${BINARY_BASENAME}-${target}${ext}"+ # skip macOS builds on non-mac hosts (prevents clang -arch failure)+ if [ "$os" = "darwin" ] && [ "$HOST_OS" != "darwin" ]; then+ echo "Skipping $os/$arch (host=$HOST_OS, no macOS toolchain)"+ return 0+ fi++ local output_path=".bin/${BINARY_BASENAME}-${target}"local cgo_enabled=0- if [ "$os" = "darwin" ]; then+ if [ "$os" = "darwin" ] && [ "$HOST_OS" = "darwin" ]; thencgo_enabled="${CGO_ENABLED_DARWIN_OVERRIDE:-1}"fi@@ -51,9 +57,7 @@ build_platform() {filocal build_flags=()- if [ -n "$BUILD_TAGS" ]; then- build_flags=(-tags "$BUILD_TAGS")- fi+ [ -n "$BUILD_TAGS" ] && build_flags=(-tags "$BUILD_TAGS")if [ -n "$arm_version" ]; thenGOARM="$arm_version" CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \@@ -62,21 +66,19 @@ build_platform() {CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \go build "${build_flags[@]}" -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.gofi-echo "Done"}-if [ "$DOCKER_ONLY" = true ]; then- echo "Version: ${VERSION}"+echo "Version: ${VERSION}"+if [ "$DOCKER_ONLY" = true ] ; thenif [ "$AGENT_BUILD" = true ]; then- echo "Building agent binaries for Docker platforms only (linux/amd64, linux/arm64)..."+ echo "Building agent binaries (docker-only linux targets)..."else- echo "Building binaries for Docker platforms only (linux/amd64, linux/arm64)..."+ echo "Building binaries (docker-only linux targets)..."fibuild_platform "linux-amd64" "linux" "amd64"build_platform "linux-arm64" "linux" "arm64"else- echo "Version: ${VERSION}"if [ "$AGENT_BUILD" = true ]; thenecho "Building agent binaries for all platforms..."else