Skip to content

fix: Install base packages on macOS via Homebrew too#197

Merged
Aradhya-Tripathi merged 5 commits into
mainfrom
feat/install-sh-macos-brew-support
Jul 14, 2026
Merged

fix: Install base packages on macOS via Homebrew too#197
Aradhya-Tripathi merged 5 commits into
mainfrom
feat/install-sh-macos-brew-support

Conversation

@Aradhya-Tripathi

@Aradhya-Tripathi Aradhya-Tripathi commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • macOS now installs base tools, MariaDB, PostgreSQL and Node through Homebrew, using the same code path as apt/dnf/pacman (instead of skipping macOS entirely).
  • Installs Homebrew itself if it's missing.
  • Asks for a sudo password when needed, instead of assuming it's already cached.
  • Fixed: curl is now installed before anything tries to use it.
  • Fixed: a failed download no longer silently continues.
  • Package lists are only refreshed once per run instead of multiple times.

Test plan

  • uv run --extra test --extra admin pytest tests/ -q (835 passed)
  • sh -n install.sh

Fold the macOS path into the same pkg_update/pkg_install/pkg_installed
case-switches apt/dnf/pacman already use, so it installs git, python3,
MariaDB, PostgreSQL and Node up front instead of leaving everything to
the runtime's lazy brew installs (which assume brew already exists).
Also makes run_sudo prompt for a sudo password itself via /dev/tty when
one is needed and --sudo-password wasn't passed, since piping this
script through curl | sh leaves stdin occupied by the script itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge; changes are confined to install.sh and the macOS path is isolated from all other distro flows.

The macOS additions are well-scoped: ensure_homebrew guards every brew call, pkg_update/pkg_install/pkg_installed are consistent, and the subshell-exit bug from prior review threads is now correctly fixed with || exit 1 at both call sites. No new logic bugs were found.

install.sh — the ensure_homebrew and run_sudo /dev/tty prompting paths are the only novel flows.

Reviews (5): Last reviewed commit: "fix: install.sh installs curl before any..." | Re-trigger Greptile

Comment thread install.sh
Comment thread install.sh
Aradhya-Tripathi and others added 2 commits July 14, 2026 15:52
Extract the MariaDB apt repo setup into add_distro_repos(), called
before the single pkg_update() in bootstrap() so one apt-get update
picks up both the base indices and the new repo, instead of a second
one buried inside install_database_engines(). bootstrap()'s call
sequence now reads top-to-bottom as the actual order of operations.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
bootstrap_needed() is now platform-aware (checks for brew on macOS
instead of curl/bash/sudo, which macOS always ships), so bootstrap()
no longer needs a separate "DISTRO != macos" branch — every platform
goes through the same root/non-root, tool-missing gate.

ensure_homebrew() also primes the sudo timestamp cache via run_sudo
before invoking Homebrew's installer, so a --sudo-password passed to
this script covers the installer's own internal sudo calls (needed on
Intel Macs for initial /usr/local setup) instead of prompting again on
a /dev/tty our wrapper doesn't control.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread install.sh
Aradhya-Tripathi and others added 2 commits July 14, 2026 16:05
tmp="$(download_installer "$url")" relies on set -e to abort the script
when the download is invalid, but command substitution's exit status
propagating through -e is inconsistent across shells/contexts. Add an
explicit || exit 1 at both call sites so a bad download can't silently
fall through as an empty $tmp.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
add_distro_repos() (MariaDB apt repo) and later NodeSource/Homebrew
setup all go through fetch_and_run_as_root, which needs curl — but
curl was only installed later, as part of bootstrap_packages(). Add
ensure_curl(), run first in bootstrap(), so a bare image without curl
doesn't fail on the very first download.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Aradhya-Tripathi Aradhya-Tripathi changed the title install.sh: install base packages on macOS via Homebrew too fix: Install base packages on macOS via Homebrew too Jul 14, 2026
@Aradhya-Tripathi
Aradhya-Tripathi merged commit 5fa58a7 into main Jul 14, 2026
9 of 10 checks passed
amitascra pushed a commit to amitascra/bench-cli that referenced this pull request Jul 16, 2026
Adds scripts/smoke_install_macos.sh and a smoke-macos job in
install-smoke.yml, running on macos-14 directly (no container runtime
available for macOS, unlike the Linux distro matrix) since the macOS
path (PR frappe#197) has no CI coverage yet — it installs Homebrew, git,
python3, MariaDB, PostgreSQL and Node for real, then asserts bench,
the admin venv, node and git are all in place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tanmoysrt pushed a commit to tanmoysrt/bench-cli that referenced this pull request Jul 18, 2026
…support

fix: Install base packages on macOS via Homebrew too
tanmoysrt pushed a commit to tanmoysrt/bench-cli that referenced this pull request Jul 18, 2026
Adds scripts/smoke_install_macos.sh and a smoke-macos job in
install-smoke.yml, running on macos-14 directly (no container runtime
available for macOS, unlike the Linux distro matrix) since the macOS
path (PR frappe#197) has no CI coverage yet — it installs Homebrew, git,
python3, MariaDB, PostgreSQL and Node for real, then asserts bench,
the admin venv, node and git are all in place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tanmoysrt
tanmoysrt deleted the feat/install-sh-macos-brew-support branch July 19, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant