blob: 65d3e9795c04f3d0b17fc503864bcd0065d2c953 [file] [log] [blame]
Adam Snaider770b97b2023-08-04 21:07:48 -07001###############################################################################
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
9common --enable_platform_specific_config
10
11# https://bazel.build/docs/windows#symlink
12startup --windows_enable_symlinks
13build:windows --enable_runfiles
14
15# Enable the only currently supported report type
16# https://bazel.build/reference/command-line-reference#flag--combined_report
17coverage --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
21coverage --experimental_fetch_all_coverage_outputs
22
23###############################################################################
24## Unique configuration groups
25###############################################################################
Brian Silverman01dfd872022-04-06 22:20:40 -070026
27# Enable rustfmt for all targets in the workspace
28build:rustfmt --aspects=//rust:defs.bzl%rustfmt_aspect
29build:rustfmt --output_groups=+rustfmt_checks
30
31# Enable clippy for all targets in the workspace
32build:clippy --aspects=//rust:defs.bzl%rust_clippy_aspect
33build:clippy --output_groups=+clippy_checks
34
Adam Snaider770b97b2023-08-04 21:07:48 -070035###############################################################################
36## Incompatibility flags
37###############################################################################
Brian Silverman01dfd872022-04-06 22:20:40 -070038
Adam Snaider770b97b2023-08-04 21:07:48 -070039# https://github.com/bazelbuild/bazel/issues/8195
40build --incompatible_disallow_empty_glob=true
41
42# https://github.com/bazelbuild/bazel/issues/12821
43build --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 Silverman01dfd872022-04-06 22:20:40 -070053try-import %workspace%/user.bazelrc