-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.bazelrc
More file actions
82 lines (71 loc) · 4.39 KB
/
.bazelrc
File metadata and controls
82 lines (71 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
common --enable_bzlmod
common --experimental_isolated_extension_usages
# Strict action env: actions get a fixed PATH (/bin:/usr/bin:/usr/local/bin)
# instead of inheriting the client's PATH. Prevents NixOS /nix/store paths
# from leaking to RBE workers. Default in Bazel 9 but not Bazel 8.
build --incompatible_strict_action_env
# Reduce runfiles disk usage (prevents "No space left on device" on CI runners).
# Each py_test creates a runfiles tree with ~2,458 symlinks for the Python toolchain;
# with many targets this exhausts the default 20 GB BuildBuddy disk.
# --nobuild_runfile_links: don't eagerly create runfiles trees during build phase
# (created on-demand for test/run). Safe for CI where we only `bazel test` or `bazel run`.
# --nolegacy_external_runfiles: skip duplicate legacy external/<repo> runfiles path,
# keeping only the modern ../<repo> path. Halves external dep symlink count.
build --nobuild_runfile_links
build --nolegacy_external_runfiles
# Disable MODULE.bazel.lock to avoid churn between environments.
# The `ape` module (Actually Portable Executable, transitive dep via aspect_rules_lint)
# has platform-specific resolution that causes the lockfile to differ between local
# dev machines and CI/cloud environments. Since we pin versions explicitly in
# MODULE.bazel and don't use version ranges, the lockfile provides minimal benefit.
common --lockfile_mode=off
# Lint + typecheck enabled by default on all builds.
# Combines lint (ruff, ESLint), typecheck (mypy), and Rust checks (clippy, rustfmt).
# Use Python 3.13 for mypy to parse Python 3.13 syntax (e.g., homeassistant).
# To skip lint (e.g. for fast iterative builds): bazel build --config=nolint //...
build --@rules_python//python/config_settings:python_version=3.13
build --aspects=//devinfra/lint:linters.bzl%ruff,//devinfra/lint:linters.bzl%mypy_aspect,//devinfra/lint:linters.bzl%eslint,@rules_rust//rust:defs.bzl%rust_clippy_aspect,@rules_rust//rust:defs.bzl%rustfmt_aspect
build --output_groups=+rules_lint_report,+mypy,+clippy_checks,+rustfmt_checks
# Skip lint/typecheck. Bazel evaluates aspects lazily, so removing their
# output groups prevents the aspect actions from running.
build:nolint --output_groups=-rules_lint_report,-mypy,-clippy_checks,-rustfmt_checks
# Remote Build Execution (BuildBuddy)
# Auth: ~/.config/bazel/buildbuddy.bazelrc (setup_buildbuddy.sh or bazelrc.mako)
# Host platform auto-detected; //:rbe_linux_x64 is the execution platform.
build:rbe --remote_executor=grpcs://remote.buildbuddy.io
build:rbe --extra_execution_platforms=//:rbe_linux_x64
build:rbe --spawn_strategy=remote,local
test:rbe --spawn_strategy=remote,local
build:rbe --jobs=50
build:rbe --remote_download_minimal
build:rbe --bes_results_url=https://app.buildbuddy.io/invocation/
build:rbe --bes_backend=grpcs://remote.buildbuddy.io
common:rbe --remote_cache=grpcs://remote.buildbuddy.io
common:rbe --remote_timeout=10m
common:rbe --remote_cache_compression
build:rbe --noslim_profile
build:rbe --experimental_profile_include_target_label
build:rbe --experimental_profile_include_primary_output
# Formatting: use bazel run //devinfra/format (fix) or //devinfra/format.check (check)
# Supports: prettier (JS/TS/CSS/HTML/MD), ruff (Python), shfmt (Shell), buildifier (Bazel), rustfmt (Rust)
# Stamping - embeds build metadata (commit hash, etc.) into build artifacts
# Only targets that depend on ctx.info_file (like build_info_gen) are invalidated on commit change
build --stamp --workspace_status_command=devinfra/stamp.sh
# Use shell-based bootstrap instead of system_python. The default
# (system_python) starts with `#!/usr/bin/env python3` which picks up whatever
# system Python is on PATH. This causes _sre.MAGIC mismatches when system
# Python differs from the hermetic 3.13 toolchain, and stdlib shadowing when
# files like `types.py` exist in the package directory. The script bootstrap
# invokes the hermetic interpreter directly, avoiding both issues.
#
# Subprocess-spawning code uses bazel_subprocess.py to propagate PYTHONPATH.
common --@rules_python//python/config_settings:bootstrap_impl=script
# Quiet output mode — reduces progress spam for non-interactive contexts.
# --curses=no: disable curses UI
# --show_progress_rate_limit=30: at most one progress update every 30 seconds
common:quiet --curses=no
common:quiet --show_progress_rate_limit=30
# CI and AI agent modes both use quiet output.
common:ci --config=quiet
common:ci --announce_rc
common:ai_agent --config=quiet