-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bazelrc
91 lines (71 loc) · 3.66 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
84
85
86
87
88
89
90
91
###############################################################################
## Bazel Configuration Flags
##
## `.bazelrc` is a Bazel configuration file.
## https://bazel.build/docs/best-practices#bazelrc-file
###############################################################################
###############################################################################
## Build configuration
###############################################################################
# Don't create bazel-* symlinks in the WORKSPACE directory.
# Instead, set a prefix and put it in .gitignore
build --symlink_prefix=target-bzl/
# Non-empty glob test is disabled because some Bazels deps fail the test.
# build --incompatible_disallow_empty_glob
# This flag improves execution throughput by executing more actions in parallel.
build --jobs=32
###############################################################################
## Test configuration
###############################################################################
# Reduce test output to just error cases and report timeout warnings.
test --test_output=errors
test --verbose_failures
###############################################################################
## Common configuration
###############################################################################
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
# Disable workspace support by default as its gone with Bazel 8 and will be removed
common --noenable_workspace
# Allow + in repo names for Bazel 8
# common --incompatible_use_plus_in_repo_names
# Write build outputs in a platform-specific directory;
# avoid outputs being wiped and rewritten when switching between platforms.
common --experimental_platform_in_output_dir
# Enable proto toolchain resolution
common --incompatible_enable_proto_toolchain_resolution
# Enable misc. performance optimizations.
# https://www.buildbuddy.io/blog/debugging-slow-bazel-builds/
# https://www.buildbuddy.io/blog/how-bazel-7-0-makes-your-builds-faster/
common --nolegacy_important_outputs
common --verbose_failures
common --noexperimental_merged_skyframe_analysis_execution
common --reuse_sandbox_directories
# Enable a more detailed performance profile
common --noslim_profile
common --experimental_profile_include_target_label
common --experimental_profile_include_primary_output
# Required for cargo_build_script support before Bazel 7
common --incompatible_merge_fixed_and_default_shell_env
###############################################################################
## Cross compilation configuration
###############################################################################
# Debug toolchain resolution
# build --toolchain_resolution_debug='@bazel_tools//tools/cpp:toolchain_type
# Required to support cross compilation from different host systems i.e Mac and Linux
# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
common --enable_platform_specific_config
# Required to resolve C/C++ toolchain.
# https://github.com/bazel-contrib/musl-toolchain?tab=readme-ov-file#setup
build --incompatible_enable_cc_toolchain_resolution
# Build targets for different hosts
build:macos --extra_execution_platforms=//build/platforms:darwin-aarch64
build:linux --extra_execution_platforms=//build/platforms:linux-x86_64
###############################################################################
## Custom user flags
##
## This should always be the last thing in the `.bazelrc` file to ensure
## consistent behavior when setting flags in that file as `.bazelrc` files are
## evaluated top to bottom.
###############################################################################
try-import %workspace%/user.bazelrc