Add support for a customizable `.bazelrc.user` file
Sometimes you want to set some options for a specific repo. You
_could_ use `~/.bazelrc`, but that applies to _all_ Bazel projects.
This file allow users to set options for just this repo without
affecting other repos.
This follows the recommendation from Aspect:
https://blog.aspect.dev/bazelrc-flags
> As the very last line in .bazelrc:
>
> try-import %workspace%/.bazelrc.user: allow developers to add
> repo-specific overrides in their own personal .bazelrc.user file.
> Make sure this is git-ignored.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I26dbeaf1c4de41a90a1506784d4ab88ea7f48cee
diff --git a/.bazelrc b/.bazelrc
index 7ed7d93..61ac856 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -112,3 +112,8 @@
# Prevent cypress from using its own binary. We want to use the hermetic one.
build --action_env=CYPRESS_INSTALL_BINARY=0
+
+# Load a local file that users can use to customize bazel invocations. This
+# should stay the last line in this file so users can override things when they
+# want.
+try-import %workspace%/.bazelrc.user
diff --git a/.gitignore b/.gitignore
index 3f27e94..f6f3eeb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*.pyc
/bazel-*
/compile_commands.json
+/.bazelrc.user
# The `tools/build_rules/apache_runner.py` helper looks for this file by
# default. We don't want folks to check it in.