Extend process timeouts in xcode_configure.bzl
With the existing timeouts the processes would occasionally fail on slow machines, causing unnecessary breakages. This new timeout showed no timeout failures in testing.
RELNOTES: None
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.
@@ -52,7 +54,7 @@ def _xcode_version_output(repository_ctx, name, version, aliases, developer_dir)
decorated_aliases.append("'%s'" % alias)
xcodebuild_result = repository_ctx.execute(
["xcrun", "xcodebuild", "-version", "-sdk"],
- 30,
+ _EXECUTE_TIMEOUT,
{"DEVELOPER_DIR": developer_dir},
)
if (xcodebuild_result.return_code != 0):
@@ -129,7 +131,7 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
"-o",
"xcode-locator-bin",
xcodeloc_src_path,
- ], 30)
+ ], _EXECUTE_TIMEOUT)
if (xcrun_result.return_code != 0):
suggestion = ""
@@ -147,7 +149,10 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
)
return ([], error_msg.replace("\n", " "))
- xcode_locator_result = repository_ctx.execute(["./xcode-locator-bin", "-v"], 30)
+ xcode_locator_result = repository_ctx.execute(
+ ["./xcode-locator-bin", "-v"],
+ _EXECUTE_TIMEOUT,
+ )
if (xcode_locator_result.return_code != 0):
error_msg = (
"Invoking xcode-locator failed, " +
@@ -176,7 +181,10 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
def _darwin_build_file(repository_ctx):
"""Evaluates local system state to create xcode_config and xcode_version targets."""
- xcodebuild_result = repository_ctx.execute(["env", "-i", "xcrun", "xcodebuild", "-version"], 30)
+ xcodebuild_result = repository_ctx.execute(
+ ["env", "-i", "xcrun", "xcodebuild", "-version"],
+ _EXECUTE_TIMEOUT,
+ )
# "xcodebuild -version" failing may be indicative of no versions of xcode
# installed, which is an acceptable machine configuration to have for using
