Your music, beautifully tracked. All yours. (coming soon) teal.fm
teal-fm atproto
at main 1.7 kB view raw
1#!/bin/bash 2set -e 3 4# Debug: Print all available build variables 5echo "DEBUG: TARGETPLATFORM=$TARGETPLATFORM" 6echo "DEBUG: BUILDPLATFORM=$BUILDPLATFORM" 7echo "DEBUG: TARGETARCH=$TARGETARCH" 8echo "DEBUG: TARGETOS=$TARGETOS" 9 10# Use TARGETARCH directly (more reliable than TARGETPLATFORM) 11TARGET_ARCH_VAR="${TARGETARCH:-}" 12 13# If TARGETARCH is not set, try to extract from TARGETPLATFORM 14if [ -z "$TARGET_ARCH_VAR" ] && [ -n "$TARGETPLATFORM" ]; then 15 TARGET_ARCH_VAR=$(echo "$TARGETPLATFORM" | cut -d'/' -f2) 16 echo "DEBUG: Extracted TARGET_ARCH_VAR=$TARGET_ARCH_VAR from TARGETPLATFORM" 17fi 18 19# Final fallback: detect from uname 20if [ -z "$TARGET_ARCH_VAR" ]; then 21 ARCH=$(uname -m) 22 case "$ARCH" in 23 "x86_64") 24 TARGET_ARCH_VAR="amd64" 25 ;; 26 "aarch64") 27 TARGET_ARCH_VAR="arm64" 28 ;; 29 *) 30 echo "ERROR: Could not detect target architecture. uname -m returned: $ARCH" 31 echo "Available variables: TARGETARCH=$TARGETARCH, TARGETPLATFORM=$TARGETPLATFORM" 32 exit 1 33 ;; 34 esac 35 echo "DEBUG: Detected TARGET_ARCH_VAR=$TARGET_ARCH_VAR from uname" 36fi 37 38# Map architecture to Rust target 39case "$TARGET_ARCH_VAR" in 40 "amd64") 41 export RUST_TARGET="x86_64-unknown-linux-gnu" 42 export TARGET_ARCH="amd64" 43 ;; 44 "arm64") 45 export RUST_TARGET="aarch64-unknown-linux-gnu" 46 export TARGET_ARCH="arm64" 47 ;; 48 *) 49 echo "ERROR: Unsupported target architecture: $TARGET_ARCH_VAR" 50 echo "Supported architectures: amd64, arm64" 51 exit 1 52 ;; 53esac 54 55echo "SUCCESS: Using RUST_TARGET=$RUST_TARGET, TARGET_ARCH=$TARGET_ARCH"