blob: 24c618bbd05545ecfe5817cdcb9c026377bd8ade [file] [log] [blame]
# Options applied to all Bazel invocations in the workspace.
# This file is imported by the os-specific rc files.
# Those are included by the bazel wrapper scripts (bazel and bazel.cmd)
# Remote Build Execution requires a strong hash function, such as SHA256.
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
# For now we require python 2
build --host_force_python=PY2
# 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:+UseConcMarkSweepGC'
test --verbose_failures
# 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
build --incompatible_strict_action_env # Ensures actions don't pick up env changes
build --sandbox_tmpfs_path=/tmp
build --javacopt="-g:source,lines,vars" # Keep debug info
# 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
# Use prebuilt JDK when doing local bazel build/test
build --host_javabase=//prebuilts/studio/jdk:jdk11_runtime
build --javabase=//prebuilts/studio/jdk:jdk11_runtime
build --host_java_toolchain=@bazel_tools//tools/jdk:legacy_toolchain
build --java_toolchain=@bazel_tools//tools/jdk:legacy_toolchain
# Use prebuilt native toolchain
build --crosstool_top=@native_toolchain//:toolchain
# Report errorprone errors as warnings to avoid failing the build.
# Temporary until http://b/180537631 is resolved.
build --javacopt="-XepAllErrorsAsWarnings"
# cpp sandbox is very slow on mac and linux
build --strategy=CppCompile=standalone
build --strategy=CppLink=standalone
build --strategy=CcStrip=standalone
build --stripopt=--strip-unneeded
# default android native abis
build --fat_apk_cpu=x86,x86_64,armeabi-v7a,armeabi,arm64-v8a
build:release -c opt
build:release --strip=always
build:release --define release=true
# Set flags for uploading to ResultStore
build:cloud_resultstore --bes_backend=buildeventservice.googleapis.com
build:cloud_resultstore --bes_results_url=https://source.cloud.google.com/results/invocations/
build:cloud_resultstore --bes_timeout=60s
build:cloud_resultstore --auth_scope=https://www.googleapis.com/auth/cloud-source-tools
build:cloud_resultstore --project_id=908081808034
build:cloud_resultstore --auth_credentials=tools/vendor/adt_infra_internal/rbe/data/studio-alphasource-credentials.json
build:cloud_resultstore --remote_cache=remotebuildexecution.googleapis.com
build:cloud_resultstore --remote_instance_name=projects/google.com:android-studio-alphasource/instances/default_instance
# Disable writing to the remote cache by default. This allows test results to still be written, but
# writing to the action cache will be disabled.
build:cloud_resultstore --remote_upload_local_results=false
build:remote_common --config=cloud_resultstore
# Enable uploading to the remote cache so all remote action results can be shared
build:remote_common --remote_upload_local_results=true
build:remote_common --remote_timeout=3600
# Mimics the release config to report accurate performance numbers in tests.
build:remote_common --config=release
build:remote --config=remote_common
build:remote --nobuild_runfile_links
build:remote --strategy=CppCompile=remote
build:remote --strategy=CppLink=remote
build:remote --show_timestamps
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# Enable remote execution so actions are performed on the remote systems.
build:remote --remote_executor=remotebuildexecution.googleapis.com
# Enable jvmopt used for Foundry testing
test:remote --jvmopt='-Dandroid.remote.run=true'
# Stop downloading of build outputs to the local machine and
# removes a possibility of network/disk bottlenecks when using RBE.
build:remote --remote_download_toplevel
# Persistent workers
build --worker_verbose # Increases visibility in case there are issues.
build:dynamic --config=remote
# Enable dynamic scheduling. This will run some actions locally
# # as well as remotely, choosing whichever finishes first.
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
# 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
# Studio build actions, see b/171900265 for details
build:dynamic --strategy=zipper=dynamic
build:dynamic --strategy=zipmerger=dynamic
build:dynamic --strategy=chkplugin=dynamic
build:dynamic --strategy=stamper=dynamic
build:dynamic --strategy=PythonZipper=dynamic
# We want to use persistent workers, if supported (Javac, kotlinc, formc)
build:dynamic --dynamic_local_strategy=worker,sandboxed,local
# Prevents b/156952249. Android Build (buildbot) kills bazel between builds,
# so there is no need to keep workers alive after the build.
build:dynamic --worker_quit_after_build
# Disables verbose failures to avoid triggering --materialize_param_files, see
# b/160150358#comment30
build:dynamic --noverbose_failures