forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.bazelrc
131 lines (122 loc) · 6.74 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Must be first. Enables build:windows, build:linux, build:macos, build:freebsd, build:openbsd
build --enable_platform_specific_config
###############################################################################
# On Windows, provide: BAZEL_SH, and BAZEL_LLVM (if using clang-cl)
# On all platforms, provide: PYTHON3_BIN_PATH=python
###############################################################################
build --action_env=PATH
# For --compilation_mode=dbg, consider enabling checks in the standard library as well (below).
build --compilation_mode=opt
#build --cxxopt="-std=c++11"
# This workaround is needed to prevent Bazel from compiling the same file twice (once PIC and once not).
build:linux --force_pic
build:macos --force_pic
build:clang-cl --compiler=clang-cl
build:msvc --compiler=msvc-cl
# `LC_ALL` and `LANG` is needed for cpp worker tests, because they will call "ray start".
# If we don't add them, python's `click` library will raise an error.
test --action_env=LC_ALL
test --action_env=LANG
# Allow C++ worker tests to execute "ray start" with the correct version of Python.
test --action_env=VIRTUAL_ENV
test --action_env=PYENV_VIRTUAL_ENV
test --action_env=PYENV_VERSION
test --action_env=PYENV_SHELL
test --action_env=RAY_ENABLE_NEW_SCHEDULER
# This is needed for some core tests to run correctly
test:windows --enable_runfiles
# TODO(mehrdadn): Revert the "-\\.(asm|S)$" exclusion when this Bazel bug
# for compiling assembly files is fixed on Windows:
# https://github.com/bazelbuild/bazel/issues/8924
# Warnings should be errors
build:linux --per_file_copt="-\\.(asm|S)$@-Werror"
build:macos --per_file_copt="-\\.(asm|S)$@-Werror"
build:clang-cl --per_file_copt="-\\.(asm|S)$@-Werror"
build:msvc --per_file_copt="-\\.(asm|S)$@-WX"
# Ignore warnings for protobuf generated files and external projects.
build --per_file_copt="\\.pb\\.cc$@-w"
build --per_file_copt="-\\.(asm|S)$,external/.*@-w"
#build --per_file_copt="external/.*@-Wno-unused-result"
# Ignore minor warnings for host tools, which we generally can't control
build:clang-cl --host_copt="-Wno-inconsistent-missing-override"
build:clang-cl --host_copt="-Wno-microsoft-unqualified-friend"
build:clang-cl --host_copt="-Wno-range-loop-analysis"
# This workaround is needed due to https://github.com/bazelbuild/bazel/issues/4341
build --per_file_copt="-\\.(asm|S)$,external/com_github_grpc_grpc/.*@-DGRPC_BAZEL_BUILD"
# Don't generate warnings about kernel features we don't need https://github.com/ray-project/ray/issues/6832
build:linux --per_file_copt="-\\.(asm|S)$,external/com_github_grpc_grpc/.*@-DGPR_MANYLINUX1"
# Ignore wchar_t -> char conversion warning on MSVC
build:msvc --per_file_copt="external/boost/libs/regex/src/wc_regex_traits\\.cpp@-wd4244"
build --http_timeout_scaling=5.0
build --verbose_failures
build:iwyu --experimental_action_listener=//:iwyu_cpp
# Print relative paths when possible
build:windows --attempt_to_print_relative_paths
# Save disk space by hardlinking cache hits instead of copying
build:windows --experimental_repository_cache_hardlinks
# Clean the environment before building, to make builds more deterministic
build:windows --incompatible_strict_action_env
# For colored output (seems necessary on Windows)
build:windows --color=yes
# For compiler colored output (seems necessary on Windows)
build:clang-cl --per_file_copt="-\\.(asm|S)$@-fansi-escape-codes"
build:clang-cl --per_file_copt="-\\.(asm|S)$@-fcolor-diagnostics"
build:manylinux2010 --copt="-Wno-unused-result"
build:manylinux2010 --linkopt="-lrt"
# Debug build flags. Uncomment in '-c dbg' builds to enable checks in the C++ standard library:
#build:linux --cxxopt="-D_GLIBCXX_DEBUG=1"
#build:linux --cxxopt="-D_GLIBCXX_DEBUG_PEDANTIC=1"
#build:linux --cxxopt="-D_LIBCPP_DEBUG=1"
#build:macos --cxxopt="-D_GLIBCXX_DEBUG=1"
#build:macos --cxxopt="-D_GLIBCXX_DEBUG_PEDANTIC=1"
#build:windows --cxxopt="-D_ITERATOR_DEBUG_LEVEL=2"
# Thread sanitizer configuration:
build:tsan --strip=never
build:tsan --copt -fsanitize=thread
build:tsan --copt -DTHREAD_SANITIZER
build:tsan --copt -g
build:tsan --copt -fno-omit-frame-pointer
build:tsan --linkopt -fsanitize=thread
# Memory sanitizer configuration
build:asan --strip=never
build:asan --copt -g
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address
test:asan --jobs=1
test:asan --test_env=ASAN_OPTIONS="detect_leaks=0"
# This LD_PRELOAD is set for Travis. You will need to change it for local debugging.
test:asan --test_env=LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libasan.so.2 /usr/lib/gcc/x86_64-linux-gnu/7/libasan.so"
# For example, for Ubuntu 18.04 libasan can be found here:
# test:asan --test_env=LD_PRELOAD="/usr/lib/gcc/x86_64-linux-gnu/7/libasan.so"
test:asan-buildkite --test_env=LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libasan.so.5"
# CI configuration:
aquery:ci --color=no
aquery:ci --noshow_progress
build:ci --color=yes
build:ci --curses=no
build:ci --keep_going
build:ci --progress_report_interval=100
build:ci --show_progress_rate_limit=15
build:ci --show_task_finish
build:ci --ui_actions_shown=1024
build:ci --show_timestamps
build:ci-travis --disk_cache=~/ray-bazel-cache
build:ci-travis --remote_cache="https://storage.googleapis.com/ray-bazel-cache"
build:ci-github --experimental_repository_cache_hardlinks # GitHub Actions has low disk space, so prefer hardlinks there.
build:ci-github --disk_cache=~/ray-bazel-cache
build:ci-github --remote_cache="https://storage.googleapis.com/ray-bazel-cache"
test:ci --flaky_test_attempts=3
test:ci --nocache_test_results
test:ci --spawn_strategy=local
test:ci --test_output=errors
test:ci --test_verbose_timeout_warnings
aquery:get-toolchain --include_commandline=false
aquery:get-toolchain --noimplicit_deps
# [Linux] Uncomment this line (or use --config) to print a stack trace on exit.
#test:linux --config=strace
test:strace --run_under="bash -c 'if command -v strace >/dev/null && strace -qq -k -e exit true 2>/dev/null; then strace -qq -k -e exit -e trace=\"!all\" -s 32768 -f -o >(awk \"/^[0-9]+ / { y = \\$3 != \\\"SIGCHLD\\\" && \\$3 != \\\"SIGTERM\\\" && \\$5 != \\\"SIGTERM\\\" && \\$5 != \\\"SIGKILL2\\\"; } y { print; }\" 1>&2 && cat 1>&2) -- \"$@\"; else \"$@\"; fi' -"
# [Linux] Uncomment this line (or use --config) to preload libSegFault.so if available, to print a stack trace on aborts and segfault. (Note: This doesn't always work.)
#test:linux --config=segfault
test:segfault --run_under="bash -c 'unset GREP_OPTIONS && if ! grep -q -o Microsoft /proc/version 2>/dev/null; then libs=\"$(command -v ldconfig >/dev/null && ldconfig -p | grep -F -o -e \"libSegFault.so\" | uniq | tr \"\\\\n\" :)\" && if [ -n \"${libs%:}\" ]; then export SEGFAULT_SIGNALS=\"abrt segv\" LD_PRELOAD=\"${libs}${LD_PRELOAD-}\"; fi; fi && \"$@\"' -"