blob: 2fac18b5bbc963cefe8cf16c22de0d7ca8f339b9 [file] [log] [blame]
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
build --workspace_status_command=bazel/get_workspace_status.sh
# Tags such as no-remote and no-cache have no effect without this. See
# https://github.com/bazelbuild/bazel/issues/8830.
build --experimental_allow_tags_propagation
# Prevent the following rules_docker error due to incompatibilities with Bazel 4.0.0:
#
# ~/.cache/bazel/[...]/io_bazel_rules_docker/container/push.bzl:34:28:
# invalid escape sequence: \{.
#
# We should remove this flag once a new release of rules_docker is available.
build --incompatible_restrict_string_escapes=false
# Pipe through the host system's *_EMULATOR_HOST environment variables to Bazel tests.
#
# We unset said environment variables under RBE because emulator tests under RBE spin up their own
# emulator instances.
build --test_env=BIGTABLE_EMULATOR_HOST
build --test_env=COCKROACHDB_EMULATOR_HOST
build --test_env=DATASTORE_EMULATOR_HOST
build --test_env=FIRESTORE_EMULATOR_HOST
build --test_env=PUBSUB_EMULATOR_HOST
build:remote --test_env=BIGTABLE_EMULATOR_HOST=
build:remote --test_env=COCKROACHDB_EMULATOR_HOST=
build:remote --test_env=DATASTORE_EMULATOR_HOST=
build:remote --test_env=FIRESTORE_EMULATOR_HOST=
build:remote --test_env=PUBSUB_EMULATOR_HOST=
# Pipe through GOOGLE_APPLICATION_CREDENTIALS for local tests. This breaks test hermeticity, so use
# judiciously. Most tests that depend on this variable should probably tagged with "no-remote".
#
# We clear this variable under build:remote because if set, it will most likely contain a path to a
# file in the host system, which could potentially point to a nonexisting file within the RBE
# container when Bazel is invoked with --config=remote.
build --test_env=GOOGLE_APPLICATION_CREDENTIALS
build:remote --test_env=GOOGLE_APPLICATION_CREDENTIALS=
# RBE-only environment variable for tests to detect whether they're running locally or on RBE.
build:remote --test_env=BAZEL_REMOTE=true
# Update the PATH environment variable under RBE to include the locations of various binaries
# installed in our custom RBE container toolchain image.
build:remote --test_env=PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/go/bin:/cipd:/cipd/bin
# 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
# Set several flags related to specifying the platform, toolchain and java
# properties.
# These flags should only be used as is for the rbe-ubuntu16-04 container
# and need to be adapted to work with other toolchain containers.
build:remote --host_javabase=@rbe_default//java:jdk
build:remote --javabase=@rbe_default//java:jdk
build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --crosstool_top=@rbe_default//cc:toolchain
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# Platform flags:
# The toolchain container used for execution is defined in the target indicated
# by "extra_execution_platforms", "host_platform" and "platforms".
# More about platforms: https://docs.bazel.build/versions/master/platforms.html
build:remote --extra_toolchains=@rbe_default//config:cc-toolchain
build:remote --extra_execution_platforms=@rbe_default//config:platform
build:remote --host_platform=@rbe_default//config:platform
build:remote --platforms=@rbe_default//config:platform
# Starting with Bazel 0.27.0 strategies do not need to be explicitly
# defined. See https://github.com/bazelbuild/bazel/issues/7480
build:remote --define=EXECUTOR=remote
# Enable remote execution so actions are performed on the remote systems.
build:remote --remote_executor=grpcs://remotebuildexecution.googleapis.com
# 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 --incompatible_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 --google_credentials=some_file.json to use a service
# account credential instead.
build:remote --google_default_credentials=true
# Use this project's RBE instance.
build:remote --remote_instance_name projects/skia-public/instances/default_instance