Skip to content

Commit

Permalink
Fix MacOS version detection (#1546)
Browse files Browse the repository at this point in the history
#1542 relied on
platform.mac_ver() to detect the MacOS version, which did not work as
expected. Consequently, the previous PR led the CI to activate an
incorrect version of Xcode. This behavior has been fixed by this change.

Related to #1431.

Users can still request a specific Xcode version in their CI config.
  • Loading branch information
fweikert authored Feb 7, 2023
1 parent bc8796f commit 9e34259
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion buildkite/bazelci.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,8 @@ def execute_commands(


def get_default_xcode_version():
macos, _, _ = platform_module.mac_ver()
# Cannot use platform.mac_ver() since it returns 10.16 on both 12.x and 13.x
macos = execute_command_and_get_output(["sw_vers", "-productVersion"], print_output=False)
major = int(macos.split(".")[0])
return DEFAULT_XCODE_VERSION_PER_OS.get(major, "13.0") # we use 13.0 due to legacy reasons

Expand Down

0 comments on commit 9e34259

Please sign in to comment.