Repository navigation
Homebrew cask launcher asks for AZ_PYTHON when the Homebrew prefix is a symlink #34199
Description
Describe the bug
With the new Homebrew cask (brew install --cask azure-cli, 2.91.0), az fails on a Mac where the Homebrew prefix is a symlink (here /opt/homebrew -> /private/.bulk/opt/homebrew, which itself resolves to another volume):
Error: AZ_PYTHON not set.
For offline/tarball installs, set AZ_PYTHON to a Python 3.14 path.
Cause: scripts/release/standalone/templates/az_launcher.sh.in resolves its own path with cd -P (physical), then compares the result against literal prefixes:
if [[ "$SCRIPT_PATH" == /opt/homebrew/Caskroom/* ]] || \
[[ "$SCRIPT_PATH" == /usr/local/Caskroom/* ]] || \
[[ "$SCRIPT_PATH" == /home/linuxbrew/.linuxbrew/Caskroom/* ]]; thenbash -x shows the resolved path is /Volumes/Data/.bulk/opt/homebrew/Caskroom/azure-cli/2.91.0/bin/../libexec/bin/az, so INSTALLER=TARBALL and the launcher demands AZ_PYTHON, even though it is a cask install and python@3.14 is installed. The same happens with any custom Homebrew prefix.
To reproduce
- Make the Homebrew prefix a symlink to another location (for example, a prefix relocated to a second volume).
brew install --cask azure-cliaz version
Expected behavior
The cask install is detected and uses Homebrew's python@3.14, with no AZ_PYTHON needed.
Suggestions
- Detect a cask install by pattern rather than literal prefix, for example
*/Caskroom/azure-cli/*. Or compare against the physical path of$HOMEBREW_PREFIX, orbrew --prefix. - Minor: the first candidate,
opt/python@3.14/libexec/bin/python3, doesn't exist in Homebrew'spython@3.14(itslibexec/binhaspython, notpython3). Detection only works because of thebin/python3.14fallback.
Workaround
export AZ_PYTHON="$HOMEBREW_PREFIX/opt/python@3.14/bin/python3.14"
Environment
- azure-cli 2.91.0, Homebrew cask (Homebrew 7.0.8), macOS 27 on Apple silicon
- Homebrew prefix:
/opt/homebrew, a symlink to/private/.bulk/opt/homebrew
Activity
yonzhan commentedon Oct 9, 2026
Thank you for opening this issue, we will look into it.
x-engineering-agent commentedon Oct 9, 2026
Triage
Duplicate of #34187. Both reports describe Azure CLI 2.91.0 Homebrew cask startup failing with
Error: AZ_PYTHON not set.when the Homebrew prefix resolves through a symlink. The affected launcher, reproduction steps, and expected Homebrew Python behavior match.The launcher template recognizes Homebrew through three hard-coded Caskroom prefixes and otherwise takes the tarball path. A resolved, relocated prefix can miss those checks.
Please track the fix in #34187 and the existing, still-open PR #34196. No separate implementation job is being queued for this duplicate.
Posted by x-engineering-agent (Fixer)
yonzhan commentedon Oct 9, 2026
It is a duplicate of #34187