blob: 895c5abd9f22106be284c9fdecbbd6abb3defb6a [file] [log] [blame]
# Enables the use of native symlinks in worker sandboxes,
# required for dynamic scheduling. This has no effect on non-windows platforms.
startup --windows_enable_symlinks
# Platform specific config automatically applies --config=(linux|macos|windows)
common --enable_platform_specific_config
# Remote Build Execution requires a strong hash function, such as SHA256.
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
# resource_jars are removed in Bazel 5.0, prevent new usages from being added.
# Once Bazel is upgraded (b/220902606) this can be removed.
build --incompatible_disallow_resource_jars
# Enforces UTF-8 encoding in bazel tests.
test --test_env='LC_ALL=en_US.UTF-8'
test --jvmopt='-Dsun.jnu.encoding=UTF-8'
test --jvmopt='-Dfile.encoding=UTF-8'
test --jvmopt='-Xmx4G'
test --jvmopt='-XX:+UseG1GC'
test --jvmopt='-XX:ErrorFile=$TEST_UNDECLARED_OUTPUTS_DIR/jvm_crash.log'
test --verbose_failures
# TODO(b/242203555) cleanup opens/exports that was added for JDK17 migration
test:jdk17 --jvmopt='--add-opens=java.base/java.io=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.base/java.lang=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.base/java.nio.charset=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.base/java.util=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.base/java.util.concurrent=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/java.awt=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/java.awt.event=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/javax.swing=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/sun.awt=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-opens=java.desktop/sun.font=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports java.base/jdk.internal.vm=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports=java.desktop/sun.java2d=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports=java.desktop/sun.swing=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports=jdk.attach/sun.tools.attach=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED'
test:jdk17 --jvmopt='--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports java.base/jdk.internal.vm=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports=java.desktop/sun.java2d=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports=java.desktop/sun.swing=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports=jdk.attach/sun.tools.attach=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED'
build:jdk17 --jvmopt='--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED'
# Local runs require longer timeouts.
test:local --test_timeout=120,600,1800,7200
# Don't use JUnit from Bazel.
test --explicit_java_test_deps
# Tests depend on not having a real user name, but bazel now returns the
# real one. This flag keeps the old behavior of not having a home directory.
test --sandbox_fake_username
test --sandbox_tmpfs_path=/tmp
test:ignored --jvmopt=-Dignored.tests.only=true
# Attach aspects for validation of targets
test --aspects=tools/base/bazel/validations/timeout.bzl%no_eternal_tests
test --aspects=tools/base/bazel/validations/flaky.bzl%limit_flaky_tests
test --aspects=tools/base/bazel/validations/py2.bzl%no_py2_targets
build --aspects=tools/base/bazel/validations/exec_props.bzl%limit_exec_properties
# Generates a ${TARGET}.datasize.txt output which shows the size of data
# dependencies for each target. See the aspect definition for more.
build:datasize_aspect --aspects=tools/base/bazel/validations/size.bzl%data_size
build:datasize_aspect --output_groups=+data_size
build --incompatible_strict_action_env # Ensures actions don't pick up env changes
build --sandbox_tmpfs_path=/tmp
# TODO (b/141269926): this generates a warning on windows when building for host,
# but is required when building for android.
build --copt=-fvisibility=hidden
build --define=grpc_no_ares=true
# Forwards the system $SHELL environment variable so remote execution of bazel
# finds make in the ndk-build script (see b/72179674).
build --test_env=SHELL
# Bazel will find the matching java toolchain registered in WORKSPACE.
build --java_language_version=8
build --java_runtime_version=jdk11
build --tool_java_runtime_version=jdk11
# Use prebuilt native toolchain
build --crosstool_top=@native_toolchain//:toolchain
# cpp sandbox is very slow on mac and linux
build --strategy=CppCompile=local
build --strategy=CppLink=local
build --strategy=CcStrip=local
build --stripopt=--strip-unneeded
# lnzipper expects workspace filesystem state (i.e. symlinks) which may not
# be the same when run inside a sandbox or remotely.
build --strategy=lnzipper=local
# Do not register auto-generated cpp toolchains
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# default android native abis
build --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a
## Options to make bazel less memory/cpu intensive.
## Recommended to use with rcache config to avoid building outputs already
## present in the remote cache.
build:nice --worker_max_instances=1
build:nice --jobs=HOST_CPUS*.5
# Optimize c/c++ compilation.
# See tools/base/bazel/toolchains/clang.BUILD for flags added in opt mode
build:release -c opt
build:release --strip=always
build:release --define release=true
# Disable Clang diagnostics for release builds, to reduce the amount of noise
# # in the output in continuous builds and --config=remote runs.
build:release --copt=-w
## Base RBE configuration
build:_remote_base --bes_timeout=240s
build:_remote_base --project_id=908081808034
build:_remote_base --google_default_credentials
build:_remote_base --remote_cache=remotebuildexecution.googleapis.com
build:_remote_base --remote_instance_name=projects/google.com:android-studio-alphasource/instances/default_instance
# Building runfile trees is unnecessary, unless executing binaries in bazel-bin/ manually (use 'bazel run' instead)
# See: https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
build:_remote_base --nobuild_runfile_links
# Input file attribute affects the output of zipper. It should always run
# locally (b/198297058#comment42)
build:_remote_base --strategy=zipper=local
# Publish to the private BES backend.
build:sponge --bes_backend=buildeventservice-pa.googleapis.com
build:sponge --bes_results_url=https://fusion2.corp.google.com/invocations/
build:sponge --bes_header=X-Goog-User-Project=google.com:android-studio-alphasource
build:sponge --workspace_status_command="python3 tools/base/bazel/workspace.py"
# Enable go/antswatcher to process test results.
# This config must be used with the sponge config as it relies on the same bes_backend.
# NOTE: Bazel invocations must still supply --build_metadata values for ab_target and ab_build_id
# to be create a successful AnTS result.
build:ants --bes_keywords=android-test-storage
build:ants --build_metadata="test_definition_name=android_studio/bazel"
build:ants --build_metadata=generate_test_uri=fusion
build:ants --build_metadata=run_type=critical
build:ants --build_metadata=parallel_test_results=true
## Base config for using the remote cache.
## This avoids building things which were already built by CI.
build:_rcache --config=_remote_base
build:_rcache --config=release
build:_rcache --noremote_upload_local_results
# remote_local_fallback allows bazel to continue if there are
# network connectivity failures (e.g., offline)
build:_rcache --remote_local_fallback
# NOWAIT_FOR_UPLOAD_COMPLETE speeds up bazel slightly by returning when the
# build is complete, not when BES upload finishes.
# This improves offline use cases as well, otherwise bazel does not complete
# until the BES upload times out (10 seconds).
build:_rcache --bes_upload_mode=NOWAIT_FOR_UPLOAD_COMPLETE
## Enables the remote cache and uploading to Sponge.
## This config should be commonly used to avoid building outputs that
## already exist in the cache.
build:rcache --config=_rcache
build:rcache --config=sponge
## Enables the remote cache, but without uploading to Sponge (for hosts with
## poor uplink).
build:rcache_no_sponge --config=_rcache
## Enables remote execution so actions are performed on the remote systems.
build:remote-exec --remote_executor=remotebuildexecution.googleapis.com
build:remote-exec --remote_timeout=3600
build:remote-exec --strategy=CppCompile=remote
build:remote-exec --strategy=CppLink=remote
build:remote-exec --show_timestamps
# Depending on how many machines are in the remote execution instance, setting
# this higher can make builds faster by allowing more jobs to run in parallel.
# Setting it too high can result in jobs that timeout, however, while waiting
# for a remote machine to execute them.
build:remote-exec --jobs=350
## Remote combines all the configs used for remote execution.
build:remote --config=_remote_base
build:remote --config=remote-exec
build:remote --config=release
build:remote --config=sponge
## Config used for continous integration testing scripts.
build:ci --config=_remote_base
build:ci --config=dynamic
build:ci --config=sponge
build:ci --config=release
# Increase worker visibility in case there are issues.
build:ci --worker_verbose
# Prevents b/156952249. Android Build (buildbot) kills bazel between builds,
# so there is no need to keep workers alive after the build.
build:ci --worker_quit_after_build
# The CI runs a lot of targets and when they are all cached the BES upload
# may take a long time.
build:ci --bes_timeout=600s
## Enables dynamic scheduling. This will run some actions locally
## as well as remotely, choosing whichever finishes first.
build:dynamic --config=remote-exec
build:dynamic --internal_spawn_scheduler
build:dynamic --strategy=Javac=dynamic
build:dynamic --strategy=kotlinc=dynamic
build:dynamic --strategy=formc=dynamic
build:dynamic --strategy=singlejar=dynamic
build:dynamic --strategy=MergedZip=dynamic
build:dynamic --strategy=CreateJvmCompileJar=dynamic
# Configure auxiliary java mnemonics to run dynamically
build:dynamic --strategy=JavaIjar=dynamic
build:dynamic --strategy=JavaDeployJar=dynamic
build:dynamic --strategy=JavaSourceJar=dynamic
build:dynamic --strategy=Turbine=dynamic
build:dynamic --strategy=JavacTurbine=dynamic
# Studio build actions, see b/171900265 for details
build:dynamic --strategy=zipmerger=dynamic
build:dynamic --strategy=chkplugin=dynamic
build:dynamic --strategy=stamper=dynamic
build:dynamic --strategy=PythonZipper=dynamic
# Disables verbose failures to avoid triggering --materialize_param_files, see
# b/160150358#comment30
build:dynamic --noverbose_failures
# Multiplex workers are not sandboxed, and are not ready to be used with
# dynamic scheduling.
build:dynamic --noexperimental_worker_multiplex
build:without_vendor --repo_env=SETUP_VENDOR=0