fix(build): ensure Homebrew path includes on Apple Silicon for cmake#67
fix(build): ensure Homebrew path includes on Apple Silicon for cmake#67
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the root build script to reliably locate Homebrew-installed tooling (notably cmake/brew) on Apple Silicon by ensuring common Homebrew install locations are present in the script’s PATH.
Changes:
- Prepend
/opt/homebrew/binand/usr/local/bintoPATHat the start ofbuild.sh.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" | ||
|
|
There was a problem hiding this comment.
Prepending /opt/homebrew/bin and /usr/local/bin to PATH globally can unintentionally change which swift/cmake/etc. binaries are used if the user already has custom toolchains in their existing $PATH. Consider only adding the Homebrew paths when brew/cmake aren’t found, and/or only adding directories that exist and aren’t already present in PATH (optionally include .../sbin).
Fixes #63.
The
build.shscript natively struggled to resolvecmakeandbrewvia Homebrew on Apple Silicon Macs when triggered via specific shells because/opt/homebrew/binwas not injected into the$PATHautomatically. This applies a robust fix directly into the shell context.(Note: The other root cause of Issue #63 regarding the GLM 5.1 code leakage throwing inconsistent compilation errors has already been resolved natively down the dependency tree by reverting the branch and re-aligning the clean
SwiftLMsubmodules inmain.)