-
Notifications
You must be signed in to change notification settings - Fork 25
/
.bazelrc
71 lines (62 loc) · 2.89 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
# See doc at: https://bazel.build/run/bazelrc
# https://github.com/tensorflow/models/issues/195#issuecomment-620936740
startup --host_jvm_args=-Xmx8192m
startup --batch_cpu_scheduling
startup --io_nice_level 7
build --jobs 32
build --local_ram_resources=HOST_RAM*0.5
test --jobs 32
build --config=clang
# https://app.buildbuddy.io/docs/setup
# Enable remote cache when building on GitHub actions.
# Remote cache is disabled for local build, because it's actually slower to
# upload local build results to and fetch remotely-cached results from
# remote cache server.
build:github-actions --bes_results_url=https://app.buildbuddy.io/invocation/
build:github-actions --bes_backend=grpcs://remote.buildbuddy.io
build:github-actions --remote_cache=grpcs://remote.buildbuddy.io
build:github-actions --remote_timeout=3600
# This is needed for building //src/api-server/cmd:extract_wasi_sdk
# Otherwise, the output is not available when it's been build on remote.
build:github-actions --remote_download_outputs=all
# This is to flush bazel cache for new version of clang/gcc.
# Because changing env variable in the sandbox forces bazel to rebuild
# everything; thus when we increment Clang version, we wont run into situation
# where artifacts built by different compiler version causes hidden issues.
#
# This does not apply to Go, as Bazel's Golang tool chain version is read from
# go.mod file.
#
# https://bazel.build/reference/command-line-reference#flag--action_env
build --action_env=CLANG_COMPILER_VERSION=14.0_0
# https://bazel.build/reference/command-line-reference#flag--host_action_env
build --host_action_env=CLANG_COMPILER_VERSION=14.0_0
# This causes binaries not available locally since it's cached remotely.
# build --remote_download_minimal
build:clang --action_env=CC
build:clang --host_action_env=CC
build:clang --action_env=CXX
build:clang --host_action_env=CXX
# Build for Clang
build:clang --linkopt -fuse-ld=lld
build:clang --host_linkopt -fuse-ld=lld
build:clang --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a
build:clang --host_action_env=BAZEL_LINKLIBS=-l%:libstdc++.a
build:clang --action_env=BAZEL_LINKOPTS=-lm:-static-libgcc
build:clang --host_action_env=BAZEL_LINKOPTS=-lm:-static-libgcc
# We need this to ensure that external projects are built with
# C++17 support. This is needed in some libraries like absl which
# have different behavior with C++17.
build:clang --action_env=BAZEL_CXXOPTS=-std=c++17:-fPIC
build:clang --host_action_env=BAZEL_CXXOPTS=-std=c++17:-fPIC
build:clang --action_env=BAZEL_COMPILER=clang
build:clang --host_action_env=BAZEL_COMPILER=clang
build:clang --action_env=CC=clang
build:clang --host_action_env=CC=clang
build:clang --action_env=CXX=clang++
build:clang --host_action_env=CXX=clang++
test --test_tag_filters=-bpf,-disabled
# Force all test to print detailed output.
test --test_arg=-test.v
test --test_output=errors
test:bpf --test_tag_filters=bpf,-disabled --strategy=TestRunner=standalone