1# Use the target platform (android_x86, android_arm) in the bazel-out/ output 2# directory name fragment instead of the CPU (darwin, k8). This avoids 3# thrashing the output directory when switching between top level target 4# --platforms values. 5build --experimental_platform_in_output_dir 6 7# Use toolchain resolution to find the cc toolchain. 8build --incompatible_enable_cc_toolchain_resolution 9 10# Ensure that the host_javabase always use the checked-in JDK. 11build --tool_java_runtime_version=jdk17 12build --java_runtime_version=jdk17 13 14# Disable errorprone to continue making progress on java and android conversion 15# while we determine how errorprone will be handled in Bazel-only builds b/227504307. 16# TODO(b/227504307): Remove --javacopt="-XepDisableAllChecks" after implementing 17# the correct solution around errorprone. 18build --javacopt="-XepDisableAllChecks" 19build --host_javacopt="-XepDisableAllChecks" 20 21# Lock down the PATH variable in actions to /usr/bin and /usr/local/bin. 22build --experimental_strict_action_env 23 24# Explicitly allow unresolved symlinks (it's an experimental Bazel feature) 25build --experimental_allow_unresolved_symlinks 26 27# Enable usage of experimental cc-related build APIs 28common --experimental_cc_shared_library 29build --experimental_starlark_cc_import 30 31# Do not tokenize copts, other than strings that consist of a single Make 32# variable. This prevents the need to double-escape characters like backslashes 33# and quotes in copts. 34build --features no_copts_tokenization 35 36# Disable local cpp toolchain detection, as it is explicitly declared in AOSP. 37build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 38 39build --proto_compiler=//external/protobuf:aprotoc 40 41# Disable sandboxing for CppCompile actions, as headers are not fully specified. 42# TODO(b/186116353): This is a temporary fix, as appropriately-sandboxed actions 43# are a long term goal. 44build --strategy=CppCompile=standalone 45 46# Enable use of the implementation_deps attribute in native cc rules 47build --experimental_cc_implementation_deps 48 49# Use the llvm_coverage_map_format feature to turn on native code coverage. 50build --experimental_use_llvm_covmap 51 52# Always emit the stdout of failing tests as they should be emphasized. (b/247516541) 53test --test_output=errors 54 55# Enable building targets in //external:__subpackages__. 56common --experimental_sibling_repository_layout 57common --experimental_disable_external_package 58 59# Increase refresh rate of command line UI for improved perceived responsiveness. 60common --show_progress_rate_limit=0.05 61 62# These are disabled when running under soong_ui (default = auto). Force enable them here. 63common --color=yes 64common --curses=yes 65 66# Configurations specific to CI builds, generally to improve signal-to-noise ratio in server logs. 67common:ci --color=no 68common:ci --curses=no 69common:ci --show_progress_rate_limit=5 70common:ci --noshow_loading_progress 71# Show the full set of flags for observability and debuggability. 72common:ci --announce_rc 73build:ci --verbose_failures 74# Log apexer verbosely on CI (it has a noisy but useful output) 75build:ci --//build/bazel/rules/apex:apexer_verbose 76test:ci --keep_going 77 78# Support a local user-specific bazelrc file. 79try-import %workspace%/user.bazelrc 80 81# Get rid no-op "affected by Starlark transition" config when label-based flag 82# (i.e. //command_line_option:fdo_profile) is set back to None 83build --experimental_output_directory_naming_scheme=diff_against_baseline 84common --experimental_google_legacy_api 85build --android_sdk=//prebuilts/sdk:android_sdk 86build --incompatible_enable_android_toolchain_resolution 87common --experimental_enable_android_migration_apis 88common --incompatible_java_common_parameters 89build --android_databinding_use_v3_4_args 90build --experimental_android_databinding_v2 91build --define=android_incremental_dexing_tool=d8_dexbuilder 92build --define=android_dexmerger_tool=d8_dexmerger 93build --nouse_workers_with_dexbuilder 94 95# TODO(b/199038020): Use a python_toolchain when we have Starlark rules_python. 96# This also means all python scripts are using py3 runtime. 97build --python_top=//prebuilts/build-tools:python3 98build --noincompatible_use_python_toolchains 99 100# Enable optimization compilation mode to build cc with fdo 101# https://github.com/bazelbuild/bazel/blob/de7b26acfdfcd9c36ec957305a889ac29f0da30e/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoHelper.java#L55 102build --compilation_mode=opt 103 104common --incompatible_remove_rule_name_parameter=false 105 106# TODO(b/264304464): Remove when bugs with java_binary starlark impl are fixed. 107 108common --experimental_builtins_injection_override=-java_binary 109 110# Set writable bit for all bazel outputs. This makes it easy to remove 111# the output directory and its contents after a build (using `rm`). 112build --experimental_writable_outputs 113 114# Make the Linux sandbox work under /tmp 115build --incompatible_sandbox_hermetic_tmp 116