-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.bazelrc
143 lines (114 loc) · 6.92 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
132
133
134
135
136
137
138
139
140
141
142
143
common --enable_bzlmod
common --incompatible_disable_native_android_rules
mobile-install --config=android
# We need access to ld in order to build libunwind on Linux
build:libunwind --action_env=PATH=/usr/bin
build --action_env=CC --host_action_env=CC
build --action_env=CXX --host_action_env=CXX
build --action_env=LLVM_CONFIG --host_action_env=LLVM_CONFIG
build --action_env=PATH --host_action_env=PATH
build --features=debug_prefix_map_pwd_is_dot
build --features=oso_prefix_is_pwd
build --features=relative_ast_path
build --features=remap_xcode_path
build --features=swift.cacheable_swiftmodules
build --features=swift.coverage_prefix_map
build --features=swift.opt_uses_osize
build --features=swift.opt_uses_wmo
build --features=swift.remap_xcode_path
build --features=swift.use_global_module_cache
# Gate the references to androidndk behind a flag to support building on arm linux.
build:android --android_crosstool_top=@androidndk//:toolchain
build --@rules_rust//rust/settings:rustfmt.toml=//:rustfmt.toml
build --@rules_rust//rust/settings:clippy.toml=//:.clippy.toml
build --ios_minimum_os=12.0
build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:clippy --output_groups=+clippy_checks
build:compdb --build_tag_filters=-nocompdb,-clippy_checks,-macos_only
build:compdb --config=noclippy
build:noclippy --output_groups=-clippy_checks
test --test_env=RUST_BACKTRACE=full --java_runtime_version=remotejdk_11
# Shared configuration for all CI tasks.
build:ci --config=clippy
build:ci --swiftcopt=-warnings-as-errors
build:ci --config=force-xcode-version
# Common debug configuration for iOS/Android. Used when building examples apps.
build:dbg-common --compilation_mode=opt
build:dbg-common --config=abort-panic
build:dbg-ios --config=dbg-common
# Ensure that the output of the `ios_static_framework` rule is a zip as opposed to an unzipped
# framework. Without this, the output of `ios_static_framework` is a zip when invoked with the use of
# command line tool and an unzipped framework when invoked with the use of Xcode UI.
# Ideally we should allow for an unzipped output of `ios_static_framework` so that we can avoid having
# to zip/unzip framework when building it but for simplicity purposes, we force the output to be always
# zipped.
build:rules_xcodeproj --config=dbg-ios
build:rules_xcodeproj --define=apple.experimental.tree_artifact_outputs=0
# Common release configuration for iOS/Android
# TODO(mattklein123): Should we be compiling the rust code size optimized?
build:release-common --compilation_mode=opt
# TODO(mattklein123): This doesn't work for whatever reason when building tests, but we should be
# running tests with release settings.
build:release-common --config=abort-panic
# Size optimizations, codegen-units=1 go along side LTO, which accounts for
# about 10% reduction; -z has a non-zero smaller impact (a few pp).
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Ccodegen-units=1'
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Copt-level=s'
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Clto=fat'
# Without the next line, rules_rust will add -Clinker-plugin-lto which would be amazing
# but the ndk's lld won't support the output
build:release-common --@rules_rust//rust/settings:lto='manual'
build:release-android --define android_strip_symbols=true
build:release-android --android_platforms=@rules_android//:armeabi-v7a,@rules_android//:arm64-v8a,@rules_android//:x86,@rules_android//:x86_64
build:release-android --config=release-common
build:release-android --copt=-flto=thin --linkopt=-flto=thin
build:release-android --config=android
# TODO(snowp): Enable relr once we no longer need to support Android 8. The system linker is not
# able to understand RELR relocations, see https://bugs.chromium.org/p/chromium/issues/detail?id=900049.
# Enabling relr provides a small binary size decrease.
# build:release-android --linkopt=-Wl,--pack-dyn-relocs=relr
# build:release-android --linkopt=-Wl,--use-android-relr-tags
# Custom iOS release configuration
build:force-xcode-version --ios_simulator_device="iPhone 13"
build:force-xcode-version --ios_simulator_version=17.5
build:force-xcode-version --xcode_version=15.4
build:release-ios --config=release-common --config=force-xcode-version
# Allows disabling the cache for cases where the cache might be slow, e.g. slow networks.
build:nocache --remote_accept_cached=false
build:nocache --noremote_upload_local_results
build:nocache --bes_results_url=
build:nocache --bes_backend=
build:nocache --remote_cache=
# Convenience config for disabling targets that build on macos only (e.g. iOS targets).
build:nomacos --test_tag_filters=-macos_only --build_tag_filters=-macos_only
# We run this with release-common to be as indicative of production as possible, and add in as much debug information we
# can to allow using perf to generate flamegraphs.
build:benchmark --config=release-common
build:benchmark-profile --config=benchmark --@rules_rust//rust/settings:extra_rustc_flag='-Cdebuginfo=2' --force_pic
# Specifies that panics should automatically be treated as a panic.
build:abort-panic --@rules_rust//rust/settings:extra_rustc_flag=-C
build:abort-panic --@rules_rust//rust/settings:extra_rustc_flag=panic=abort
# This attempts to match what cargo-fuzz does, but it's likely a moving target with many options.
# Occasionally check back to see if anything has changed over there.
# https://github.com/rust-fuzz/cargo-fuzz/blob/fa18f0d77aef036302d9f948e80aa12c6b95d57b/src/project.rs#L163
build:fuzz --config=release-common
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Cpasses=sancov-module
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-level=4
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-inline-8bit-counters
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-pc-table
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-trace-compares
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-stack-depth
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=-Zsanitizer=address
build:fuzz --@rules_rust//rust/settings:extra_rustc_flag=--cfg=fuzzing
build:fuzz --@rules_rust//rust/toolchain/channel=nightly
build:fake-nightly --action_env=RUSTC_BOOTSTRAP=1
# Enables TSAN for all targets. This does not currently work when targeting platforms where TSAN is not enabled in the Rust toolchain (e.g. ios-sim).
build:tsan --config=fake-nightly
build:tsan --features=tsan
build:tsan --@rules_rust//rust/settings:extra_rustc_flag=-Zsanitizer=thread
# Enables using TSAN with iOS tests. This does not enable tsan in Rust and may therefore result in false positivies.
build:ios-tsan --features=tsan
build:asan --config=fake-nightly
build:asan --features=address
build:asan --@rules_rust//rust/settings:extra_rustc_flag=-Zsanitizer=address
try-import %workspace%/tmp/ci-bazelrc