Brew acting funky after Mac OSX Monterey upgrade

After upgrading to Monterey, in which bundled python has been deprecated, I started facing weird problems with homebrew aliases git clone.

➜  homebrew-core git:(master) brew install --cask google-cloud-sdk
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 81 formulae.
==> Updated Casks
Updated 51 casks.
==> Deleted Casks
mapture                                                                                    noisytyper                                                                                 openarena

==> Caveats
To install shell completions, add this to your profile:

  for bash users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc"

  for zsh users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"

To add gcloud components to your PATH, add this to your profile:

  for bash users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc"

  for zsh users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"

==> Downloading https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
Already downloaded: /Users/is979y/Library/Caches/Homebrew/downloads/cda39f18c3069c1a4ac0cd5b1d91541af945cd331eba8443c58ec5c890343c0a--google-cloud-sdk.tar.gz
Warning: No checksum defined for cask 'google-cloud-sdk', skipping verification.
Error: python: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/python:1: syntax error, unexpected ..
../Formula/python@3.9.rb
^~
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/python:1: unknown regexp options - pyth
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/python:1: `@3' is not allowed as an instance variable name

To fix it, I had to set git config setting core.symlinks to true, this ensures the aliases git clone can automatically create symlinks rather than plain files.

git config --global core.symlinks true

To cleanup the brew aliases directory, I simply deleted and recreated it by reinstalling the package I wanted to get previously.

rm -fr $(brew --repo homebrew/core)
brew install --cask google-cloud-sdk

Leave a Reply

Your email address will not be published. Required fields are marked *