| ############################################################################### |
| ## 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/ |
| |
| ############################################################################### |
| ## Test configuration |
| ############################################################################### |
| |
| # Reduce test output to just error cases |
| test --test_output=errors |
| test --verbose_failures |
| |
| ############################################################################### |
| ## Common configuration |
| ############################################################################### |
| |
| # Enable Bzlmod for every Bazel command |
| common --enable_bzlmod |
| |
| # Disable the bzlmod lockfile, so we don't accidentally commit MODULE.bazel.lock |
| common --lockfile_mode=off |
| |
| # 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 misc. performance optimizations. |
| common --nolegacy_important_outputs |
| common --verbose_failures |
| common --reuse_sandbox_directories |
| common --noexperimental_merged_skyframe_analysis_execution |
| |
| # Enable a more detailed performance profile |
| common --noslim_profile |
| common --experimental_profile_include_target_label |
| common --experimental_profile_include_primary_output |
| |
| common --incompatible_macos_set_install_name |
| |
| ############################################################################### |
| ## Rust configuration |
| ############################################################################### |
| |
| # Enable rustfmt for all targets in the workspace |
| build:rustfmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect |
| build:rustfmt --output_groups=+rustfmt_checks |
| |
| # Enable clippy for all targets in the workspace |
| build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect |
| build:clippy --output_groups=+clippy_checks |
| |
| ############################################################################### |
| ## Java configuration |
| ############################################################################### |
| |
| common --java_runtime_version=remotejdk_21 |
| |
| ############################################################################### |
| ## 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 |