rocm_configure: grep should always exit with 0
Remote Execution can only cache commands that exit with 0. PiperOrigin-RevId: 294623025 Change-Id: I4f6cec67c297c29538e7cfdee18f42dc63d99453
This commit is contained in:
parent
c7c81653d4
commit
3ee8fe8150
9
third_party/gpus/rocm_configure.bzl
vendored
9
third_party/gpus/rocm_configure.bzl
vendored
@ -23,6 +23,7 @@ load(
|
|||||||
"//third_party/remote_config:common.bzl",
|
"//third_party/remote_config:common.bzl",
|
||||||
"execute",
|
"execute",
|
||||||
"files_exist",
|
"files_exist",
|
||||||
|
"get_bash_bin",
|
||||||
"get_cpu_value",
|
"get_cpu_value",
|
||||||
"raw_exec",
|
"raw_exec",
|
||||||
"realpath",
|
"realpath",
|
||||||
@ -328,11 +329,9 @@ def _hipcc_is_hipclang(repository_ctx, rocm_config):
|
|||||||
return "True"
|
return "True"
|
||||||
|
|
||||||
# grep for "HIP_COMPILER=clang" in /opt/rocm/hip/lib/.hipInfo
|
# grep for "HIP_COMPILER=clang" in /opt/rocm/hip/lib/.hipInfo
|
||||||
grep_result = execute(
|
cmd = "grep HIP_COMPILER=clang %s/hip/lib/.hipInfo || true" % rocm_config.rocm_toolkit_path
|
||||||
repository_ctx,
|
bash_bin = get_bash_bin(repository_ctx)
|
||||||
["grep", "HIP_COMPILER=clang", rocm_config.rocm_toolkit_path + "/hip/lib/.hipInfo"],
|
grep_result = execute(repository_ctx, [bash_bin, "-c", cmd], empty_stdout_fine = True)
|
||||||
empty_stdout_fine = True,
|
|
||||||
)
|
|
||||||
result = grep_result.stdout.strip()
|
result = grep_result.stdout.strip()
|
||||||
if result == "HIP_COMPILER=clang":
|
if result == "HIP_COMPILER=clang":
|
||||||
return "True"
|
return "True"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user