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

+22
View File
@@ -492,6 +492,10 @@ is "darwin: claude desktop is the cask" "brew claude" "$(drs apps/cl
is "darwin: signal is the cask" "brew signal" "$(drs apps/signal)"
is "darwin: bun is the tap" "brew oven-sh/bun/bun" "$(drs core/bun)"
is "darwin: incus has no source" "unavailable" "$(drs virt/incus | tr -d ' ')"
# G-boot-1: core/brew was `builtin` here, and builtin runs AFTER the brew stage,
# so a fresh Mac failed every brew row "brew missing" and only then installed
# Homebrew. A script row runs before brew, on both platforms.
is "darwin: homebrew itself is a script row" "script brew" "$(drs core/brew)"
# Nothing in the default set may be unresolvable — that is a manifest bug, and
# it is silent until someone runs the installer on a fresh machine.
@@ -762,6 +766,24 @@ else
printf ' \033[33mskip\033[0m go sits at an absolute path find_tool probes\n'
fi
printf '\n\033[1ma fresh Mac installs Homebrew before the brew stage\033[0m\n'
# The seal's own uname swapped for the fake Mac one: the whole of the run, not
# just resolution, believes it is on Darwin. A dry run, because what matters is
# the ORDER of the commands, and --print shows exactly what a real run executes.
newbox; sh ./seal.sh "$SB/seal" --with sudo >/dev/null
ln -sf "$DARWIN/uname" "$SB/seal/uname"; BOXPATH=$SB/seal
pick core/brew agents/herdr
dry=$(box --print install 2>&1 | plain || true)
is "darwin: the Homebrew installer runs before any brew install" "yes" \
"$(a=$(printf '%s\n' "$dry" | grep -n 'Homebrew/install/HEAD/install.sh' | head -1 | cut -d: -f1)
b=$(printf '%s\n' "$dry" | grep -n 'brew install herdr' | head -1 | cut -d: -f1)
[ -n "$a" ] && [ -n "$b" ] && [ "$a" -lt "$b" ] && echo yes || echo "no [$a/$b]")"
is "darwin: …after asking for sudo, which NONINTERACTIVE cannot" "yes" \
"$(a=$(printf '%s\n' "$dry" | grep -n '+ sudo -v$' | head -1 | cut -d: -f1)
b=$(printf '%s\n' "$dry" | grep -n 'Homebrew/install/HEAD/install.sh' | head -1 | cut -d: -f1)
[ -n "$a" ] && [ -n "$b" ] && [ "$a" -lt "$b" ] && echo yes || echo "no [$a/$b]")"
hasnt "darwin: no apt prerequisites on a machine with no apt" "apt-get" "$dry"
printf '\n\033[1mclaude desktop trusts only Anthropic'"'"'s key\033[0m\n'
# A vendor apt repository is a key apt will trust for root-installed packages,
# so the key is checked against the published fingerprint before it is placed.