-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy path.bazelrc
More file actions
83 lines (69 loc) · 4.33 KB
/
.bazelrc
File metadata and controls
83 lines (69 loc) · 4.33 KB
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
# Copyright 2025 Ekumen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
build --compilation_mode opt
build:linux --cxxopt=-std=c++17
build:linux --cxxopt=-Wall
build:linux --cxxopt=-Wconversion
build:linux --cxxopt=-Werror
build:linux --cxxopt=-Wextra
build:linux --cxxopt=-Wpedantic
build:windows --cxxopt=/std:c++17
build:windows --cxxopt=/permissive-
build:windows --cxxopt=/WX
# For an automatic variable, if there exists a path from the function entry to a use of the variable
# that is initialized, but there exist some other paths for which the variable is not initialized,
# the compiler emits a warning if it cannot prove the uninitialized paths are not executed at run time.
# These warnings are made optional because GCC is not smart enough to see all the reasons why the code
# might be correct in spite of appearing to have an error.
# The range-v3 variant implementation triggers this warning in some cases.
build:linux --cxxopt=-Wno-error=maybe-uninitialized
# Bazel picks up host-OS-specific config lines from bazelrc files. For example, if the host OS is
# Linux and you run bazel build, Bazel picks up lines starting with build:linux. Supported OS
# identifiers are `linux`, `macos`, `windows`, `freebsd`, and `openbsd`. Enabling this flag is
# equivalent to using `--config=linux` on Linux, `--config=windows` on Windows, etc.
common --enable_platform_specific_config
# Output test errors to stderr so users don't have to `cat` or open test failure log files when test fail.
# This makes the log noisier in exchange for reducing the time-to-feedback on test failures for users.
common --test_output=errors
# Make builds more reproducible by using a static value for PATH and not inheriting LD_LIBRARY_PATH.
# Use `--action_env=ENV_VARIABLE` if you want to inherit specific variables from the environment where Bazel runs.
# Note that doing so can prevent cross-user caching if a shared cache is used.
# See https://github.com/bazelbuild/bazel/issues/2574 for more details.
common --incompatible_strict_action_env
# Reuse sandbox directories between invocations.
# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs.
# Saves time on sandbox creation and deletion when many of the same kind of action is spawned during the build.
common --reuse_sandbox_directories
# On CI, announce all command options read from the bazelrc file(s) when starting up at the
# beginning of each Bazel invocation. This is very useful on CI to be able to inspect which flags
# are being applied on each run based on the order of overrides.
common:ci --announce_rc
# Avoid creating a runfiles tree for binaries or tests until it is needed.
# See https://github.com/bazelbuild/bazel/issues/6627
# This may break local workflows that `build` a binary target, then run the resulting program outside of `bazel run`.
# In those cases, the script will need to call `bazel build --build_runfile_links //my/binary:target` and then execute the resulting program.
common:ci --nobuild_runfile_links
# Only show progress every 60 seconds on CI.
# We want to find a compromise between printing often enough to show that the build isn't stuck,
# but not so often that we produce a long log file that requires a lot of scrolling.
common:ci --show_progress_rate_limit=60
# On CI, add a timestamp to each message generated by Bazel specifying the time at which the message was displayed.
# This makes it easier to reason about what were the slowest steps on CI.
common:ci --show_timestamps
# On CI, try to build as much as possible even in the face of errors.
common:ci --keep_going
# Load any settings & overrides specific to the current user from `user.bazelrc`.
# This file should appear in `.gitignore` so that settings are not shared with team members.
# This should be last statement in this config so the user configuration overrides anything above.
try-import %workspace%/user.bazelrc