| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/toolchain/rbe_modes.gni") |
| |
| declare_args() { |
| # Configure bazel to build remotely with RBE where supported. |
| # This can speed up builds via remote caching. |
| # This option requires that bazel invocations have direct |
| # external network access, and that users are authenticated to |
| # access a remote execution service. |
| # The Remote Execution API can be found at: |
| # https://github.com/bazelbuild/remote-apis |
| # For an overview of remote execution for Bazel, see https://bazel.build/remote/rbe |
| enable_bazel_remote_rbe = rbe_settings.bazel_enable |
| |
| # When bazel is configured to use RBE, this controls the execution strategy |
| # that is used. |
| # |
| # Supported options: |
| # "remote": on cache-miss, build remotely (default) |
| # "local": on cache-miss, build locally |
| # "nocache": force execution, as if cache-miss. |
| bazel_rbe_exec_strategy = rbe_settings.bazel_exec_strategy |
| |
| # Control what bazel remote-built outputs are downloaded. |
| # See https://bazel.build/reference/command-line-reference#flag--remote_download_outputs |
| # Valid options: all, minimal, toplevel (default since Bazel 7.1) |
| # - 'toplevel' and 'minimal' can save significant download bandwidth |
| # - 'all' is useful for debugging remote build issues |
| bazel_rbe_download_outputs = rbe_settings.bazel_download_outputs |
| |
| # Configure bazel to stream build events and results to a service. |
| # This is useful for sharing build results and invocation details |
| # for reproducing and triaging issues. |
| # This option uses direct network access and requires authentication. |
| # The _infra variants are intended for use in build infrastructure. |
| # More information can be found at: |
| # https://bazel.build/remote/bep#build-event-service |
| # |
| # Valid options: |
| # "": do not stream (default) |
| # "sponge": uploads to Sponge2 (for users) |
| # "sponge_infra": uploads to Sponge2 (for infra) |
| # "resultstore": uploads to ResultStore (for users) |
| # "resultstore_infra": uploads to ResultStore (for infra) |
| bazel_upload_build_events = "" |
| } |
| |
| assert( |
| bazel_upload_build_events == "" || bazel_upload_build_events == "sponge" || |
| bazel_upload_build_events == "sponge_infra" || |
| bazel_upload_build_events == "resultstore" || |
| bazel_upload_build_events == "resultstore_infra", |
| "Valid choices for bazel_upload_build_events are: \"\", \"sponge\", \"sponge_infra\", \"resultstore\", \"resultstore_infra\".") |