From a56ba6a64ee23b64d130cc84f30eca2c5f95d200 Mon Sep 17 00:00:00 2001 From: kon72 Date: Sun, 18 Feb 2024 22:38:15 +0900 Subject: [PATCH] Add some bazel configs to prevent undesired behaviors --- .bazelrc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.bazelrc b/.bazelrc index de024d3..752e4ec 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 @@ -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