Adam Snaider | 770b97b | 2023-08-04 21:07:48 -0700 | [diff] [blame] | 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 | # https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config |
| 9 | common --enable_platform_specific_config |
| 10 | |
| 11 | # https://bazel.build/docs/windows#symlink |
| 12 | startup --windows_enable_symlinks |
| 13 | build:windows --enable_runfiles |
| 14 | |
| 15 | # Enable the only currently supported report type |
| 16 | # https://bazel.build/reference/command-line-reference#flag--combined_report |
| 17 | coverage --combined_report=lcov |
| 18 | |
| 19 | # Avoid fully cached builds reporting no coverage and failing CI |
| 20 | # https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs |
| 21 | coverage --experimental_fetch_all_coverage_outputs |
| 22 | |
| 23 | ############################################################################### |
| 24 | ## Unique configuration groups |
| 25 | ############################################################################### |
Brian Silverman | 01dfd87 | 2022-04-06 22:20:40 -0700 | [diff] [blame] | 26 | |
| 27 | # Enable rustfmt for all targets in the workspace |
| 28 | build:rustfmt --aspects=//rust:defs.bzl%rustfmt_aspect |
| 29 | build:rustfmt --output_groups=+rustfmt_checks |
| 30 | |
| 31 | # Enable clippy for all targets in the workspace |
| 32 | build:clippy --aspects=//rust:defs.bzl%rust_clippy_aspect |
| 33 | build:clippy --output_groups=+clippy_checks |
| 34 | |
Adam Snaider | 770b97b | 2023-08-04 21:07:48 -0700 | [diff] [blame] | 35 | ############################################################################### |
| 36 | ## Incompatibility flags |
| 37 | ############################################################################### |
Brian Silverman | 01dfd87 | 2022-04-06 22:20:40 -0700 | [diff] [blame] | 38 | |
Adam Snaider | 770b97b | 2023-08-04 21:07:48 -0700 | [diff] [blame] | 39 | # https://github.com/bazelbuild/bazel/issues/8195 |
| 40 | build --incompatible_disallow_empty_glob=true |
| 41 | |
| 42 | # https://github.com/bazelbuild/bazel/issues/12821 |
| 43 | build --nolegacy_external_runfiles |
| 44 | |
| 45 | ############################################################################### |
| 46 | ## Custom user flags |
| 47 | ## |
| 48 | ## This should always be the last thing in the `.bazelrc` file to ensure |
| 49 | ## consistent behavior when setting flags in that file as `.bazelrc` files are |
| 50 | ## evaluated top to bottom. |
| 51 | ############################################################################### |
| 52 | |
Brian Silverman | 01dfd87 | 2022-04-06 22:20:40 -0700 | [diff] [blame] | 53 | try-import %workspace%/user.bazelrc |