-
Notifications
You must be signed in to change notification settings - Fork 856
Expand file tree
/
Copy path.bazelrc
More file actions
74 lines (59 loc) · 3.27 KB
/
Copy path.bazelrc
File metadata and controls
74 lines (59 loc) · 3.27 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
# Keep MODULE.bazel.lock up to date automatically
common --lockfile_mode=update
# Allow isolated module-extension usages so Bazel can manage repo tools from a
# dedicated tools/external/go.mod independently of the main workspace go_deps.
common --experimental_isolated_extension_usages
# Enable platform-specific config sections (build:macos, build:linux, etc.)
common --enable_platform_specific_config
# Go settings - match scripts/build_test.sh defaults
# Test settings (match scripts/build_test.sh)
test --test_output=errors
# Per-category timeouts: short,moderate,long,eternal
# "long" covers graft modules (coreth, evm, subnet-evm) via graft_go_test macro
test --test_timeout=60,120,900,3600
# Set HOME for tests that need it (e.g., config tests that expand $HOME/.avalanchego)
test --test_env=HOME
# Race detection ON by default (matches scripts/build_test.sh)
# Disable with: bazel build/test --config=norace //...
build --@io_bazel_rules_go//go/config:race=true
test --@io_bazel_rules_go//go/config:race=true
# Explicit race config (kept for clarity/compat)
build:race --@io_bazel_rules_go//go/config:race=true
test:race --@io_bazel_rules_go//go/config:race=true
# Config: disable race (for faster local builds)
build:norace --@io_bazel_rules_go//go/config:race=false
test:norace --@io_bazel_rules_go//go/config:race=false
# Shuffle ON by default (matches build_test.sh -shuffle=on)
# Injected via go_test wrapper in .bazel/defs.bzl (not --test_arg, which
# would break non-Go test rules like gazelle_test).
# Disable with: bazel test --config=noshuffle //...
# Coverage: use `bazel coverage //...` instead of `bazel test //...`
# This matches build_test.sh's -coverprofile/-covermode flags
# CGO settings
# Using action_env rather than --@io_bazel_rules_go//go/config:pure because:
# 1. CGO_CFLAGS has no native rules_go equivalent - action_env is the only option
# 2. Using action_env for both CGO_ENABLED and CGO_CFLAGS keeps configuration consistent
# The BLST library requires -D__BLST_PORTABLE__ for portable builds across CPU architectures.
build --action_env=CGO_CFLAGS="-O2 -D__BLST_PORTABLE__"
build --action_env=CGO_ENABLED=1
# macOS: Use the default CommandLineTools location (also used by GitHub Actions
# runners for CI). Hosts with a different active Apple toolchain can either rely on
# direnv to create `.bazelrc.local` with appropriate values or run `task
# bazel-configure-local` to generate the file manually.
build:macos --repo_env=DEVELOPER_DIR=/Library/Developer/CommandLineTools
build:macos --repo_env=SYSTEMROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
build:macos --action_env=DEVELOPER_DIR=/Library/Developer/CommandLineTools
build:macos --action_env=SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
build:macos --action_env=CC=
build:macos --action_env=CXX=
try-import %workspace%/.bazelrc.local
# Cache for faster builds
build --disk_cache=~/.cache/bazel-disk-cache
# Config: disable shuffle (for deterministic test ordering)
# Overrides the shuffle=on injected by the go_test wrapper (last flag wins)
test:noshuffle --test_arg=-test.shuffle=off
# Config: fast local development (no shuffle, no race)
test:fast --config=noshuffle --config=norace
# Stamp builds with git commit
build:release --stamp
build:release --workspace_status_command=scripts/bazel_workspace_status.sh