Skip to content

fix(native): use host Homebrew (read-only) instead of empty per-job prefix#99

Merged
ephpm-claude[bot] merged 1 commit into
mainfrom
fix-native-macos-homebrew
Jul 8, 2026
Merged

fix(native): use host Homebrew (read-only) instead of empty per-job prefix#99
ephpm-claude[bot] merged 1 commit into
mainfrom
fix-native-macos-homebrew

Conversation

@ephpm-claude

@ephpm-claude ephpm-claude Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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>/homebrew with 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_CELLAR at 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's brew install X will attempt an upgrade and fail. Follow-up: a host-provisioning dep list (autoconf automake libtool bison re2c cmake ninja llvm …) + periodic brew upgrade, and likely an arch-doc note revisiting the per-job-Homebrew decision.

🤖 Generated with Claude Code

…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
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