Skip to content

Commit 0764a5c

Browse files
authored
Fix macOS CI: trust microsoft/mssql-release tap for Homebrew 5.2+ (#4363)
* Fix macOS CI: trust microsoft/mssql-release tap for Homebrew 5.2+ Homebrew 5.2.0 made untrusted-tap enforcement the default. After 'brew update' pulls in the new version, 'brew install mssql-tools18' is refused because the microsoft/mssql-release tap is untrusted. This caused sqlcmd to never be installed (exit code 127), so the SQL Server connectivity check looped for 72 attempts and failed. Add 'brew trust microsoft/mssql-release' after tapping and before 'brew update' to explicitly trust the Microsoft tap. * Address PR #4363 review feedback - Move 'brew trust' after 'brew update' so it works even when the runner image starts with a Homebrew version older than 5.2. - Add a fail-fast check after 'brew install mssql-tools18' to immediately abort with a clear error if sqlcmd is not on PATH, avoiding the 6-minute timeout loop.
1 parent ef60122 commit 0764a5c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

eng/pipelines/common/templates/steps/configure-sql-server-macos-step.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,19 @@ steps:
3434
brew install docker
3535
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
3636
brew update
37+
# Homebrew 5.2+ requires explicit trust for third-party taps. Run this
38+
# after 'brew update' so the trust command is available even if the runner
39+
# image shipped an older Homebrew version.
40+
brew trust microsoft/mssql-release
3741
HOMEBREW_ACCEPT_EULA=Y brew install mssql-tools18
3842
43+
# Fail fast if sqlcmd was not installed (e.g. tap-trust or formula error).
44+
# Without this check the script would loop for ~6 minutes trying to connect.
45+
if ! command -v sqlcmd &>/dev/null; then
46+
echo "ERROR: sqlcmd is not on PATH after brew install. Check the mssql-tools18 installation above."
47+
exit 1
48+
fi
49+
3950
# Start Colima with Virtualization.framework for x86_64 binary translation
4051
# on Apple Silicon. Rosetta/binfmt emulation is enabled by default in
4152
# Colima >= 0.8 when using --vm-type vz, which is dramatically faster than

0 commit comments

Comments
 (0)