blob: a2ad958db77e7d41c56e05ff8c53dc09cfc84cfb [file] [log] [blame]
# Platforms and toolchains for AOSP.
#
# Set default target platform for builds to rely on product config's arch and os variables
build --platforms //build/bazel/platforms:linux_x86_64
build --platform_mappings=build/bazel/platforms/platform_mappings
build:android --platforms=//build/bazel/platforms:android_target
build:linux_x86_64 --platforms=//build/bazel/platforms:linux_x86_64
# Ban command line usage of setting --platforms to anything other than
# android_target and host linux. The target platform should be determined by
# product config / lunch.
startup --invocation_policy="flag_policies { flag_name: \"platforms\" allow_values { allowed_values: \"//build/bazel/platforms:android_target\", allowed_values: \"//build/bazel/platforms:linux_x86_64\"}}"
# Use the target platform (android_x86, android_arm) in the bazel-out/ output
# directory name fragment instead of the CPU (darwin, k8). This avoids
# thrashing the output directory when switching between top level target
# --platforms values.
build --experimental_platform_in_output_dir
# Use toolchain resolution to find the cc toolchain.
build --incompatible_enable_cc_toolchain_resolution
# Ensure that the host_javabase always use @local_jdk, the checked-in JDK.
build --tool_java_runtime_version=local_jdk
build --java_runtime_version=local_jdk
# Disable errorprone to continue making progress on java and android conversion
# while we determine how errorprone will be handled in Bazel-only builds b/227504307.
# TODO(b/227504307): Remove --javacopt="-XepDisableAllChecks" after implementing
# the correct solution around errorprone.
build --javacopt="-XepDisableAllChecks"
# Lock down the PATH variable in actions to /usr/bin and /usr/local/bin.
build --experimental_strict_action_env
# Explicitly allow unresolved symlinks (it's an experimental Bazel feature)
build --experimental_allow_unresolved_symlinks
# Enable usage of experimental cc-related build APIs
build --experimental_cc_shared_library
build --experimental_starlark_cc_import
# Do not tokenize copts, other than strings that consist of a single Make
# variable. This prevents the need to double-escape characters like backslashes
# and quotes in copts.
build --features no_copts_tokenization
# Disable local cpp toolchain detection, as it is explicitly declared in AOSP.
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build --proto_compiler=//external/protobuf:aprotoc
# Disable sandboxing for CppCompile actions, as headers are not fully specified.
# TODO(b/186116353): This is a temporary fix, as appropriately-sandboxed actions
# are a long term goal.
build --strategy=CppCompile=standalone
# Enable use of the implementation_deps attribute in native cc rules
build --experimental_cc_implementation_deps
# Use the llvm_coverage_map_format feature to turn on native code coverage.
build --experimental_use_llvm_covmap
# Always emit the stdout of failing tests as they should be emphasized. (b/247516541)
test --test_output=errors
# Enable building targets in //external:__subpackages__.
common --experimental_sibling_repository_layout
common --experimental_disable_external_package
# Increase refresh rate of command line UI for improved perceived responsiveness.
common --show_progress_rate_limit=0.05
# These are disabled when running under soong_ui (default = auto). Force enable them here.
common --color=yes
common --curses=yes
# Run bazel query from the workspace, without cd'ing into out/soong/queryview
# Note that this hardcodes the output dir. It will not work if $OUT_DIR != out.
common:queryview --package_path=%workspace%/out/soong/queryview
# Run bazel build from the workspace, without cd'ing into out/soong/api_bp2build
# Note that this hardcodes the output dir. It will not work if $OUT_DIR != out.
common:api_bp2build --package_path=%workspace%/out/soong/api_bp2build
# Run bazel query from the workspace, without cd'ing into out/soong/workspace
# Note that this hardcodes the output dir. It will not work if $OUT_DIR != out.
common:bp2build --package_path=%workspace%/out/soong/workspace
# Configurations specific to CI builds, generally to improve signal-to-noise ratio in server logs.
common:ci --color=no
common:ci --curses=no
common:ci --show_progress_rate_limit=5
common:ci --noshow_loading_progress
# Show the full set of flags for observability and debuggability.
common:ci --announce_rc
build:ci --verbose_failures
# Log apexer verbosely on CI (it has a noisy but useful output)
build:ci --//build/bazel/rules/apex:apexer_verbose
test:ci --keep_going
# Support a local user-specific bazelrc file.
try-import %workspace%/user.bazelrc
common --experimental_google_legacy_api
build --android_sdk=//prebuilts/sdk:android_sdk
build --experimental_enable_android_migration_apis
build --incompatible_java_common_parameters
build --android_databinding_use_v3_4_args
build --experimental_android_databinding_v2
build --define=android_incremental_dexing_tool=d8_dexbuilder
build --define=android_dexmerger_tool=d8_dexmerger
build --nouse_workers_with_dexbuilder
# TODO(b/240761789): This flag should be abandoned in favor of platform/toolchain resolution.
build --fat_apk_cpu=k8
# TODO(b/199038020): Use a python_toolchain when we have Starlark rules_python.
# This also means all python scripts are using py3 runtime.
build --python_top=//prebuilts/build-tools:python3
build --noincompatible_use_python_toolchains