fix: a fresh Mac installs Homebrew before the brew stage

core/brew was `-builtin` on Darwin, and builtin runs after install_brew, so a
Mac without Homebrew failed every brew row "brew missing" and needed a second
run. It is a script row on both platforms now. The apt prerequisite line is
guarded to apt platforms, and on macOS `sudo -v` caches the timestamp that
NONINTERACTIVE=1 Homebrew requires. Darwin dispatch-order test via the fake
uname, plus a mutation (G-boot-1).
This commit is contained in:
bcherb2 committed 2026-11-18 02:12:55 -05:00
1 parent 6fa7603633
commit 91a1224a5e
4 files changed
+51 -6

No files matched your search

+17 -5
View File
@@ -967,11 +967,23 @@ install_bespoke() {
note_fail "$key" "Homebrew refuses to install as root — run dotup as your own user"
continue
fi
# The installer's own documented prerequisites. git is already here,
# since the public tier cannot apply without it; the rest are not.
apt_update_once
run_sh "${SUDO:+$SUDO }DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential procps curl file git" \
|| warn "could not install Homebrew's build prerequisites"
if [ "$PLAT" = apt ]; then
# The installer's own documented prerequisites. git is already
# here, since the public tier cannot apply without it; the rest
# are not. A Mac has no apt: its prerequisite is the CLT, which
# the git check before apply already insisted on.
apt_update_once
run_sh "${SUDO:+$SUDO }DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential procps curl file git" \
|| warn "could not install Homebrew's build prerequisites"
else
# On macOS, NONINTERACTIVE=1 makes Homebrew's installer demand
# sudo WITHOUT a prompt: with no cached timestamp it aborts, and
# every brew row after it fails "brew missing". Ask for the
# password here, where a person can still type it. With nobody
# at the keyboard `sudo -v` fails and this says why.
run_sh "sudo -v" \
|| { note_fail "$key" "Homebrew on macOS needs an administrator password (sudo -v failed)"; continue; }
fi
run_sh "NONINTERACTIVE=1 /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"" \
|| { note_fail "$key" "the Homebrew installer failed"; continue; }
# install_brew resolves through find_tool, which probes the linuxbrew
+1 -1
View File
@@ -75,7 +75,7 @@ core gh safe gh gh
core chezmoi safe -script chezmoi bootstrap cannot come from the manifest
core go safe -tarball go /usr/local/go on linux
core uv safe -script uv astral installer to ~/.local/bin
core brew safe -script -builtin linuxbrew — the only source for lazygit, omp and herdr
core brew safe -script -script linuxbrew — the only source for lazygit, omp and herdr
core node safe -tarball node apt ships 18.19 and the npm rows below need 20+ — tarball to /opt/node
core imagemagick safe imagemagick imagemagick required by the nvim markdown render path
core mermaid-cli safe -npm -npm mmdc — nvim renders mermaid fences with it
Can't render this file because it contains an unexpected character in line 17 and column 49.