Skip to content

{CI} Update homebrew to latest version during formula test#31623

Closed
bebound wants to merge 3 commits intoAzure:devfrom
bebound:update-homebrew
Closed

{CI} Update homebrew to latest version during formula test#31623
bebound wants to merge 3 commits intoAzure:devfrom
bebound:update-homebrew

Conversation

@bebound
Copy link
Contributor

@bebound bebound commented Jun 10, 2025

Description

Recently, azure-cli's formula added a new config no_autobump! because: :requires_manual_review, which is only compatible with homebrew>=4.5.4.

echo == Install azure-cli.rb formula ==
brew install --build-from-source $SYSTEM_ARTIFACTSDIRECTORY/homebrew/azure-cli.rb
== Install azure-cli.rb formula ==
Error: azure-cli: 'because' argument should use valid symbol or a string!

Update homebrew to the latest version in test script.

Ref:

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 10, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 10, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 10, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@bebound bebound marked this pull request as ready for review June 11, 2025 06:10
Copilot AI review requested due to automatic review settings June 11, 2025 06:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures the Homebrew CLI is updated to the latest version during the formula test to support the newly added no_autobump! config, which requires Homebrew ≥ 4.5.4.

  • Adds a brew update step before uninstalling the pre-installed azure-cli.
  • Preserves existing Python unlink/link commands and Azure CLI removal.
Comments suppressed due to low confidence (1)

@bebound bebound force-pushed the update-homebrew branch 2 times, most recently from 4080772 to 41d4d0b Compare June 12, 2025 03:32
python_version=3.12
brew unlink python@$python_version && brew link --overwrite python@$python_version
brew unlink python@$3.12 && brew link --overwrite python@$3.12
brew unlink python@3.13 && brew link --overwrite python@3.13
Copy link
Contributor Author

@bebound bebound Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python@3.13 is a dependency of azure-cli:
==> Installing dependencies for azure-cli: libgit2, sqlite, python@3.13, z3, llvm, rust and python@3.12

python@3.13.4 just released, and brew tries to update it. We need to manually overwrite it too.

Dependency chain cryptography -> rust -> z3 -> python@3.13

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a dollar sign in $3.12?

Copy link
Contributor Author

@bebound bebound Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. Weird, the task still succeeds. This line's exit code is 1.

brew unlink python@$3.12 && brew link --overwrite python@$3.12
Error: No such keg: /usr/local/Cellar/python@.12

The && can suppress set -e:

set -e
false && false
echo "wat"

>>> wat

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In false && false, the first false will not cause set -e to fail, and the second false is not executed. true && false will cause set -e to fail.

See

@bebound bebound force-pushed the update-homebrew branch 2 times, most recently from 976d935 to e1c6cb0 Compare June 12, 2025 08:20
python_version=3.12
brew unlink python@$python_version && brew link --overwrite python@$python_version
# Force relink python@3.xx in Homebrew to resolve the conflict with pre-installed python 3.xx on macOS
# See: https://github.com/actions/runner-images/issues/9966
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One year later, the problem remains unresolved. Update the link to the runner-image issue.

@bebound
Copy link
Contributor Author

bebound commented Jun 16, 2025

The agent is using macOS 14 20250609.1326 now, which has homebrew 4.5.4.

Close this PR.

Ref: https://github.com/actions/runner-images/blob/a0e2400abd3bc3584080d24a2cc2807f99de41cd/images/macos/macos-14-Readme.md

@bebound bebound closed this Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot CI CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants