blob: c451fbc81ecb22d28a1d2f341da581d1ee6eda77 [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
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.
# If we prefix the directories with an underscore then they get ignored by Go tools.
# We are forced to do this until is fixed.
build --symlink_prefix=_bazel_
# test inherits from build, so do not add test flags because that
# ends up invalidating the cache.
# test --symlink_prefix=_bazel_
build --workspace_status_command=bazel/
# Tags such as no-remote and no-cache have no effect without this. See
build --experimental_allow_tags_propagation
# 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=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.
# 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
# Sass compilation errors are not correctly reported unless "bazel build" is invoked with this flag.
# This is due to a known issue with sass_binary.
# For more details please see
build --strategy=SassCompiler=sandboxed
# Rough equivalent of CGO_ENABLED=0 under Bazel. Produces statically-linked Go binaries, and
# filters out cgo code.
# See
# This prevents errors due to missing dynamic libraries, e.g. when running Bazel-built binaries
# inside Docker containers based on the image.
build --@io_bazel_rules_go//go/config:pure
# 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=//bazel/rbe/generated/java:jdk
build:remote --javabase=//bazel/rbe/generated/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=//bazel/rbe/generated/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:
build:remote --extra_toolchains=//bazel/rbe/generated/config:cc-toolchain
build:remote --extra_execution_platforms=//:rbe_custom_platform
build:remote --host_platform=//:rbe_custom_platform
build:remote --platforms=//:rbe_custom_platform
# Starting with Bazel 0.27.0 strategies do not need to be explicitly
# defined. See
build:remote --define=EXECUTOR=remote
# Enable remote execution so actions are performed on the remote systems.
build:remote --remote_executor=grpcs://
# 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.
build:remote --google_default_credentials=true
# Use the RBE instance on the skia-infra-rbe GCP project.
build:remote --remote_instance_name projects/skia-infra-rbe/instances/default_instance
# Skip building the runfiles tree on the local system when building on RBE. This can be very slow,
# and is unnecessary for RBE builds because remote build actions will generate their own runfile
# tree anyway. See b/111951625.
build:remote --nobuild_runfile_links
# Note that running remote builds requires a service account key with the correct permissions. See
# instructions in //
# Alias to build configurations below. This makes configuring things from
# the command line easier.
build --flag_alias=with_local_debugger=no//debugger-app/wasm_libs:use_debugger_from_container
build --flag_alias=with_local_wasm=no//jsfiddle/wasm_libs:use_libraries_from_container
build --flag_alias=particles_local_canvaskit=no//particles/wasm_libs:use_canvaskit_from_container
build --flag_alias=shaders_local_canvaskit=no//shaders/wasm_libs:use_canvaskit_from_container
build --flag_alias=skottie_local_canvaskit=no//skottie/wasm_libs:use_canvaskit_from_container