Skip to content

Commit 64227f1

Browse files
Set absolute compiler path for hermetic CUDA repository.
Addressed the bug pytorch/xla#8577. PiperOrigin-RevId: 721838742
1 parent bbd9127 commit 64227f1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

third_party/gpus/cuda/hermetic/cuda_configure.bzl

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ load(
2929
"//third_party/remote_config:common.bzl",
3030
"get_cpu_value",
3131
"get_host_environ",
32+
"realpath",
3233
"which",
3334
)
3435

@@ -47,7 +48,7 @@ def _find_cc(repository_ctx):
4748
print(("Cannot find {}, either correct your path," +
4849
" or set the CLANG_CUDA_COMPILER_PATH or CC" +
4950
" environment variables").format(cc_name)) # buildifier: disable=print
50-
return cc
51+
return None if not cc else realpath(repository_ctx, cc)
5152

5253
def _auto_configure_fail(msg):
5354
"""Output failure message when cuda configuration fails."""

third_party/xla/third_party/tsl/third_party/gpus/cuda/hermetic/cuda_configure.bzl

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ load(
2929
"//third_party/remote_config:common.bzl",
3030
"get_cpu_value",
3131
"get_host_environ",
32+
"realpath",
3233
"which",
3334
)
3435

@@ -47,7 +48,7 @@ def _find_cc(repository_ctx):
4748
print(("Cannot find {}, either correct your path," +
4849
" or set the CLANG_CUDA_COMPILER_PATH or CC" +
4950
" environment variables").format(cc_name)) # buildifier: disable=print
50-
return cc
51+
return None if not cc else realpath(repository_ctx, cc)
5152

5253
def _auto_configure_fail(msg):
5354
"""Output failure message when cuda configuration fails."""

0 commit comments

Comments
 (0)