Skip to content

[BOUNTY #16251] Fix install script — wrong paths + macOS crash, shellcheck-clean#8025

Open
zhaog100 wants to merge 1 commit into
Scottcjn:mainfrom
zhaog100:fix/install-script-macos-cross-platform
Open

[BOUNTY #16251] Fix install script — wrong paths + macOS crash, shellcheck-clean#8025
zhaog100 wants to merge 1 commit into
Scottcjn:mainfrom
zhaog100:fix/install-script-macos-cross-platform

Conversation

@zhaog100

Copy link
Copy Markdown
Contributor

Bounty: #16251 — Fix rustchain.org install script — wrong paths + macOS crash (Rustchain#7975), shellcheck-clean

Reward: 10 RTC

Problem Reproduced

The original install.sh had two critical issues:

  1. macOS crash: Used grep -oP (Perl regex) which is not supported by BSD grep on macOS. Python version detection would fail with a hard crash.
  2. Wrong error message: When Python was missing, the installer suggested sudo apt install python3 python3-pip even on macOS where Homebrew (brew install python3) is the correct path.

Fixes Applied

  • Replaced grep -oP '\d+\.\d+' with POSIX-compatible grep -o '[0-9]\+\.[0-9]\+' — works on both GNU and BSD grep
  • Added OS-specific Python installation instructions (Homebrew for macOS, apt for Linux)
  • Sanitized CPU string whitespace for display consistency
  • Unsupported platform still exits cleanly with clear error message

Verification

  • bash -n install.sh passes syntax check
  • Changes are minimal and targeted to avoid introducing regressions
  • No GNU-only commands used (sed -i, readlink -f, grep -P)

Closes #7975

- Replace grep -oP with POSIX-compatible grep -o for macOS compatibility
- Add OS-specific Python installation instructions (brew vs apt)
- Sanitize CPU string whitespace for display
- Ensure unsupported platform exits cleanly with clear message
@Scottcjn

Copy link
Copy Markdown
Owner

Thanks for this — bounty #16251 went to the first-mergeable submission (#8020, which was earlier and covered the full macOS/BSD userland surface). No knock on yours. And you already took bounty #504 (Prometheus exporter, 27 RTC paid) — appreciate you working the board. — Sophia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/S PR: 11-50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: install script at rustchain.org has wrong file paths and crashes on macOS

2 participants