1############################################################################### 2## Bazel Configuration Flags 3## 4## `.bazelrc` is a Bazel configuration file. 5## https://bazel.build/docs/best-practices#bazelrc-file 6############################################################################### 7 8 9############################################################################### 10## Windows configuration 11############################################################################### 12 13# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config 14common --enable_platform_specific_config 15 16# https://bazel.build/docs/windows#symlink 17startup --windows_enable_symlinks 18build:windows --enable_runfiles 19 20############################################################################### 21## Build configuration 22############################################################################### 23 24# Don't create bazel-* symlinks in the WORKSPACE directory. 25# Instead, set a prefix and put it in .gitignore 26# build --symlink_prefix=target-bzl/ 27 28############################################################################### 29## Test configuration 30############################################################################### 31 32# Reduce test output to just error cases 33test --test_output=errors 34test --verbose_failures 35 36############################################################################### 37## Common configuration 38############################################################################### 39 40# Enable Bzlmod for every Bazel command 41common --enable_bzlmod 42 43# Write build outputs in a platform-specific directory; 44# avoid outputs being wiped and rewritten when switching between platforms. 45common --experimental_platform_in_output_dir 46 47# Enable misc. performance optimizations. 48common --nolegacy_important_outputs 49common --verbose_failures 50common --reuse_sandbox_directories 51common --noexperimental_merged_skyframe_analysis_execution 52 53# Enable a more detailed performance profile 54common --noslim_profile 55common --experimental_profile_include_target_label 56common --experimental_profile_include_primary_output 57 58############################################################################### 59## Rust configuration 60############################################################################### 61 62# Enable rustfmt for all targets in the workspace 63build:rustfmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect 64build:rustfmt --output_groups=+rustfmt_checks 65 66# Enable clippy for all targets in the workspace 67build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect 68build:clippy --output_groups=+clippy_checks 69 70############################################################################### 71## Custom user flags 72## 73## This should always be the last thing in the `.bazelrc` file to ensure 74## consistent behavior when setting flags in that file as `.bazelrc` files are 75## evaluated top to bottom. 76############################################################################### 77 78try-import %workspace%/user.bazelrc 79