xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/crate_universe/.bazelrc (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifan# `.bazelrc` is a Bazel configuration file.
2*d4726bddSHONG Yifan# https://bazel.build/docs/best-practices#bazelrc-file
3*d4726bddSHONG Yifan
4*d4726bddSHONG Yifan# Required on windows
5*d4726bddSHONG Yifancommon --enable_platform_specific_config
6*d4726bddSHONG Yifanstartup --windows_enable_symlinks
7*d4726bddSHONG Yifanbuild:windows --enable_runfiles
8*d4726bddSHONG Yifan
9*d4726bddSHONG Yifan# Enable rustfmt for all targets in the workspace
10*d4726bddSHONG Yifanbuild:rustfmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
11*d4726bddSHONG Yifanbuild:rustfmt --output_groups=+rustfmt_checks
12*d4726bddSHONG Yifan
13*d4726bddSHONG Yifan# Enable clippy for all targets in the workspace
14*d4726bddSHONG Yifanbuild:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
15*d4726bddSHONG Yifanbuild:clippy --output_groups=+clippy_checks
16*d4726bddSHONG Yifan
17*d4726bddSHONG Yifan# Confirm crate universe works without relying on the legacy
18*d4726bddSHONG Yifan# external symlink in runfiles.
19*d4726bddSHONG Yifanbuild --nolegacy_external_runfiles
20*d4726bddSHONG Yifan
21*d4726bddSHONG Yifan# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
22*d4726bddSHONG Yifan# https://github.com/bazelbuild/rules_rust/issues/2181
23*d4726bddSHONG Yifancommon --noenable_bzlmod
24*d4726bddSHONG Yifan
25*d4726bddSHONG Yifan# This isn't currently the defaut in Bazel, but we enable it to test we'll be ready if/when it flips.
26*d4726bddSHONG Yifanbuild --incompatible_disallow_empty_glob
27*d4726bddSHONG Yifan
28*d4726bddSHONG Yifan# Required for cargo_build_script support before Bazel 7
29*d4726bddSHONG Yifanbuild --incompatible_merge_fixed_and_default_shell_env
30*d4726bddSHONG Yifan
31*d4726bddSHONG Yifan# This import should always be last to allow users to override
32*d4726bddSHONG Yifan# settings for local development.
33*d4726bddSHONG Yifantry-import %workspace%/user.bazelrc
34*d4726bddSHONG Yifan
35