fix(install): macOS bash 3.2 crash and wrong download paths#7995
fix(install): macOS bash 3.2 crash and wrong download paths#7995rebel117 wants to merge 1 commit into
Conversation
scripts/install.sh used declare -A for the multiplier table, which crashes on macOS bash 3.2 (sparc: unbound variable). Replaced with a plain case statement function that works on all bash versions. The Linux installer also hardcoded download URLs pointing at miners/linux/ even on macOS. Now selects the correct platform-specific miner script (rustchain_mac_miner_v2.5.py) and skips miner_crypto.py which doesn't exist for macOS. Updated install.sh to reference the latest macOS miner v2.5 instead of v2.4. Fixes Scottcjn#7975
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Review of PR #7995 — macOS bash 3.2 Compatibility + Download Path FixObservation 1:
|
Problem
The installer (
scripts/install.sh) has two bugs that prevent it from running on macOS:1.
declare -Acrashes on macOS bash 3.2macOS ships bash 3.2 by default, which doesn't support associative arrays. Running the script produces:
2. Hardcoded Linux download paths
MINER_URL,FINGERPRINT_URL, andMINER_CRYPTO_URLall point atminers/linux/regardless of OS. On macOS the script downloads the Linux miner and tries to downloadminer_crypto.pywhich doesn't exist inminers/macos/.Fix
declare -A MULT_TABLEwith aget_mult_value()function using a plaincasestatement — works on bash 3.2+MINER_SUBDIRso macOS getsminers/macos/rustchain_mac_miner_v2.5.pyinstead of the Linux minerminer_crypto.pydownload conditional on Linux (macOS miner is self-contained)MINER_SCRIPTvariable so systemd/launchd service files reference the correct script name per platforminstall.sh(root) macOS miner reference from v2.4 to v2.5Testing
bash -n scripts/install.sh— syntax OKbash -n install.sh— syntax OKget_mult_value()returns correct values for all arch keysdeclare -Aremains in either scriptFixes #7975