blob: d575e6d2479307f227a5ed37b37dc9865741bb76 [file] [log] [blame]
# Importing container/environment-specific configuration
# (autogenerated by generate_bazelrc.sh)
try-import %workspace%/generated.bazelrc
# This passes through the CONTAINER_IMAGE_DIGEST environment variable to all
# action environments. It is populated by build.sh and dev.sh with a hash of
# the build container image. This effectively partitions the cache by container
# image, avoiding incorrect cache hits (Bazel does not otherwise account for
# dependencies outside of the workspace).
build --action_env=CONTAINER_IMAGE_DIGEST
test --action_env=CONTAINER_IMAGE_DIGEST
# Don't show inactionable warnings when building (not using) external deps.
build --output_filter='^//((?!(external):).)*$'
# Always true in TensorFlow's .bazelrc
build --define=open_source_build=true
# Monolithic build (i.e. no libtensorflow_framework.so)
# The non-monolithic build seems to fail currently, due to symbols missing from
# libtensorflow_framework.so but needed by its dependencies. It is likely that
# this Bazel change is related: https://github.com/bazelbuild/bazel/issues/7362
build --define=framework_shared_object=false
# Without this the build of some TF ops fails with "'dnnl.hpp' file not found".
# TF specifies the flag for all Linux builds by default as well
# (https://github.com/tensorflow/tensorflow/blob/1cb1a030a62b169d90d34c747ab9b09f332bf905/.bazelrc#L228).
build --define=build_with_onednn_v2=true
# Disable some default TF features (avoids some build-time dependencies).
build --define=no_aws_support=true
build --define=no_gcp_support=true
build --define=no_hdfs_support=true
build --define=no_ignite_support=true
build --define=no_kafka_support=true
build --define=no_nccl_support=true
# googletest requires absl flags.
build --define=absl=1
# Use a hermetic C++ toolchain.
build --incompatible_enable_cc_toolchain_resolution
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 --incompatible_strict_action_env
# This results in -Werror for all FCP code, but nothing we pull in via
# repository rules (those labels have a @ prefix).
build --per_file_copt=+^//@-Werror
# We pull in some headers from TensorFlow which give the following warning, we
# don't want to convert them to errors.
build --per_file_copt=+^//@-Wno-error=ignored-qualifiers
build --per_file_copt=+^//@-Wno-error=inconsistent-missing-override
build --per_file_copt=+^//@-Wno-error=mismatched-tags
build --per_file_copt=+^//@-Wno-error=defaulted-function-deleted
# Some of the opstats.proto enums are deprecated, but until all references to
# them have been removed we should be allowed to use them.
build --per_file_copt=+^//@-Wno-error=deprecated-declarations
# Add a no-op clang config until CI catches up.
build:clang --noannounce_rc
# TF now has `cc_shared_library` targets, so it needs the experimental flag.
build --experimental_cc_shared_library
build --experimental_link_static_libraries_once=false
# Bazel defaults to --std=c++0x
build --cxxopt=-std=c++17
build --host_cxxopt=-std=c++17
# Use the most hermetic, available sandboxing strategy. This helps ensures all
# rules explicit declare their dependencies etc.
build --spawn_strategy=remote,sandboxed
# The version of TensorFlow we use requires this
common --experimental_repo_remote_exec
build --noincompatible_remove_legacy_whole_archive
# Use the version 2 TensorFlow API.
build --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
# We avoid building with --compilation_mode=dbg usually, since the artifacts can
# be very large (a binary with TensorFlow linked in is >2GiB); it costs several
# minutes just to fetch them from RBE cache.
build --compilation_mode=opt
# Without this, bazel doesn't print all Java compilation errors.
build --javacopt="-verbose"
# Disable automatic creation of `__init__.py` files, which prevent multiple
# workspaces from providing files with the same package prefix (e.g., "google").
# See https://github.com/bazelbuild/rules_python/issues/330.
build --incompatible_default_to_explicit_init_py
build:asan --compilation_mode=dbg
build:asan --strip=never
build:asan --copt=-fsanitize=address
build:asan --copt=-fno-omit-frame-pointer
build:asan --copt=-DADDRESS_SANITIZER # used by absl
build:asan --linkopt=-fsanitize=address
build:asan --action_env=ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true:strict_string_checks=true:detect_stack_use_after_return=true:detect_odr_violation=1
build:fcp-remote --experimental_allow_tags_propagation
build:fcp-remote --define=EXECUTOR=remote
build:fcp-remote --remote_executor=grpcs://remotebuildexecution.googleapis.com
build:fcp-remote --remote_instance_name=projects/560162532548/instances/default
build:fcp-remote --noremote_upload_local_results
build:fcp-remote --google_default_credentials
build:fcp-remote --extra_execution_platforms=//fcp:remote_platform
build:fcp-remote --host_platform=//fcp:remote_platform
build:fcp-remote --platforms=//fcp:remote_platform
build:fcp-remote --jobs=50