Skip to content

Commit 7046045

Browse files
committed
fix: brew fix in cmake-vcpkg.sh
1 parent 5eab84f commit 7046045

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

ci/kokoro/macos/builds/cmake-vcpkg.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ source module ci/etc/integration-tests-config.sh
2121
source module ci/lib/io.sh
2222
source module ci/kokoro/lib/vcpkg.sh
2323

24+
# ===== START HOMEBREW FIXES =====
25+
echo "== Attempting to fix Homebrew environment IN cmake-vcpkg.sh"
26+
27+
# 1. Fix Git Origins as suggested by brew doctor
28+
echo "== DEBUG: Setting Homebrew git origins"
29+
git -C "/usr/local/Homebrew" remote set-url origin https://github.com/Homebrew/brew || echo "Failed to set Homebrew origin"
30+
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" remote set-url origin https://github.com/Homebrew/homebrew-core || echo "Failed to set homebrew-core origin"
31+
32+
# 2. Untap unnecessary taps as suggested by brew doctor
33+
echo "== DEBUG: Untapping unnecessary taps"
34+
brew untap homebrew/cask --force || echo "Failed to untap homebrew/cask"
35+
brew untap homebrew/core --force || echo "Failed to untap homebrew/core"
36+
brew untap homebrew/cask-versions --force || echo "Failed to untap homebrew/cask-versions"
37+
38+
# 3. Clean up broken symlinks and scrub the cache
39+
echo "== DEBUG: Cleaning up Homebrew"
40+
brew cleanup -s || echo "brew cleanup failed"
41+
42+
# 4. Forcefully reset Homebrew
43+
echo "== DEBUG: Running brew update-reset"
44+
brew update-reset
45+
46+
echo "== DEBUG: Homebrew environment fixes complete IN cmake-vcpkg.sh"
47+
# ===== END HOMEBREW FIXES =====
48+
2449
readonly SOURCE_DIR="."
2550
readonly BINARY_DIR="cmake-out/macos-vcpkg"
2651

0 commit comments

Comments
 (0)