blob: c1769007292988646ac8dc52b77e9ebc85d13392 [file] [log] [blame]
# Options applied to all Bazel invocations in the workspace.
# This file is copied to //tools/bazel.rc from
# //tools/base/bazel/toplevel.bazel.rc by repo init.
# Required for remote caching using hazelcast REST protocol.
startup --host_jvm_args=-Dbazel.DigestFunction=SHA1
# 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'
# 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
build --sandbox_tmpfs_path=/tmp
build --javacopt="-g:source,lines,vars" # Keep debug info
build --javacopt=-Xep:FallThrough:OFF # enforcing Google style, essentially
build --cxxopt=-std=c++11
build --copt=-fvisibility=hidden
build:release --copt=-fdata-sections
build:release --cxxopt=-fdata-sections
build:release --copt=-fno-exceptions
build:release --cxxopt=-fno-exceptions
build:release --copt=-ffunction-sections
build:release --cxxopt=-ffunction-sections
build:release -c opt
# 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
# Remote execution configuration
build:remote --remote_instance_name=projects/google.com:android-studio-alphasource
build:remote --strategy=CppCompile=remote
build:remote --strategy=CppLink=remote
# Remote Build Execution requires a strong hash function, such as SHA256.
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
# 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 --jobs=50
# Import several flags related to specifying the toolchain and (if applicable)
# java properties.
#import %workspace%/configs/debian8_clang/0.2.0/toolchain.bazelrc
build:remote --host_javabase=@bazel_toolchains//configs/debian8_clang/0.2.0:jdk8
build:remote --javabase=@bazel_toolchains//configs/debian8_clang/0.2.0:jdk8
build:remote --crosstool_top=@bazel_toolchains//configs/debian8_clang/0.2.0/bazel_0.8.0:toolchain
build:remote --experimental_remote_platform_override='properties:{ name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:e79e367aab94c6f18a0b39950fe4f160fda07ee01e3c32604c5f8472afa7c1f0" }'
# Set various strategies so that all actions execute remotely. Mixing remote
# and local execution will lead to errors unless the toolchain and remote
# machine exactly match the host machine.
build:remote --spawn_strategy=remote
build:remote --strategy=Javac=remote
build:remote --strategy=Closure=remote
build:remote --genrule_strategy=remote
build:remote --define=EXECUTOR=remote
# Enable the remote cache so action results can be shared across machines,
# developers, and workspaces.
build:remote --remote_cache=remotebuildexecution.googleapis.com
# Enable remote execution so actions are performed on the remote systems.
build:remote --remote_executor=remotebuildexecution.googleapis.com
# Enable encryption.
build:remote --tls_enabled=true
# Enforce stricter environment rules, which eliminates some non-hermetic
# behavior and therefore improves both the remote cache hit rate and the
# correctness and repeatability of the build.
build:remote --experimental_strict_action_env=true
# Set a higher timeout value, just in case.
build:remote --remote_timeout=3600
# Enable authentication. This will pick up application default credentials by
# default. You can use --auth_credentials=some_file.json to use a service
# account credential instead.
build:remote --auth_enabled=true