|
| 1 | +common --experimental_allow_tags_propagation |
| 2 | + |
| 3 | +mobile-install --config=android |
| 4 | + |
| 5 | +build --enable_platform_specific_config |
| 6 | +# https://github.com/bazelbuild/bazel/issues/18958 |
| 7 | +build --noenable_bzlmod |
| 8 | +build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain |
| 9 | +build:macos --crosstool_top=@local_config_apple_cc//:toolchain |
| 10 | +build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain |
| 11 | + |
| 12 | +# We need access to ld in order to build libunwind on Linux |
| 13 | +build:libunwind --action_env=PATH=/usr/bin |
| 14 | + |
| 15 | +build --action_env=CC --host_action_env=CC |
| 16 | +build --action_env=CXX --host_action_env=CXX |
| 17 | +build --action_env=LLVM_CONFIG --host_action_env=LLVM_CONFIG |
| 18 | +build --action_env=PATH --host_action_env=PATH |
| 19 | + |
| 20 | +build --features=debug_prefix_map_pwd_is_dot |
| 21 | +build --features=oso_prefix_is_pwd |
| 22 | +build --features=relative_ast_path |
| 23 | +build --features=remap_xcode_path |
| 24 | +build --features=swift.cacheable_swiftmodules |
| 25 | +build --features=swift.coverage_prefix_map |
| 26 | +build --features=swift.opt_uses_osize |
| 27 | +build --features=swift.opt_uses_wmo |
| 28 | +build --features=swift.remap_xcode_path |
| 29 | +build --features=swift.use_global_module_cache |
| 30 | + |
| 31 | +# Gate the references to androidndk behind a flag to support building on arm linux. |
| 32 | +build:android --android_crosstool_top=@androidndk//:toolchain |
| 33 | +build:android --extra_toolchains=@androidndk//... |
| 34 | +build --platform_mappings=bazel/platform_mappings |
| 35 | + |
| 36 | +build --@rules_rust//:rustfmt.toml=//:rustfmt.toml |
| 37 | +build --@rules_rust//:clippy.toml=//:.clippy.toml |
| 38 | + |
| 39 | +build --macos_minimum_os=12.5 |
| 40 | +build --host_macos_minimum_os=12.5 |
| 41 | + |
| 42 | +build --ios_minimum_os=12.0 |
| 43 | +build --ios_simulator_device="iPhone 13" |
| 44 | +build --ios_simulator_version=17.5 |
| 45 | +build --xcode_version=15.4 |
| 46 | + |
| 47 | +build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect |
| 48 | +build:clippy --output_groups=+clippy_checks |
| 49 | + |
| 50 | +build:compdb --build_tag_filters=-nocompdb,-clippy_checks,-macos_only |
| 51 | +build:compdb --config=noclippy |
| 52 | + |
| 53 | +build:noclippy --output_groups=-clippy_checks |
| 54 | + |
| 55 | +test --test_env=RUST_BACKTRACE=full |
| 56 | + |
| 57 | +# Shared configuration for all CI tasks. |
| 58 | +build:ci --config=clippy |
| 59 | +build:ci --swiftcopt=-warnings-as-errors |
| 60 | + |
| 61 | +# Common debug configuration for iOS/Android. Used when building examples apps. |
| 62 | +build:dbg-common --compilation_mode=opt |
| 63 | +build:dbg-common --config=abort-panic |
| 64 | + |
| 65 | +build:dbg-ios --config=dbg-common |
| 66 | + |
| 67 | +# Ensure that the output of the `ios_static_framework` rule is a zip as opposed to an unzipped |
| 68 | +# framework. Without this, the output of `ios_static_framework` is a zip when invoked with the use of |
| 69 | +# command line tool and an unzipped framework when invoked with the use of Xcode UI. |
| 70 | +# Ideally we should allow for an unzipped output of `ios_static_framework` so that we can avoid having |
| 71 | +# to zip/unzip framework when building it but for simplicity purposes, we force the output to be always |
| 72 | +# zipped. |
| 73 | +build:rules_xcodeproj --config=dbg-ios |
| 74 | +build:rules_xcodeproj --define=apple.experimental.tree_artifact_outputs=0 |
| 75 | + |
| 76 | +# Common release configuration for iOS/Android |
| 77 | +# TODO(mattklein123): Should we be compiling the rust code size optimized? |
| 78 | +build:release-common --compilation_mode=opt |
| 79 | +# TODO(mattklein123): This doesn't work for whatever reason when building tests, but we should be |
| 80 | +# running tests with release settings. |
| 81 | +build:release-common --config=abort-panic |
| 82 | + |
| 83 | +# Size optimizations, codegen-units=1 go along side LTO, which accounts for |
| 84 | +# about 10% reduction; -z has a non-zero smaller impact (a few pp). |
| 85 | +build:release-common --@rules_rust//:extra_rustc_flag='-Ccodegen-units=1' |
| 86 | +build:release-common --@rules_rust//:extra_rustc_flag='-Clto=fat' |
| 87 | +build:release-common --@rules_rust//:extra_rustc_flag='-Copt-level=s' |
| 88 | + |
| 89 | +build:release-android --define android_strip_symbols=true |
| 90 | +build:release-android --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a |
| 91 | +build:release-android --config=release-common |
| 92 | +build:release-android --copt=-flto=thin --linkopt=-flto=thin |
| 93 | +build:release-android --config=android |
| 94 | +# TODO(snowp): Enable relr once we no longer need to support Android 8. The system linker is not |
| 95 | +# able to understand RELR relocations, see https://bugs.chromium.org/p/chromium/issues/detail?id=900049. |
| 96 | +# Enabling relr provides a small binary size decrease. |
| 97 | +# build:release-android --linkopt=-Wl,--pack-dyn-relocs=relr |
| 98 | +# build:release-android --linkopt=-Wl,--use-android-relr-tags |
| 99 | + |
| 100 | +# Custom iOS release configuration |
| 101 | +build:release-ios --config=release-common |
| 102 | + |
| 103 | +# Allows disabling the cache for cases where the cache might be slow, e.g. slow networks. |
| 104 | +build:nocache --remote_accept_cached=false |
| 105 | +build:nocache --noremote_upload_local_results |
| 106 | +build:nocache --bes_results_url= |
| 107 | +build:nocache --bes_backend= |
| 108 | +build:nocache --remote_cache= |
| 109 | + |
| 110 | +# Convenience config for disabling targets that build on macos only (e.g. iOS targets). |
| 111 | +build:nomacos --test_tag_filters=-macos_only --build_tag_filters=-macos_only |
| 112 | + |
| 113 | +# We run this with release-common to be as indicative of production as possible, and add in as much debug information we |
| 114 | +# can to allow using perf to generate flamegraphs. |
| 115 | +build:benchmark --config=release-common |
| 116 | +build:benchmark-profile --config=benchmark --@rules_rust//:extra_rustc_flag='-Cdebuginfo=2' --force_pic |
| 117 | + |
| 118 | +# Specifies that panics should automatically be treated as a panic. |
| 119 | +build:abort-panic --@rules_rust//:extra_rustc_flag=-C |
| 120 | +build:abort-panic --@rules_rust//:extra_rustc_flag=panic=abort |
| 121 | + |
| 122 | +# This attempts to match what cargo-fuzz does, but it's likely a moving target with many options. |
| 123 | +# Occasionally check back to see if anything has changed over there. |
| 124 | +# https://github.com/rust-fuzz/cargo-fuzz/blob/fa18f0d77aef036302d9f948e80aa12c6b95d57b/src/project.rs#L163 |
| 125 | +build:fuzz --config=release-common |
| 126 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Cpasses=sancov-module |
| 127 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-level=4 |
| 128 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-inline-8bit-counters |
| 129 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-pc-table |
| 130 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-trace-compares |
| 131 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Cllvm-args=-sanitizer-coverage-stack-depth |
| 132 | +build:fuzz --@rules_rust//:extra_rustc_flag=-Zsanitizer=address |
| 133 | +build:fuzz --@rules_rust//:extra_rustc_flag=--cfg=fuzzing |
| 134 | +build:fuzz --@rules_rust//rust/toolchain/channel=nightly |
| 135 | + |
| 136 | +build:fake-nightly --action_env=RUSTC_BOOTSTRAP=1 |
| 137 | + |
| 138 | +# 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). |
| 139 | +build:tsan --config=fake-nightly |
| 140 | +build:tsan --features=tsan |
| 141 | +build:tsan --@rules_rust//:extra_rustc_flag=-Zsanitizer=thread |
| 142 | + |
| 143 | +# Enables using TSAN with iOS tests. This does not enable tsan in Rust and may therefore result in false positivies. |
| 144 | +build:ios-tsan --features=tsan |
| 145 | + |
| 146 | +build:asan --config=fake-nightly |
| 147 | +build:asan --features=address |
| 148 | +build:tsan --@rules_rust//:extra_rustc_flag=-Zsanitizer=address |
| 149 | + |
| 150 | +try-import %workspace%/tmp/ci-bazelrc |
0 commit comments