Skip to content

Commit 4bd481e

Browse files
authored
Revert "Switch bazel default spawn strategy to sandboxed (#9168)"
This reverts commit a9ba21c.
1 parent 6e3f407 commit 4bd481e

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

.bazelrc

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,26 @@ build --config=short_logs
2727
# PyTorch/XLA uses exceptions to communicate with Python.
2828
build --copt=-fexceptions
2929

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:
3642
#
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'
4450
#
4551
# The sandbox mode requires all source files to be readable by others, as
4652
# inside the docker we build PyTorch/XLA as root, not the original user who
@@ -51,16 +57,7 @@ build --copt=-fexceptions
5157
# execute permission to directories, and to files only if they already have
5258
# execute permission for the owner (or group or others). This is generally
5359
# 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
6461

6562
###########################################################################
6663

0 commit comments

Comments
 (0)