Skip to content

Commit

Permalink
Add some bazel configs to prevent undesired behaviors
Browse files Browse the repository at this point in the history
  • Loading branch information
kon72 committed Feb 18, 2024
1 parent 61c441d commit a56ba6a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Use a static value for `PATH` and does not inherit `LD_LIBRARY_PATH`. Doesn't let environment
# variables like `PATH` sneak into the build, which can cause massive cache misses when they change.
# Use `--action_env=ENV_VARIABLE` if you want to inherit specific environment variables from the
# client, but note that doing so can prevent cross-user caching if a shared cache is used.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_strict_action_env
build --incompatible_strict_action_env

# Don't allow network access for build actions in the sandbox.
# Ensures that you don't accidentally make non-hermetic actions/tests which depend on remote
# services.
# Developers should tag targets with `tags=["requires-network"]` to opt-out of the enforcement.
# Docs: https://bazel.build/reference/command-line-reference#flag--sandbox_default_allow_network
build --sandbox_default_allow_network=false

# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server
# notices when a directory changes, if you have a directory listed in the srcs of some target.
# Recommended when using
Expand All @@ -6,3 +20,6 @@
# inputs to copy_directory actions.
# Docs: https://bazel.build/reference/command-line-reference#flag--host_jvm_args
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1

# This bazelrc file can be used for user-specific custom build settings.
try-import %workspace%/.user.bazelrc

0 comments on commit a56ba6a

Please sign in to comment.