-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy path.bazelrc
More file actions
218 lines (188 loc) · 10.4 KB
/
.bazelrc
File metadata and controls
218 lines (188 loc) · 10.4 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Copyright 2022 The NativeLink Authors. All rights reserved.
#
# Licensed under the Functional Source License, Version 1.1, Apache 2.0 Future License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# See LICENSE file for details
#
# 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.
# Use blake3 as digest function instead of the much slower default sha256.
startup --digest_function=blake3
common --enable_platform_specific_config
# Don't use legacy toolchain resolution.
common --incompatible_enable_cc_toolchain_resolution
common --incompatible_enable_proto_toolchain_resolution
# Use '+' instead of the legacy '~' when resolving repo names.
common --incompatible_use_plus_in_repo_names
# Simulate rules_python's initialization with a script and use a statically
# linked musl Python toolchain.
# TODO(palfrey): This is a hack. It works for us because have just a few
# simple python scripts in the repository and don't have
# complex Python dependencies. Implement LRE for Python.
common --@rules_python//python/config_settings:bootstrap_impl=script
common --@rules_python//python/config_settings:py_linux_libc=musl
# Don't leak PATH and LD_LIBRARY_PATH into the build.
build --incompatible_strict_action_env
# Don't use legacy repository rules.
build --incompatible_disable_native_repo_rules
# Use the earliest supported C++ version for protoc.
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
build --test_output=errors
build:debug -c dbg
build:self_test --remote_cache=grpc://127.0.0.1:50051
build:self_execute --remote_executor=grpc://127.0.0.1:50052
build:self_execute --remote_default_exec_properties=cpu_count=1
build:self_execute --platform_suffix=self-execute
build --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
# Kept in sync with top-level Cargo.toml via generate-bazel-rc
## BEGIN CARGO LINTS ##
build --@rules_rust//:extra_rustc_flag=-Wunused
build --@rules_rust//:extra_rustc_flag=-Dambiguous_glob_reexports
build --@rules_rust//:extra_rustc_flag=-Dclashing_extern_declarations
build --@rules_rust//:extra_rustc_flag=-Dconst_item_mutation
build --@rules_rust//:extra_rustc_flag=-Ddangling_pointers_from_temporaries
build --@rules_rust//:extra_rustc_flag=-Dderef_nullptr
build --@rules_rust//:extra_rustc_flag=-Ddrop_bounds
build --@rules_rust//:extra_rustc_flag=-Dfuture_incompatible
build --@rules_rust//:extra_rustc_flag=-Dhidden_glob_reexports
build --@rules_rust//:extra_rustc_flag=-Dimproper_ctypes
build --@rules_rust//:extra_rustc_flag=-Dimproper_ctypes_definitions
build --@rules_rust//:extra_rustc_flag=-Dinvalid_from_utf8
build --@rules_rust//:extra_rustc_flag=-Dinvalid_macro_export_arguments
build --@rules_rust//:extra_rustc_flag=-Dinvalid_nan_comparisons
build --@rules_rust//:extra_rustc_flag=-Dinvalid_reference_casting
build --@rules_rust//:extra_rustc_flag=-Dinvalid_value
build --@rules_rust//:extra_rustc_flag=-Wkeyword_idents
build --@rules_rust//:extra_rustc_flag=-Wlet_underscore
build --@rules_rust//:extra_rustc_flag=-Wmacro_use_extern_crate
build --@rules_rust//:extra_rustc_flag=-Wmeta_variable_misuse
build --@rules_rust//:extra_rustc_flag=-Wmissing_abi
build --@rules_rust//:extra_rustc_flag=-Wmissing_copy_implementations
build --@rules_rust//:extra_rustc_flag=-Wmissing_debug_implementations
build --@rules_rust//:extra_rustc_flag=-Wnoop_method_call
build --@rules_rust//:extra_rustc_flag=-Dopaque_hidden_inferred_bound
build --@rules_rust//:extra_rustc_flag=-Doverlapping_range_endpoints
build --@rules_rust//:extra_rustc_flag=-Wsingle_use_lifetimes
build --@rules_rust//:extra_rustc_flag=-Dsuspicious_double_ref_op
build --@rules_rust//:extra_rustc_flag=-Wtrivial_casts
build --@rules_rust//:extra_rustc_flag=-Wtrivial_numeric_casts
build --@rules_rust//:extra_rustc_flag=-Dunconditional_recursion
build --@rules_rust//:extra_rustc_flag=-Dunexpected_cfgs
build --@rules_rust//:extra_rustc_flag=-Dunknown_lints
build --@rules_rust//:extra_rustc_flag=-Dunnameable_test_items
build --@rules_rust//:extra_rustc_flag=-Wunreachable_pub
build --@rules_rust//:extra_rustc_flag=-Dunsafe_op_in_unsafe_fn
build --@rules_rust//:extra_rustc_flag=-Dunstable_syntax_pre_expansion
build --@rules_rust//:extra_rustc_flag=-Wunused_import_braces
build --@rules_rust//:extra_rustc_flag=-Dunused_imports
build --@rules_rust//:extra_rustc_flag=-Wunused_lifetimes
build --@rules_rust//:extra_rustc_flag=-Wunused_qualifications
build --@rules_rust//:extra_rustc_flag=-Wvariant_size_differences
build --@rules_rust//:clippy_flag=-Wclippy::all
build --@rules_rust//:clippy_flag=-Wclippy::nursery
build --@rules_rust//:clippy_flag=-Wclippy::pedantic
build --@rules_rust//:clippy_flag=-Dclippy::alloc_instead_of_core
build --@rules_rust//:clippy_flag=-Dclippy::as_underscore
build --@rules_rust//:clippy_flag=-Dclippy::await_holding_lock
build --@rules_rust//:clippy_flag=-Dclippy::bind_instead_of_map
build --@rules_rust//:clippy_flag=-Dclippy::collapsible_if
build --@rules_rust//:clippy_flag=-Wclippy::dbg_macro
build --@rules_rust//:clippy_flag=-Wclippy::decimal_literal_representation
build --@rules_rust//:clippy_flag=-Dclippy::disallowed_methods
build --@rules_rust//:clippy_flag=-Dclippy::doc_markdown
build --@rules_rust//:clippy_flag=-Dclippy::elidable_lifetime_names
build --@rules_rust//:clippy_flag=-Dclippy::explicit_into_iter_loop
build --@rules_rust//:clippy_flag=-Dclippy::future_not_send
build --@rules_rust//:clippy_flag=-Aclippy::get_unwrap
build --@rules_rust//:clippy_flag=-Dclippy::implicit_clone
build --@rules_rust//:clippy_flag=-Dclippy::implicit_hasher
build --@rules_rust//:clippy_flag=-Dclippy::manual_is_variant_and
build --@rules_rust//:clippy_flag=-Dclippy::map_unwrap_or
build --@rules_rust//:clippy_flag=-Dclippy::missing_const_for_fn
build --@rules_rust//:clippy_flag=-Aclippy::missing_docs_in_private_items
build --@rules_rust//:clippy_flag=-Dclippy::or_fun_call
build --@rules_rust//:clippy_flag=-Wclippy::print_stdout
build --@rules_rust//:clippy_flag=-Dclippy::ptr_arg
build --@rules_rust//:clippy_flag=-Dclippy::redundant_closure_for_method_calls
build --@rules_rust//:clippy_flag=-Dclippy::semicolon_if_nothing_returned
build --@rules_rust//:clippy_flag=-Dclippy::single_char_pattern
build --@rules_rust//:clippy_flag=-Dclippy::std_instead_of_core
build --@rules_rust//:clippy_flag=-Dclippy::string_lit_as_bytes
build --@rules_rust//:clippy_flag=-Dclippy::todo
build --@rules_rust//:clippy_flag=-Aclippy::too_long_first_doc_paragraph
build --@rules_rust//:clippy_flag=-Dclippy::unchecked_time_subtraction
build --@rules_rust//:clippy_flag=-Wclippy::unimplemented
build --@rules_rust//:clippy_flag=-Dclippy::unnecessary_semicolon
build --@rules_rust//:clippy_flag=-Aclippy::unwrap_in_result
build --@rules_rust//:clippy_flag=-Aclippy::unwrap_used
build --@rules_rust//:clippy_flag=-Wclippy::use_debug
build --@rules_rust//:clippy_flag=-Dclippy::used_underscore_binding
build --@rules_rust//:clippy_flag=-Dclippy::useless_format
build --@rules_rust//:clippy_flag=-Dclippy::cast_possible_truncation
build --@rules_rust//:clippy_flag=-Aclippy::cast_possible_wrap
build --@rules_rust//:clippy_flag=-Aclippy::cast_precision_loss
build --@rules_rust//:clippy_flag=-Aclippy::cast_sign_loss
build --@rules_rust//:clippy_flag=-Aclippy::cognitive_complexity
build --@rules_rust//:clippy_flag=-Aclippy::iter_with_drain
build --@rules_rust//:clippy_flag=-Aclippy::large_futures
build --@rules_rust//:clippy_flag=-Aclippy::missing_errors_doc
build --@rules_rust//:clippy_flag=-Aclippy::missing_fields_in_debug
build --@rules_rust//:clippy_flag=-Aclippy::missing_panics_doc
build --@rules_rust//:clippy_flag=-Aclippy::must_use_candidate
build --@rules_rust//:clippy_flag=-Aclippy::option_if_let_else
build --@rules_rust//:clippy_flag=-Aclippy::redundant_pub_crate
build --@rules_rust//:clippy_flag=-Aclippy::ref_option
build --@rules_rust//:clippy_flag=-Aclippy::significant_drop_tightening
build --@rules_rust//:clippy_flag=-Aclippy::too_many_lines
build --@rules_rust//:clippy_flag=-Aclippy::uninhabited_references
build --@rules_rust//:clippy_flag=-Aclippy::unused_async
build --@rules_rust//:clippy_flag=-Aclippy::unused_self
## END CARGO LINTS ##
build --@rules_rust//:clippy.toml=//:clippy.toml
test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml
# This will make rustfmt and clippy only run on `bazel test`.
test --output_groups=+rustfmt_checks
test --output_groups=+clippy_checks
# Get a bit more output from bazel tests
# See https://github.com/bazelbuild/bazel/issues/12602
test --experimental_ui_max_stdouterr_bytes=104857600
# Optional nightly toolchain. Mostly useful for running sanitizers.
build:nightly --@rules_rust//rust/toolchain/channel=nightly
# AddressSanitizer to detect memory leaks.
build:asan --config=nightly
build:asan --@rules_rust//:extra_rustc_flags=-Zsanitizer=address
# asan explicitly needs to _not_ use the Nix toolchains and so this
# is needed to load the rust toolchains in Bazel
build:asan --extra_toolchains=@rust_toolchains//:all
# ThreadSanitizer to detect data races. Tests under tsan shouldn't be cached
# since they tend to produce irreproducible false negatives.
build:tsan --config=nightly --config=debug
build:tsan --@rules_rust//:extra_rustc_flags=-Zsanitizer=thread
build:tsan --cache_test_results=no
build:tsan --run_under=//tools:tsan.sh
# Configuration options for Windows builds.
startup --windows_enable_symlinks
build:windows --cxxopt=/std:c++14 --host_cxxopt=/std:c++14
build:windows --enable_runfiles
build:windows --extra_toolchains=@rust_toolchains//:all # Doesn't support LRE.
# Configuration options for MacOS builds
build --macos_sdk_version=10.12 # For clock_gettime in mimalloc
# rustfmt
# TODO(palfrey): compatibility workaround for https://github.com/bazelbuild/rules_rust/issues/3493
build:rustfmt --@rules_rust//:extra_rustc_flag=-Aunused_qualifications
# Generated by the LRE flake module.
try-import %workspace%/lre.bazelrc
# Generated by the darwin flake module.
try-import %workspace%/darwin.bazelrc
# Generated by the NixOS flake module.
try-import %workspace%/nixos.bazelrc
# Generated by the nativelink flake module.
try-import %workspace%/nativelink.bazelrc
# Allow user-side customization.
try-import %workspace%/user.bazelrc