Skip to content

bug: install-miner.sh missing architecture validation for macOS #3988

@haoyousun60-create

Description

@haoyousun60-create

Bug Report

Description

The install-miner.sh script claims to support macOS (Intel/M2) in the header comments, but the detect_platform() function doesn't validate the architecture on Darwin systems.

Current Behavior

detect_platform() {
    local os=$(uname -s)
    local arch=$(uname -m)
    case "$os" in
        Linux)
            [ "$arch" != "aarch64" ] && [ "$arch" != "x86_64" ] && [ "$arch" != "ppc64le" ] && { echo -e "${RED}[!] Unsupported architecture: $arch (Supported: aarch64, x86_64, ppc64le)${NC}"; exit 1; }
            ...
        Darwin) echo "macos" ;;  # <-- No arch check here!
        *) echo "unknown"; exit 1 ;;
    esac
}

Expected Behavior

Should validate that macOS architecture is either x86_64 (Intel) or arm64 (Apple Silicon/M1/M2), and reject unsupported architectures like i386 on older macOS.

Suggested Fix

Darwin)
    [ "$arch" != "x86_64" ] && [ "$arch" != "arm64" ] && { echo -e "${RED}[!] Unsupported macOS architecture: $arch (Supported: x86_64, arm64)${NC}"; exit 1; }
    echo "macos" ;;

Impact

  • Low severity: Currently all macOS systems will work since Apple only ships x86_64 and arm64
  • But the script is inconsistent with its Linux validation behavior
  • Could cause confusion if someone tries to run on an ancient 32-bit Mac

Environment

  • File: install-miner.sh
  • Line: ~65 (detect_platform function)
  • Version: 1.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions