From f58645bff6077126fc4a0ca12697622f0720371f Mon Sep 17 00:00:00 2001 From: Florian Weikert Date: Mon, 6 Feb 2023 16:43:17 +0100 Subject: [PATCH 1/2] Fix MacOS version detection https://github.com/bazelbuild/continuous-integration/pull/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. --- buildkite/bazelci.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py index 104187f739..243d63fce5 100755 --- a/buildkite/bazelci.py +++ b/buildkite/bazelci.py @@ -56,8 +56,8 @@ BUILDKITE_ORG ] -SCRIPT_URL = "https://raw.githubusercontent.com/bazelbuild/continuous-integration/{}/buildkite/bazelci.py?{}".format( - GITHUB_BRANCH, int(time.time()) +SCRIPT_URL = "https://raw.githubusercontent.com/fweikert/continuous-integration/xcode/buildkite/bazelci.py?{}".format( + int(time.time()) ) AGGREGATE_INCOMPATIBLE_TEST_RESULT_URL = "https://raw.githubusercontent.com/bazelbuild/continuous-integration/{}/buildkite/aggregate_incompatible_flags_test_result.py?{}".format( @@ -1444,7 +1444,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 From 151fc767d856359dad89c213bc5856d53bb692c2 Mon Sep 17 00:00:00 2001 From: Florian Weikert Date: Mon, 6 Feb 2023 22:40:12 +0100 Subject: [PATCH 2/2] Restore original SCRIPT_URL --- buildkite/bazelci.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py index 243d63fce5..1ae7506dc8 100755 --- a/buildkite/bazelci.py +++ b/buildkite/bazelci.py @@ -56,8 +56,8 @@ BUILDKITE_ORG ] -SCRIPT_URL = "https://raw.githubusercontent.com/fweikert/continuous-integration/xcode/buildkite/bazelci.py?{}".format( - int(time.time()) +SCRIPT_URL = "https://raw.githubusercontent.com/bazelbuild/continuous-integration/{}/buildkite/bazelci.py?{}".format( + GITHUB_BRANCH, int(time.time()) ) AGGREGATE_INCOMPATIBLE_TEST_RESULT_URL = "https://raw.githubusercontent.com/bazelbuild/continuous-integration/{}/buildkite/aggregate_incompatible_flags_test_result.py?{}".format(