Skip to content

Commit

Permalink
Increase timeouts for macOS toolchain setup
Browse files Browse the repository at this point in the history
This switches all macOS toolchain setup compiles and executes to use the
default timeout of 600s. This should help avoid issues on GitHub actions
where these timeout and cause build failures. The common case shouldn't
really be affected.

bazelbuild#17437
  • Loading branch information
keith committed Feb 16, 2023
1 parent 004c73c commit 64170ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tools/cpp/osx_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _compile_cc_file_single_arch(repository_ctx, src_name, out_name):
"-o",
out_name,
src_name,
], 60)
])
if (xcrun_result.return_code != 0):
error_msg = (
"return code {code}, stderr: {err}, stdout: {out}"
Expand Down Expand Up @@ -107,7 +107,7 @@ def _compile_cc_file(repository_ctx, src_name, out_name):
"-o",
out_name,
src_name,
], 60)
])

if xcrun_result.return_code == 0:
xcrun_result = repository_ctx.execute([
Expand All @@ -120,7 +120,7 @@ def _compile_cc_file(repository_ctx, src_name, out_name):
"--sign",
"-",
out_name,
], 60)
])
if xcrun_result.return_code != 0:
error_msg = (
"codesign return code {code}, stderr: {err}, stdout: {out}"
Expand Down
10 changes: 3 additions & 7 deletions tools/osx/xcode_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
installed on the local host.
"""

_EXECUTE_TIMEOUT = 120

def _search_string(fullstring, prefix, suffix):
"""Returns the substring between two given substrings of a larger string.
Expand Down Expand Up @@ -55,8 +53,7 @@ def _xcode_version_output(repository_ctx, name, version, aliases, developer_dir)
repository_ctx.report_progress("Fetching SDK information for Xcode %s" % version)
xcodebuild_result = repository_ctx.execute(
["xcrun", "xcodebuild", "-version", "-sdk"],
_EXECUTE_TIMEOUT,
{"DEVELOPER_DIR": developer_dir},
environment = {"DEVELOPER_DIR": developer_dir},
)
if (xcodebuild_result.return_code != 0):
error_msg = (
Expand Down Expand Up @@ -135,7 +132,7 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
"-o",
"xcode-locator-bin",
xcodeloc_src_path,
], _EXECUTE_TIMEOUT)
])

if (xcrun_result.return_code != 0):
suggestion = ""
Expand All @@ -156,7 +153,6 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
repository_ctx.report_progress("Running xcode-locator")
xcode_locator_result = repository_ctx.execute(
["./xcode-locator-bin", "-v"],
_EXECUTE_TIMEOUT,
)
if (xcode_locator_result.return_code != 0):
error_msg = (
Expand Down Expand Up @@ -195,7 +191,7 @@ def _darwin_build_file(repository_ctx):
"xcrun",
"xcodebuild",
"-version",
], _EXECUTE_TIMEOUT)
])

(toolchains, xcodeloc_err) = run_xcode_locator(
repository_ctx,
Expand Down

0 comments on commit 64170ff

Please sign in to comment.