Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massage the bazelrc #341

Merged
merged 4 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
lalten marked this conversation as resolved.
Show resolved Hide resolved

# 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.
Expand All @@ -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.
Expand All @@ -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++
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
lalten marked this conversation as resolved.
Show resolved Hide resolved
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
test --test_env=XDG_CACHE_HOME