-
Notifications
You must be signed in to change notification settings - Fork 12
/
.bazelrc
43 lines (35 loc) · 1.87 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
# See e.g. https://blog.aspect.dev/bazelrc-flags
# https://github.com/bazelbuild/rules_foreign_cc/issues/1129
# Mandatory at the moment for Bazel 7.0.0.
build --noincompatible_sandbox_hermetic_tmp
# Fix the wrong default to generate __init__.py to delimit a Python package.
# This is a mandatory flag.
build --incompatible_default_to_explicit_init_py
# All code will be compiled with C++17 flag.
# Users can naturally override copts for cc_* targets.
# NOTE: googletest >=v1.13.0 requires min C++14.
# This is a mandatory flag.
build --cxxopt=-std=c++17
# This is a mandatory flag for user repos.
build --@rules_python//python/config_settings:python_version=3.10
# Ensure that you don't accidentally make non-hermetic actions/tests
# which depend on remote services. Tag an individual target with
# tags=["requires-network"] to opt-out of the enforcement.
build --sandbox_default_allow_network=false
# Don't let environment variables like $PATH sneak into the build,
# which can cause massive cache misses when they change.
build --incompatible_strict_action_env
# Helps debugging when Bazel runs out of memory
build --heap_dump_on_oom
# Speed up all builds by not checking if output files have been modified.
build --noexperimental_check_output_files
# See https://github.com/bazel-contrib/bazel-lib/blob/1e953e4764c01bd6743cc85ae4c15bf9edb05f82/.aspect/bazelrc/performance.bazelrc#L8C1-L14C35
build --nolegacy_external_runfiles
# Don't bother building targets which aren't dependencies of the tests.
test --build_tests_only
# Load any settings specific to the current user.
# user.bazelrc should appear in .gitignore so that settings are not shared with
# team members. This needs to be last statement in this config,
# as the user configuration should be able to overwrite flags from this file.
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
try-import %workspace%/user.bazelrc