@@ -27,20 +27,26 @@ build --config=short_logs
27
27
# PyTorch/XLA uses exceptions to communicate with Python.
28
28
build --copt=-fexceptions
29
29
30
- # Why we use the sandbox mode:
31
- #
32
- # 1. it's a good practice that enforces explicit dependency declarations
33
- # (see https://bazel.build/docs/user-manual#spawn-strategy).
34
- # 2. clang requires the sandbox mode. Without this, `bazel build` generates an
35
- # error like:
30
+ # Force GCC because clang/bazel has issues.
31
+ build --action_env=CC=gcc
32
+ build --action_env=CXX=g++
33
+ build --spawn_strategy=standalone
34
+
35
+ ###########################################################################
36
+
37
+ build:clang --action_env=CC=/usr/bin/clang-17
38
+ build:clang --action_env=CXX=/usr/bin/clang++-17
39
+
40
+ # clang requires the sandbox mode. Without this, `bazel build` generates an
41
+ # error like:
36
42
#
37
- # ERROR: .../external/llvm-project/llvm/BUILD.bazel:2006:11: Compiling
38
- # llvm/lib/CodeGenTypes/LowLevelType.cpp failed: undeclared inclusion(s) in
39
- # rule '@llvm-project//llvm:CodeGenTypes':
40
- # this rule is missing dependency declarations for the following files
41
- # included by 'llvm/lib/CodeGenTypes/LowLevelType.cpp':
42
- # 'bazel-out/k8-opt/bin/external/llvm-project/llvm/config.cppmap'
43
- # 'bazel-out/k8-opt/bin/external/llvm-project/llvm/Demangle.cppmap'
43
+ # ERROR: .../external/llvm-project/llvm/BUILD.bazel:2006:11: Compiling
44
+ # llvm/lib/CodeGenTypes/LowLevelType.cpp failed: undeclared inclusion(s) in
45
+ # rule '@llvm-project//llvm:CodeGenTypes':
46
+ # this rule is missing dependency declarations for the following files
47
+ # included by 'llvm/lib/CodeGenTypes/LowLevelType.cpp':
48
+ # 'bazel-out/k8-opt/bin/external/llvm-project/llvm/config.cppmap'
49
+ # 'bazel-out/k8-opt/bin/external/llvm-project/llvm/Demangle.cppmap'
44
50
#
45
51
# The sandbox mode requires all source files to be readable by others, as
46
52
# inside the docker we build PyTorch/XLA as root, not the original user who
@@ -51,16 +57,7 @@ build --copt=-fexceptions
51
57
# execute permission to directories, and to files only if they already have
52
58
# execute permission for the owner (or group or others). This is generally
53
59
# safer than o+rx.
54
- build --spawn_strategy=sandboxed
55
-
56
- # Use GCC for C/C++ compilation.
57
- build --action_env=CC=gcc
58
- build --action_env=CXX=g++
59
-
60
- ###########################################################################
61
-
62
- build:clang --action_env=CC=/usr/bin/clang-17
63
- build:clang --action_env=CXX=/usr/bin/clang++-17
60
+ build:clang --spawn_strategy=sandboxed
64
61
65
62
###########################################################################
66
63
0 commit comments