forked from UBC-Thunderbots/Software
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bazelrc
More file actions
79 lines (59 loc) · 3.16 KB
/
Copy path.bazelrc
File metadata and controls
79 lines (59 loc) · 3.16 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
################## Base Bazel Configs ##################
common --enable_bzlmod
common --lockfile_mode=update
common --noincompatible_disallow_empty_glob # Allow globs to be empty without failing
common --incompatible_disallow_struct_provider_syntax=false
# We want bazel to output the results of our gtests
test --test_output=all
################## Bazel Debug Configs ##################
# Enable the following commands to debug Bazel. Note that the additional overhead from these commands will
# cause CI to fail
# common --verbose_failures
# common --sandbox_debug
################ Machine Configurations ################
# The XDR_RUNTIME_DIR and DISPLAY environment variables must be passed to the tests
# so that our GUIs can be enabled for simulated tests. This is needed for Qt
# to find the X-Window system and create windows
build --test_env=XDG_RUNTIME_DIR
build --test_env=DISPLAY
# Setup python bin/lib to point to our venv
build --action_env=PYTHON_BIN_PATH=/opt/tbotspython/bin/python3.12
build --action_env=PYTHON_LIB_PATH=/opt/tbotspython/lib/python3.12
# Automatically set the CPU environment based on the `--cpu` flag as per our
# defined CPU environments
build --auto_cpu_environment_group=//toolchains/cc:cpus
# Use Our Custom Toolchain
build --crosstool_top=//toolchains/cc:toolchain
common --features=external_include_paths
################# Build Optimizations #################
# Use a local directory as a remote cache. This shares artifacts when switching
# between git branches or workspaces for the same project.
# See https://docs.bazel.build/versions/master/remote-caching.html#disk-cache
build --disk_cache=~/.cache/thunderbots_bazel_disk_cache
build --experimental_remote_merkle_tree_cache # partial repo caching optimization
common --incompatible_enable_proto_toolchain_resolution # protoc caching
# Ensure that we don't accidentally build gRPC
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
################# Build Configurations #################
# Lock C++ version
build --cxxopt="-std=c++2a"
# Warn variable length arrays only when compiling cpp
build --per_file_copt=.*\.cpp@-Wvla
# Enable runfiles symlink tree
build --enable_runfiles
# Allow usage of platform specific .bazelrc configs (e.g. build:linux, common:windows, etc)
common --enable_platform_specific_config
# We rely on all symbols being included when linking for our implementation of
# the "factory" design pattern.
build --incompatible_remove_legacy_whole_archive=False
# Escalate Warnings to fail Compile for Thunderbots code
build --features=external_include_paths
build --per_file_copt=proto/.*,proto/message_translation/.*,proto/primitive/.*,software/.*,shared/.*,-external/.*@-Wall,-Wextra,-Wno-unused-parameter,-Wno-deprecated,-Werror,-Wno-deprecated-declarations
# TODO: #3492
# build --per_file_copt=software/.*,shared/.*,-external/.*@-Wconversion
build --per_file_copt=.*\.pb\.(h|cc|cpp)$@-w
build --per_file_copt=./external/.*,./bazel-out/.*@-w
############## External Deps Compatibility ##############
build --noincompatible_disallow_ctx_resolve_tools
build --check_direct_dependencies=off