fix(native): use host Homebrew (read-only) instead of empty per-job prefix#99
Merged
Merged
Conversation
…refix Native macOS jobs were given a per-job Homebrew prefix (HOMEBREW_PREFIX=<jobDir>/homebrew) with an empty Cellar, and only the host's brew *binaries* were symlinked into PATH — not the formula metadata. So `brew list`-style checks (e.g. `spc doctor`, which php-sdk's macOS build runs) queried the empty per-job Cellar, concluded nothing was installed, and tried to (re)install formulae the host already had — which then failed because the sandbox denies writes to /opt/homebrew. Point HOMEBREW_PREFIX/HOMEBREW_CELLAR at the host's real /opt/homebrew instead. Jobs now SEE the host's installed formulae (so tool checks pass) but still cannot mutate them (the sandbox write-deny stays), which is how a normal shared macOS runner behaves. Drops the now-pointless per-job homebrew dir + symlink step. Verified: a php-sdk macOS SDK build now runs green end-to-end on the native path (spc doctor / LLVM / build libphp.a / package / upload), where it previously failed at deps setup. Note: this makes the host's Homebrew the source of truth for native build tooling — deps must be installed AND kept current on the host, since jobs can't `brew install`/upgrade. Follow-up: a host-provisioning dep list + periodic `brew upgrade` so upstream formula bumps don't regress builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ChVRC9ZrvQarrctDwSy1S5
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
php-sdk's macОS build failed on the native path at "Install Homebrew + build deps via spc doctor". Root cause: native jobs got a per-job
HOMEBREW_PREFIX=<jobDir>/homebrewwith an empty Cellar — only the host's brew binaries were symlinked into PATH, not the formula metadata.So
spc doctor(which queries Homebrew) saw the empty per-job Cellar, decided pkg-config/etc. weren't installed, and tried to install them — which failed because the sandbox correctly denies writes to/opt/homebrew. It reported this as a misleading "Download … failed. Please check your internet connection" (the network was fine).Fix
Point
HOMEBREW_PREFIX/HOMEBREW_CELLARat the host's real/opt/homebrew. Jobs now see the host's installed formulae (tool checks pass) but still cannot mutate them (sandbox write-deny unchanged) — exactly how a normal shared macОS runner behaves. Removes the now-pointless per-job homebrew dir + symlink step.Verified live
A php-sdk macОS SDK build now runs green end-to-end on native (spc doctor ✓, LLVM ✓, build libphp.a ✓, package ✓, upload ✓), driven by a real webhook, where it previously died at deps setup.
Trade-off / follow-up
This makes the host's Homebrew the source of truth for native build tooling — deps must be installed and kept current on the host, since jobs can't
brew install/upgrade (write-denied). When Homebrew bumps a formula upstream, the host goes "outdated" and a job'sbrew install Xwill attempt an upgrade and fail. Follow-up: a host-provisioning dep list (autoconf automake libtool bison re2c cmake ninja llvm …) + periodicbrew upgrade, and likely an arch-doc note revisiting the per-job-Homebrew decision.🤖 Generated with Claude Code