Repository navigation
Conversation
On a self-hosted macOS runner the Homebrew prefix can be owned by a different user than the one running CI. When a Homebrew upgrade of a protobuf dependency (abseil) left the installed protoc unable to load its dylib, check_protoc correctly reported it unusable, and the script then ran `brew install protobuf`, which fails with "Cellar is not writable". Every CI job failed at "Setup dependencies" until someone repaired Homebrew by hand. Make the macOS path self-healing: when protoc is missing or broken, unpack the pinned protoc release into a version-named directory under $HOME (no brew, no sudo), put it first on PATH for the rest of the script, and export it via GITHUB_PATH. A working protoc already on PATH is left alone, and an existing pinned install is reused. Release downloads are now verified against SHA-256 values pinned in the script and fetched with `curl -f`, via a helper shared with the Linux branch. The Linux install destination is unchanged. This mirrors the same change in indextables_spark so the two setup scripts stay in step.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
GitHub reported this branch as conflicting with main, but the merge of current main applies cleanly: main's new commits change CI workflows and Dependabot configuration and do not touch scripts/setup.sh, which stays exactly as on this branch.
Automated review: PASSCommit Summary: Findings (2)
Produced from the diff alone by an automated reviewer. Text in code formatting is reviewer output shown as data. A pass is advisory: it does not replace CI or human review. |
Problem
scripts/setup.shranbrew install protobufon macOS whenevercheck_protocfailed. On the self-hosted macOS ARM64 runner the Homebrew prefix is owned by a different user than the one running CI, so that fails with "Cellar is not writable" and the "Setup dependencies" step fails for every job.The trigger on 2026-10-05 was a Homebrew upgrade of
abseilthat left the installedprotobufunable to load its dylib.protocexits with a dyld "Library not loaded" error,check_protoccorrectly treats that as missing, and the script then falls into the brew path it cannot complete.Change
Same fix as indextables/indextables_spark#405, adapted to this file.
install_protoc_macos. A workingprotocon PATH is left alone. Otherwise the pinned GitHub release (PROTOC_VERSION, already 25.5 for Linux) is unpacked,bin/andinclude/together, into$HOME/.local/share/indextables/protoc-<version>with no brew and no sudo. Itsbindir is prepended to PATH so it wins over a broken copy earlier on PATH, and appended to$GITHUB_PATHwhen set so later workflow steps see it. An existing pinned install is reused on later runs. Extraction goes to a staging dir and is renamed into place, so an interrupted run never leaves a half-unpacked dir that looks installed.download_protoc <asset> <dest>usescurl -fsSL --retry 3and verifies the zip against a SHA-256 pinned per release asset (protoc_expected_sha256) before unzipping.curl -fand checksum verification. Install destination (/usr/local) is unchanged.The four SHA-256 values were recomputed from the v25.5 release assets and match the ones pinned in indextables_spark.
Testing
Run with macOS
/bin/bash3.2.57, loading only the function definitions withHOMEpointed at a scratch directory (the full script was not run):bash -n scripts/setup.shpasses.protocfirst on PATH (prints a dyld "Library not loaded" error, exits non-zero): pinned protoc is installed under the scratch HOME,protoc --versionthen resolves to it and printslibprotoc 25.5,include/google/protobufis present, the bin dir is appended to theGITHUB_PATHfile, and no staging or temp dirs are left behind.curlthat fails if called: reuse path taken, no download,GITHUB_PATHappended again.protocon PATH: reported as already installed, nothing created under HOME,GITHUB_PATHuntouched.download_protoc linux-x86_64: downloads, verifies, and unpacks an ELF x86-64protocplusinclude/.Not covered locally: the Linux branch of
install_linuxend to end (only the shared helper it now calls), and the osx-x86_64 / linux-aarch_64 downloads through the script (their checksums were verified against the release assets directly). The macOS CI job on this PR exercises the real runner.