-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path.bazelrc
More file actions
166 lines (135 loc) · 7 KB
/
Copy path.bazelrc
File metadata and controls
166 lines (135 loc) · 7 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright 2026 The IREE Authors
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# -----------------------------------------------------------------------------
# Bazel graph and dependency policy.
# -----------------------------------------------------------------------------
# Keep Bazel module behavior explicit even when running older compatible tools.
common --enable_bzlmod
# Apply the repository's host-OS defaults without requiring every invocation to
# spell an equivalent --config flag.
common --enable_platform_specific_config
# Treat stale direct dependency pins as errors instead of background warnings.
common --check_direct_dependencies=error
# Bazel's default lockfile mode is "update", which lets ordinary read-only
# commands such as "bazel mod graph" silently rewrite MODULE.bazel.lock when
# module extension facts change. Normal development, CI, and agent workflows
# must fail loudly instead of changing dependency state as a side effect.
common --lockfile_mode=error
# Explicit dependency-maintenance escape hatch for intentional lock refreshes.
common:lockfile-update --lockfile_mode=update
# Compatibility spelling for CI/hooks that want to state the locked intent.
common:locked --lockfile_mode=error
# -----------------------------------------------------------------------------
# Local build defaults.
# -----------------------------------------------------------------------------
# Build actions should not implicitly inherit host environment state.
build --incompatible_strict_action_env
# Fail loudly if source files change during a build.
build --guard_against_concurrent_changes
# Preserve runfiles trees on Windows and Unix-like hosts.
startup --windows_enable_symlinks
build --enable_runfiles
# Python runfiles must use explicit checked-in package initializers. Bazel's
# legacy implicit init generation can synthesize empty __init__.py files in
# runfiles trees, which is brittle around symlinked source runfiles.
build --incompatible_default_to_explicit_init_py
# Bazel 8+ selects clang-cl through an execution platform and the dedicated
# rules_cc toolchain. Windows uses clang-cl by default; the MSVC config clears
# those repeatable selections when it is layered after the host-OS default.
build:windows --config=windows-clang-cl
build:windows-clang-cl --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
build:windows-clang-cl --extra_execution_platforms=//build_tools/bazel:x64_windows_clang_cl
build:windows-msvc --extra_toolchains=
build:windows-msvc --extra_execution_platforms=
# -----------------------------------------------------------------------------
# Test presets.
# -----------------------------------------------------------------------------
# Keep successful test output quiet while preserving failure logs.
test --test_output=errors
# Keep Python test entry-point directories off sys.path. Bazel supplies the
# declared runfiles roots explicitly; allowing the script directory to win can
# shadow standard-library modules with package-local files such as types.py.
test --test_env=PYTHONSAFEPATH=1
# Local presubmit uses the configured Bazel graph. Build and runtime
# requirements belong on targets and package policy rather than tag filters.
test:presubmit --config=locked
test:presubmit --test_output=errors
# Optional Loom importer lanes. These configs make importer-specific targets
# compatible in the Bazel graph; frontend Python packages are runtime-probed by
# the importer backends instead of fetched through the base module lock.
build:loom-importer-mlir --//loom/config/import:enable=mlir
build:loom-importer-tilelang --//loom/config/import:enable=tilelang
build:loom-importers --//loom/config/import:enable=mlir,tilelang
# Manual sweeps can keep going to expose the full failure set without changing
# the default hook behavior.
test:presubmit-keep-going --config=presubmit
test:presubmit-keep-going --keep_going
# -----------------------------------------------------------------------------
# Sanitizers.
# -----------------------------------------------------------------------------
# Shared sanitizer build shape. Sanitized builds keep debug information, avoid
# static sanitizer runtime conflicts, and use longer test timeouts.
build:sanitizer --strip=never
build:sanitizer --copt=-g
build:sanitizer --force_ignore_dash_static
build:sanitizer --test_timeout=120,600,1800,-1
build:sanitizer --//build_tools/bazel:sanitizer=true
# AddressSanitizer.
build:asan --config=sanitizer
build:asan --features=asan
build:asan --copt=-fsanitize=address
build:asan --copt=-fsanitize-address-use-after-scope
build:asan --cc_output_directory_tag=asan
build:asan --copt=-DADDRESS_SANITIZER
# MemorySanitizer.
build:msan --config=sanitizer
build:msan --features=msan
build:msan --copt=-fsanitize=memory
build:msan --copt=-fsanitize-memory-track-origins
build:msan --linkopt=-fsanitize=memory
build:msan --cc_output_directory_tag=msan
build:msan --copt=-DMEMORY_SANITIZER
# ThreadSanitizer.
build:tsan --config=sanitizer
build:tsan --features=tsan
build:tsan --copt=-fsanitize=thread
build:tsan --linkopt=-fsanitize=thread
build:tsan --cc_output_directory_tag=tsan
build:tsan --copt=-DTHREAD_SANITIZER
# UndefinedBehaviorSanitizer.
build:ubsan --config=sanitizer
build:ubsan --features=ubsan
build:ubsan --copt=-fsanitize=undefined
build:ubsan --linkopt=-fsanitize=undefined
# Match the CMake UBSAN configuration: the runtime uses type-erased function
# pointers for dynamic dispatch, which UBSAN's function check cannot model.
build:ubsan --copt=-fno-sanitize=function
build:ubsan --cxxopt=-fno-sanitize=function
# The vptr sanitizer check requires RTTI. IREE C++ code compiles with -fno-rtti
# for LLVM/MLIR compatibility, so vptr reports false positives.
build:ubsan --cxxopt=-fno-sanitize=vptr
build:ubsan --cc_output_directory_tag=ubsan
# LibFuzzer builds include ASAN by default; fuzzing without memory
# instrumentation is not a useful local or CI default. This spells out the
# ASAN flags instead of inheriting --config=asan so the output directory tag is
# set exactly once.
build:fuzzer --config=sanitizer
build:fuzzer --features=asan
build:fuzzer --copt=-fsanitize=address
build:fuzzer --copt=-fsanitize-address-use-after-scope
build:fuzzer --copt=-DADDRESS_SANITIZER
build:fuzzer --copt=-fsanitize=fuzzer-no-link
build:fuzzer --linkopt=-fsanitize=fuzzer-no-link
build:fuzzer --cc_output_directory_tag=asan-fuzzer
build:fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# -----------------------------------------------------------------------------
# Local/generated configuration.
# -----------------------------------------------------------------------------
# Repository-owned opt-in integrations define named configs here. They do not
# change ordinary builds unless selected explicitly.
import %workspace%/build_tools/nativelink/nativelink.bazelrc
# Generated configuration and local machine overrides stay out of version
# control. Local overrides are imported last so they can adjust generated
# settings for a specific checkout.
try-import %workspace%/.bazelrc.configured
try-import %workspace%/.bazelrc.local