-
Notifications
You must be signed in to change notification settings - Fork 123
/
.bazelrc
83 lines (68 loc) · 3.4 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 2020 Google LLC
#
# 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
#
# https://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.
# Note: we do not use --enable_platform_specific_config because evaluation order
# becomes unexpected (see https://github.com/bazelbuild/bazel/issues/13603).
# Instead, users are expected to pick a compiler with `--config=clang/gcc/msvc`.
# Prevent regressions on those two incompatible changes
# TODO: remove those flags when they are flipped in the default Bazel version used.
build --incompatible_enforce_config_setting_visibility
build --incompatible_config_setting_private_default_visibility
# Needed for XLA dependency
build --experimental_repo_remote_exec
# Disable clang extention that rejects type definitions within offsetof.
# This was added in clang-16 by https://reviews.llvm.org/D133574.
# Can be removed once upb is updated, since a type definition is used within
# offset of in the current version of ubp.
# See https://github.com/protocolbuffers/upb/blob/9effcbcb27f0a665f9f345030188c0b291e32482/upb/upb.c#L183.
build --copt=-Wno-gnu-offsetof-extensions
# LLVM's LIT test runner needs %PATHEXT% on Windows
test:windows --test_env=PATHEXT
# Build with MSVC
build:msvc --cxxopt=/std:c++17 --host_cxxopt=/std:c++17
# Workaround for https://github.com/tensorflow/runtime/issues/65
build:msvc --cxxopt=/d2ReducedOptimizeHugeFunctions
# Build with clang.
build:clang --repo_env=CC=clang
build:clang --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
# Build with gcc
build:gcc --repo_env=CC=gcc
build:gcc --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
build:gcc --cxxopt=-Wno-maybe-uninitialized
build:gcc --cxxopt=-Wno-sign-compare
# Default to an optimized build.
# Override via: "-c dbg" or --compilation_mode=dbg
build --compilation_mode=opt
# Build Event Service
build:bes --bes_backend=buildeventservice.googleapis.com
build:bes --bes_results_url=http://source.cloud.google.com/results/invocations/
build:bes --bes_timeout=1m
build:bes --project_id=tensorflow-testing # TODO(chuanhao): use tf-runtime
build:bes --google_default_credentials
# Remote Build and Execution
# Note: at the moment, this only uses remote caching.
build:rbe --remote_cache=grpcs://remotebuildexecution.googleapis.com
build:rbe --remote_instance_name=projects/tf-runtime/instances/tf-runtime-rbe-instance
build:rbe --host_platform_remote_properties_override='properties:{name:"cache-silo-key" value:"FirstCachedBuild"}'
build:rbe --google_default_credentials
# Disable RTTI and exceptions
build:disable_rtti_and_exceptions --no//:rtti_and_exceptions
# Filter build/test targets by tag.
test --build_tag_filters=-no_oss,-oss_excluded
test --test_tag_filters=-no_oss,-oss_excluded
# Minimize code size for //tools:code_size_test_driver target.
build:code_size_test --compilation_mode=opt --copt=-Os
build:code_size_test --linkopt=-Wl,--strip-all --linkopt=-Wl,--icf=safe
build:code_size_test --config=disable_rtti_and_exceptions
# Put user-specific options in .bazelrc.user
try-import %workspace%/.bazelrc.user