Skip to content

{Packaging} Fix Homebrew test install on older brew by rewriting formula_opt_prefix in test jobs#33647

Merged
YangAn-microsoft merged 1 commit into
Azure:devfrom
YangAn-microsoft:fix/homebrew-formula-opt-prefix-sed
Jun 25, 2026
Merged

{Packaging} Fix Homebrew test install on older brew by rewriting formula_opt_prefix in test jobs#33647
YangAn-microsoft merged 1 commit into
Azure:devfrom
YangAn-microsoft:fix/homebrew-formula-opt-prefix-sed

Conversation

@YangAn-microsoft

Copy link
Copy Markdown
Contributor

Root cause

The upstream homebrew-core azure-cli.rb def install now calls formula_opt_prefix("openssl@3"), a new Homebrew DSL helper (brew utils/path.rb). That helper is missing on the older Homebrew preinstalled on the macOS-14 CI agent image, so brew install fails with a NoMethodError. This was first observed in the batched/nightly CI failure around 2026-06-23.

Fix

Patch the formula only in the macOS test jobs, right before brew install, rewriting the call to the backward-compatible Formula["openssl@3"].opt_prefix form — mirroring the existing no_autobump! sed convention. The generated/submitted homebrew-core formula is intentionally left upstream-faithful (no change to formula_generate.py).

Changed files:

  • azure-pipelines.yml (job TestHomebrewFormula)
  • scripts/release/homebrew/test_homebrew_package.sh

Note

TestHomebrewPackage is currently condition: false (disabled), so only TestHomebrewFormula actively exercises this fix; the shell-script change is preventative for when that job is re-enabled.

Cleanup

A TODO(packaging) marker was added above each shim so it can be removed once the agent image's Homebrew ships formula_opt_prefix.

HISTORY.rst

Intentionally skipped — this is an internal CI/packaging change with no customer-facing behavior.

…ula_opt_prefix in test jobs

The macOS CI jobs fail with NoMethodError undefined method formula_opt_prefix during brew install. Upstream homebrew-core azure-cli.rb now uses the newer formula_opt_prefix DSL helper, absent on the older Homebrew on the macOS-14 agent image.

Following the existing no_autobump convention, patch the formula only in the test jobs right before brew install via sed, rewriting it to the backward-compatible Formula opt_prefix form. The generated and submitted formula stays upstream-faithful.
Copilot AI review requested due to automatic review settings June 25, 2026 02:35
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 25, 2026

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

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @YangAn-microsoft,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 25, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the macOS Homebrew CI test jobs to work around older Homebrew versions that lack the formula_opt_prefix DSL helper, by rewriting that call in the locally tested azure-cli.rb formula just before brew install.

Changes:

  • Add a macOS-CI-only sed rewrite to replace formula_opt_prefix("...") with Formula["..."].opt_prefix prior to installation.
  • Apply the same shim in both the inline TestHomebrewFormula pipeline step and the (currently disabled) TestHomebrewPackage script.
  • Document the workaround with TODO(packaging) comments for future removal.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/release/homebrew/test_homebrew_package.sh Patches the artifact formula in-place before brew install during the package test flow.
azure-pipelines.yml Patches the tapped formula in-place before brew install in the active Homebrew formula test job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yonzhan

yonzhan commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Packaging

@YangAn-microsoft YangAn-microsoft merged commit c440ac9 into Azure:dev Jun 25, 2026
64 checks passed
@YangAn-microsoft YangAn-microsoft deleted the fix/homebrew-formula-opt-prefix-sed branch June 25, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants