-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy path.bazelrc
More file actions
146 lines (113 loc) · 5.47 KB
/
Copy path.bazelrc
File metadata and controls
146 lines (113 loc) · 5.47 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Faster hash function
startup --digest_function=blake3
# Needed by LLVM and/or XLA
common --experimental_repo_remote_exec
# Self explanatory
common --enable_platform_specific_config
# Ensure host tools are built optimized
common --host_compilation_mode=opt
common --@rules_zig//zig/settings:host_mode=release_safe
# Suppress all warnings, LLVM and friends are too noisy
common --copt='-w'
common --host_copt='-w'
# Enable C++17
common --cxxopt='-std=c++17'
common --host_cxxopt='-std=c++17'
common --enable_runfiles
# Ensure rules_python doesn't rely on the system's Python for stage-1 bootstrap
common --@rules_python//python/config_settings:bootstrap_impl=script
# We don't to check the built files in the sandbox or repositories
common --experimental_check_output_files=false
# Expose Zig's shared cache directories to sandboxed actions when the
# selected sandbox implementation supports host path mounts.
#
# These flags are consumed by linux-sandbox, and by Bazel's Docker sandbox.
# They are ignored by processwrapper-sandbox and macOS sandbox-exec, which use
# a symlinked execroot rather than bind mounts.
build:linux --sandbox_add_mount_pair=/tmp
build:linux --sandbox_writable_path=/tmp
build:linux --sandbox_add_mount_pair=/var/tmp
build:linux --sandbox_writable_path=/var/tmp
# Ensure workers are sandboxed
build --worker_sandboxing
# Build in debug for now, by default
common --compilation_mode=dbg
# Various cc options
common --experimental_cc_shared_library
common --incompatible_use_cc_configure_from_rules_cc
common --incompatible_autoload_externally=+@rules_cc,+@rules_python,+@rules_shell,+@rules_java
common --experimental_platform_in_output_dir
# Faster sandbox speeds
build --experimental_inmemory_sandbox_stashes
# clang by default
common --compiler=clang
# Allow empty globs since some legacy rules
common --incompatible_disallow_empty_glob=false
# Use the C linker to link Zig code
common --@rules_zig//zig/settings:use_cc_common_link=true
# Zig self hosted backend is too fragile for now
common --@rules_zig//zig/settings:zigopt=-fllvm
common --@rules_zig//zig/settings:use_standalone_translate_c=True
common --@llvm//config:experimental_stub_libgcc_s=true
common --macos_minimum_os=13.0
# Enable stamping
common --stamp=true
common --workspace_status_command=./tools/workspace_status.sh
common --@rules_cc//cc/toolchains/args/archiver_flags:use_libtool_on_macos=false
common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1
common --xcode_version_config=//:disable_xcode
# Required for protobuf upb on Linux
common:linux --copt=-fPIC
# Prefer prebuilt protoc (finally!)
common --@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc=true
# Print test errors in the console
test --test_output=errors
common:silent --noshow_progress
common:silent --ui_event_filters=,+error,+fail
common:silent --show_result=0
common:silent --logging=0
# --config=debug will used optmized backend, but all the frontend zig code will be compiled in debug mode.
common:debug --compilation_mode=opt
common:debug --@rules_zig//zig/settings:mode=debug
common:debug --strategy=ZigBuildLib=local
common:debug --strategy=ZigBuildObj=local
common:debug --strategy=ZigBuildTestLib=local
# --config=alldebug build everything in debug mode, including the backend.
common:alldebug --compilation_mode=dbg
common:alldebug --@rules_zig//zig/settings:mode=debug
common:alldebug --strategy=local
common:release --compilation_mode=opt
common:release --copt=-Ofast
common:release --strip=always
common:release --@rules_zig//zig/settings:mode=release_safe
# --config=native builds everything optimized for the local CPU
common:native --copt=-march=native
common:native --@rules_zig//zig/settings:zigopt=-mcpu=native
# Remote execution and caching with BuildBuddy
common:remote --bes_results_url=https://app.buildbuddy.io/invocation/
common:remote --bes_backend=grpcs://remote.buildbuddy.io
common:remote --remote_cache=grpcs://remote.buildbuddy.io
common:remote --experimental_remote_downloader=grpcs://remote.buildbuddy.io
common:remote --remote_executor=grpcs://remote.buildbuddy.io
common:remote --remote_download_toplevel
common:remote --nobuild_runfile_links
common:remote --remote_timeout=3600
common:remote --noexperimental_throttle_remote_action_building
common:remote --remote_cache_compression
# Re-runs actions instead of failing on transient lost remote/disk cache inputs.
common:remote --rewind_lost_inputs
# Falls back to local downloads if the remote asset downloader is unavailable.
common:remote --experimental_remote_downloader_local_fallback
common:remote --grpc_keepalive_time=30s
common:remote --jobs=2000
common:remote --extra_execution_platforms=@zml//:rbe_platform
common:remote --experimental_repo_remote_exec=true
# Runtime profiling helpers for `bazel run`.
run:nsys --@zml//platforms:cuda=true
run:nsys --run_under=//tools:nsys
run:rocprofv3 --@zml//platforms:rocm=true
run:rocprofv3 --run_under=//tools:rocprofv3
run:neuron-profile --@zml//platforms:neuron=true
run:neuron-profile --@zml//platforms:cpu=false
run:neuron-profile --run_under='//tools/neuron:profile /tmp/zml-neuron-profile'