|
| 1 | +# ------------------------------ |
| 2 | +# This file is taken from the "bazel-toolchains" repository and is used in order to reduce the |
| 3 | +# manual configuration overhead. https://github.com/bazelbuild/bazel-toolchains/tree/master/bazelrc |
| 4 | +# ------------------------------ |
| 5 | + |
| 6 | +# Copyright 2016 The Bazel Authors. All rights reserved. |
| 7 | +# |
| 8 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | +# you may not use this file except in compliance with the License. |
| 10 | +# You may obtain a copy of the License at |
| 11 | +# |
| 12 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +# |
| 14 | +# Unless required by applicable law or agreed to in writing, software |
| 15 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | +# See the License for the specific language governing permissions and |
| 18 | +# limitations under the License. |
| 19 | + |
| 20 | +# Depending on how many machines are in the remote execution instance, setting |
| 21 | +# this higher can make builds faster by allowing more jobs to run in parallel. |
| 22 | +# Setting it too high can result in jobs that timeout, however, while waiting |
| 23 | +# for a remote machine to execute them. |
| 24 | +build:remote --jobs=50 |
| 25 | + |
| 26 | +# Set several flags related to specifying the platform, toolchain and java |
| 27 | +# properties. |
| 28 | +# These flags are duplicated rather than imported from (for example) |
| 29 | +# %workspace%/configs/ubuntu16_04_clang/1.1/toolchain.bazelrc to make this |
| 30 | +# bazelrc a standalone file that can be copied more easily. |
| 31 | +# These flags should only be used as is for the rbe-ubuntu16-04 container |
| 32 | +# and need to be adapted to work with other toolchain containers. |
| 33 | +build:remote --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 |
| 34 | +build:remote --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 |
| 35 | +build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 |
| 36 | +build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 |
| 37 | +build:remote --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/default:toolchain |
| 38 | +build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 |
| 39 | +# Platform flags: |
| 40 | +# The toolchain container used for execution is defined in the target indicated |
| 41 | +# by "extra_execution_platforms", "host_platform" and "platforms". |
| 42 | +# If you are using your own toolchain container, you need to create a platform |
| 43 | +# target with "constraint_values" that allow for the toolchain specified with |
| 44 | +# "extra_toolchains" to be selected (given constraints defined in |
| 45 | +# "exec_compatible_with"). |
| 46 | +# More about platforms: https://docs.bazel.build/versions/master/platforms.html |
| 47 | +build:remote --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/cpp:cc-toolchain-clang-x86_64-default |
| 48 | +build:remote --extra_execution_platforms=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604 |
| 49 | +build:remote --host_platform=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604 |
| 50 | +build:remote --platforms=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:rbe_ubuntu1604 |
| 51 | + |
| 52 | +# Set various strategies so that all actions execute remotely. Mixing remote |
| 53 | +# and local execution will lead to errors unless the toolchain and remote |
| 54 | +# machine exactly match the host machine. |
| 55 | +build:remote --spawn_strategy=remote |
| 56 | +build:remote --strategy=Javac=remote |
| 57 | +build:remote --strategy=Closure=remote |
| 58 | +build:remote --genrule_strategy=remote |
| 59 | +build:remote --define=EXECUTOR=remote |
| 60 | + |
| 61 | +# Enable the remote cache so action results can be shared across machines, |
| 62 | +# developers, and workspaces. |
| 63 | +build:remote --remote_cache=remotebuildexecution.googleapis.com |
| 64 | + |
| 65 | +# Enable remote execution so actions are performed on the remote systems. |
| 66 | +build:remote --remote_executor=remotebuildexecution.googleapis.com |
| 67 | + |
| 68 | +# Enable encryption. |
| 69 | +build:remote --tls_enabled=true |
| 70 | + |
| 71 | +# Enforce stricter environment rules, which eliminates some non-hermetic |
| 72 | +# behavior and therefore improves both the remote cache hit rate and the |
| 73 | +# correctness and repeatability of the build. |
| 74 | +build:remote --experimental_strict_action_env=true |
| 75 | + |
| 76 | +# Set a higher timeout value, just in case. |
| 77 | +build:remote --remote_timeout=3600 |
| 78 | + |
| 79 | +# Enable authentication. This will pick up application default credentials by |
| 80 | +# default. You can use --auth_credentials=some_file.json to use a service |
| 81 | +# account credential instead. |
| 82 | +build:remote --auth_enabled=true |
| 83 | + |
| 84 | +# Set flags for uploading to BES in order to view results in the Bazel Build |
| 85 | +# Results UI. |
| 86 | +build:results --bes_backend="buildeventservice.googleapis.com" |
| 87 | +build:results --bes_timeout=60s |
| 88 | +build:results --tls_enabled |
| 89 | + |
| 90 | +# Output BES results url |
| 91 | +build:results --bes_results_url="https://source.cloud.google.com/results/invocations/" |
| 92 | + |
| 93 | +# Set flags for uploading to BES without Remote Build Execution. |
| 94 | +build:results-local --bes_backend="buildeventservice.googleapis.com" |
| 95 | +build:results-local --bes_timeout=60s |
| 96 | +build:results-local --tls_enabled=true |
| 97 | +build:results-local --auth_enabled=true |
| 98 | +build:results-local --spawn_strategy=local |
| 99 | +build:results-local --remote_cache=remotebuildexecution.googleapis.com |
| 100 | +build:results-local --remote_timeout=3600 |
| 101 | +build:results-local --bes_results_url="https://source.cloud.google.com/results/invocations/" |
| 102 | + |
| 103 | +# The following flags are only necessary for local docker sandboxing |
| 104 | +# with the rbe-ubuntu16-04 container. Use of these flags is still experimental. |
| 105 | +build:docker-sandbox --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 |
| 106 | +build:docker-sandbox --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 |
| 107 | +build:docker-sandbox --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.1/bazel_0.18.0/default:toolchain |
| 108 | +build:docker-sandbox --experimental_docker_image=gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:9bd8ba020af33edb5f11eff0af2f63b3bcb168cd6566d7b27c6685e717787928 |
| 109 | +build:docker-sandbox --spawn_strategy=docker |
| 110 | +build:docker-sandbox --strategy=Javac=docker |
| 111 | +build:docker-sandbox --strategy=Closure=docker |
| 112 | +build:docker-sandbox --genrule_strategy=docker |
| 113 | +build:docker-sandbox --define=EXECUTOR=remote |
| 114 | +build:docker-sandbox --experimental_docker_verbose |
| 115 | +build:docker-sandbox --experimental_enable_docker_sandbox |
| 116 | + |
| 117 | +# The following flags enable the remote cache so action results can be shared |
| 118 | +# across machines, developers, and workspaces. |
| 119 | +build:remote-cache --remote_cache=remotebuildexecution.googleapis.com |
| 120 | +build:remote-cache --tls_enabled=true |
| 121 | +build:remote-cache --experimental_strict_action_env=true |
| 122 | +build:remote-cache --remote_timeout=3600 |
| 123 | +build:remote-cache --auth_enabled=true |
| 124 | +build:remote-cache --spawn_strategy=standalone |
| 125 | +build:remote-cache --strategy=Javac=standalone |
| 126 | +build:remote-cache --strategy=Closure=standalone |
| 127 | +build:remote-cache --genrule_strategy=standalone |
0 commit comments