diff --git a/.bazelrc b/.bazelrc index 9e1354c3..c9ae3431 100644 --- a/.bazelrc +++ b/.bazelrc @@ -16,6 +16,9 @@ build --noenable_bzlmod # This is a mandatory flag. build --incompatible_default_to_explicit_init_py +# Don't let local Python site packages leak into the build and cause problems +common --action_env=PYTHONNOUSERSITE=1 + # All code will be compiled with C++17 flag. # Users can naturally override copts for cc_* targets. # NOTE: googletest >=v1.13.0 requires min C++14. @@ -28,7 +31,7 @@ build --cxxopt=-std=c++17 build --sandbox_default_allow_network=false # Don't let environment variables like $PATH sneak into the build, # which can cause massive cache misses when they change. -build --incompatible_strict_action_env +common --incompatible_strict_action_env # Helps debugging when Bazel runs out of memory build --heap_dump_on_oom # Speed up all builds by not checking if output files have been modified. @@ -37,6 +40,9 @@ build --noexperimental_check_output_files # Don't bother building targets which aren't dependencies of the tests. test --build_tests_only +# Show all the problems +test --test_output=errors + # To use a clang compiler, invoke Bazel with `--config=clang`. build:clang --repo_env=CC=clang build:clang --repo_env=CXX=clang++ diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index 18e8f13b..03e869bb 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -3,6 +3,10 @@ # Debug where options came from build --announce_rc + +# Show what build command was used if one fails +build --verbose_failures + # This directory is configured in GitHub actions to be persisted between runs. build --repository_cache=/github/home/.cache/bazel-repo @@ -22,9 +26,7 @@ build:remote --noslim_profile # Don't spam CI logs. build --show_progress_rate_limit=60 +common --color=yes -# Don't rely on test logs being easily accessible from the test runner, -# though it makes the log noisier. -test --test_output=errors # Allows tests to run bazelisk-in-bazel, since this is the cache folder used test --test_env=XDG_CACHE_HOME