Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c3475e6
Upgrade to Bazel 9.1.1
williamckha Jul 11, 2026
063ec2d
Fix CI
williamckha Jul 12, 2026
71440c5
Remove warning suppressions
williamckha Jul 12, 2026
1e13c7f
Revert addition of robot config in .bazelrc and fix robot_navigation_…
williamckha Jul 13, 2026
492d0ec
Add protoc to PATH to fix nanopb generator
williamckha Jul 13, 2026
42f0924
Ensure nanopb uses prebuilt protoc and fix nanopb protobuf compat issue
williamckha Jul 19, 2026
50e2a76
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Aug 9, 2026
b0a5756
Rename .BUILD files to .bzl in extlibs
williamckha Aug 9, 2026
afec8c6
Patch tomlplusplus with memory over-alignment fix for ARM
williamckha Aug 9, 2026
e7999a5
Use `FieldDescriptor.is_repeated`
williamckha Aug 14, 2026
ca539ad
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
Thunderbots Aug 22, 2026
ac78bf0
Try pointing nanopb to latest commit
Thunderbots Aug 22, 2026
df76bcd
Merge branch 'william/bazel9' of https://github.com/williamckha/Softw…
Thunderbots Aug 22, 2026
c83edcb
Fix pyconfig.h build error
williamckha Aug 22, 2026
9492c9a
Merge branch 'william/bazel9' of https://github.com/williamckha/Softw…
williamckha Aug 22, 2026
27f3761
Add back nanopb patch that fixes sys.path ordering
williamckha Aug 22, 2026
51b3dd3
Suppress warnings emitted from external deps
williamckha Aug 23, 2026
31187ba
Enable implicit conversion warning
williamckha Aug 23, 2026
073121d
Fix system pyqt6 version shadowing
nycrat Aug 31, 2026
c5008fd
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
GrayHoang Sep 5, 2026
f62c70b
forgot pygame
GrayHoang Sep 5, 2026
f5ff59e
fix linter
GrayHoang Sep 5, 2026
7f470d4
remove guard macro
GrayHoang Sep 5, 2026
6b25da2
remove guard macro
GrayHoang Sep 6, 2026
b192a20
remove action macro
GrayHoang Sep 6, 2026
c9b0f2f
remove macros and format
GrayHoang Sep 6, 2026
6023c66
more formatting
GrayHoang Sep 6, 2026
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
1 change: 0 additions & 1 deletion .github/actions/environment-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ runs:
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc

- name: Run setup_software.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ jobs:
# //software/gameplay_tests/... \
run: |
cd src
bazel test //software/gameplay_tests:requirements_test
bazel test //software/gameplay_tests:requirements.test
bazel test --copt=-O3 --flaky_test_attempts=3 --show_timestamps \
--test_arg="--ci_mode" \
-- //software:unix_full_system \
-//software/gameplay_tests:requirements_test \
-//software/gameplay_tests:requirements.test \
//software/ai/hl/... \
//software/ai/navigator/...

Expand Down
15 changes: 9 additions & 6 deletions src/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build --auto_cpu_environment_group=//toolchains/cc:cpus
# Use Our Custom Toolchain
build --crosstool_top=//toolchains/cc:toolchain
common --features=external_include_paths
common --features=generated_include_paths

################# Build Optimizations #################

Expand All @@ -44,8 +45,9 @@ common --features=external_include_paths
# 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
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc
common --incompatible_default_to_explicit_init_py

# Ensure that we don't accidentally build gRPC
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
Expand All @@ -54,6 +56,7 @@ common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUIL
################# Build Configurations #################
# Lock C++ version
build --cxxopt="-std=c++2a"

# Warn variable length arrays only when compiling cpp
build --per_file_copt=.*\.cpp@-Wvla

Expand All @@ -68,21 +71,21 @@ common --enable_platform_specific_config
build --incompatible_remove_legacy_whole_archive=False

# Escalate Warnings to fail Compile for Thunderbots code
build --features=external_include_paths
build:linux --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=software/.*,shared/.*,-external/.*@-Wconversion

build --cxxopt="-DG3_DYNAMIC_LOGGING"

build --per_file_copt=.*\.pb\.(h|cc|cpp)$@-w
build --per_file_copt=./external/.*,./bazel-out/.*@-w

build --per_file_copt=^external/.*,^bazel-out/.*@-w
build --host_per_file_copt=^external/.*,^bazel-out/.*@-w

# Define Robot Versions
build --copt="-DCURRENT_ROBOT_VERSION=2026"

# Limit the number of jobs to prevent stalling the machine
build --local_cpu_resources=HOST_CPUS*0.75
build --local_resources=cpu=HOST_CPUS*0.75

############## External Deps Compatibility ##############
build --noincompatible_disallow_ctx_resolve_tools
Expand Down
2 changes: 1 addition & 1 deletion src/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2.1
9.1.1
1 change: 0 additions & 1 deletion src/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")

# Generates compile_commands.json
refresh_compile_commands(
Expand Down
120 changes: 84 additions & 36 deletions src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ module(
##############################################################
# Import Dependencies available in the Bazel Central Registry
##############################################################
bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "pybind11_bazel", version = "2.13.6")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "googletest", version = "1.16.0.bcr.2")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "pybind11_bazel", version = "3.0.1")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_cc", version = "0.2.19")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
bazel_dep(name = "zlib", version = "1.3.1.bcr.6")
bazel_dep(name = "nanopb", version = "0.4.9.1.bcr.2")
bazel_dep(name = "protobuf", version = "31.1")
bazel_dep(name = "rules_python", version = "2.2.0")
bazel_dep(name = "eigen", version = "5.0.1.bcr.2")
bazel_dep(name = "zlib", version = "1.3.1.bcr.7")
bazel_dep(name = "nanopb", version = "0.4.9.1.bcr.3")
bazel_dep(name = "protobuf", version = "35.1")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "yaml-cpp", version = "0.8.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.0.3")
Expand Down Expand Up @@ -47,6 +49,10 @@ pip.parse(
python_interpreter = "/opt/tbotspython/bin/python",
python_version = "3.12",
requirements_lock = "//software/embedded/ansible:requirements_lock.txt",
target_platforms = [
"linux_x86_64",
"linux_aarch64",
],
)
use_repo(pip, "ansible_deps")
pip.parse(
Expand All @@ -61,6 +67,10 @@ pip.parse(
python_interpreter = "/opt/tbotspython/bin/python",
python_version = "3.12",
requirements_lock = "//software/embedded/robot_diagnostics_cli:requirements_lock.txt",
target_platforms = [
"linux_x86_64",
"linux_aarch64",
],
)
use_repo(pip, "robot_diagnostics_cli_deps")
pip.parse(
Expand Down Expand Up @@ -92,31 +102,32 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht

http_archive(
name = "tomlplusplus",
build_file = "@//extlibs:tomlplusplus.BUILD",
build_file = "@//extlibs:tomlplusplus.bzl",
patches = ["//starlark/patches/tomlplusplus:fix_arm_alignment.patch"],
sha256 = "8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155",
strip_prefix = "tomlplusplus-3.4.0",
urls = ["https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.tar.gz"],
)

http_archive(
name = "g3log",
build_file = "@//extlibs:g3log.BUILD",
build_file = "@//extlibs:g3log.bzl",
sha256 = "2177e6dfd86fa7465c44c8ef5c3b6ab98ffc94e1130355d6982f7d886cb7bec9",
strip_prefix = "g3log-2.4",
url = "https://github.com/KjellKod/g3log/archive/refs/tags/2.4.zip",
)

http_archive(
name = "g3sinks",
build_file = "@//extlibs:g3sinks.BUILD",
build_file = "@//extlibs:g3sinks.bzl",
sha256 = "77632432de1ec456987c7d83c6eb163bb42f0eb9df6e0bdf63bcf7961c1f6c70",
strip_prefix = "g3sinks-1.1.3",
url = "https://github.com/KjellKod/g3sinks/archive/1.1.3.zip",
)

http_archive(
name = "base64",
build_file = "@//extlibs:base64.BUILD",
build_file = "@//extlibs:base64.bzl",
sha256 = "5e5366919938b834ca95fec4c2a80ad0c002872175d43226c933d25e40572883",
strip_prefix = "cpp-base64-2.rc.08",
url = "https://github.com/ReneNyffenegger/cpp-base64/archive/refs/tags/V2.rc.08.zip",
Expand All @@ -125,10 +136,9 @@ http_archive(
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
module_name = "rules_boost",
# Made with: shasum -a 256 rules_boost-2a003f812e9a13b970e4100d96856b09ee13a582.tar.gz
sha256 = "f3125bbcb4adb5863980562d6092f2c07571cc9b2d4510e3b7f829fd43b44607",
strip_prefix = "rules_boost-2a003f812e9a13b970e4100d96856b09ee13a582",
url = "https://github.com/nelhage/rules_boost/archive/2a003f812e9a13b970e4100d96856b09ee13a582.tar.gz",
sha256 = "722178ab4687ebf48c66229a0fe774759bd836257bcede2ed972b0e32ce92c33",
strip_prefix = "rules_boost-2811ec9f1e42f784439a7bbecf68b1c8b5f8b0ae",
url = "https://github.com/nelhage/rules_boost/archive/2811ec9f1e42f784439a7bbecf68b1c8b5f8b0ae.tar.gz",
)

non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
Expand All @@ -141,6 +151,11 @@ use_repo(
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
archive_override(
module_name = "hedron_compile_commands",
patches = [
"//starlark/patches/hedron_compile_commands:add_rules_python_dep.patch",
"//starlark/patches/hedron_compile_commands:fix_py_binary.patch",
"//starlark/patches/hedron_compile_commands:fix_cc_binary.patch",
],
sha256 = "ba3feefdf57b6d4c749e3c4abfa86f3673e7db364cb13acfc3496dce6ea801a3",
strip_prefix = "bazel-compile-commands-extractor-f5fbd4cee671d8d908f37c83abaf70fba5928fc7",
url = "https://github.com/mikael-s-persson/bazel-compile-commands-extractor/archive/f5fbd4cee671d8d908f37c83abaf70fba5928fc7.tar.gz",
Expand All @@ -149,46 +164,47 @@ archive_override(
bazel_dep(name = "platformio_rules", repo_name = "platformio_rules")
archive_override(
module_name = "platformio_rules",
patches = ["//starlark/patches/platformio_rules:add_py_binary_load.patch"],
sha256 = "a80357230e27b8b57b8deffaa82684d3ee88b2284e4a767a9d8a692e9034e125",
strip_prefix = "platformio_rules-3cd18c7c7bb2482fe3cbb58898245dd675421234",
url = "https://github.com/mum4k/platformio_rules/archive/3cd18c7c7bb2482fe3cbb58898245dd675421234.tar.gz",
)

# This is overridden despite being in BCR since it contains protoc v31.1. We can remove this once BCR updates
archive_override(
module_name = "toolchains_protoc",
sha256 = "a694e39b16064011c11ce8719207736d1cd2ed5f56a4c73534174da7eea0dd2e",
strip_prefix = "toolchains_protoc-ea1a220e47b4c9c654f3bd198107c605ae27cf06",
url = "https://github.com/aspect-build/toolchains_protoc/archive/ea1a220e47b4c9c654f3bd198107c605ae27cf06.tar.gz",
module_name = "nanopb",
patches = ["//starlark/patches/nanopb:fix_protobuf_syspath.patch"],
sha256 = "1ae1c26cee315dc8840d6e436d3306c43f8fe41c4326d00dbc193b334658bb82",
strip_prefix = "nanopb-d21fa5084287ab67da2f166f4def045bedcb535e",
url = "https://github.com/nanopb/nanopb/archive/d21fa5084287ab67da2f166f4def045bedcb535e.tar.gz",
)

http_archive(
name = "bullet",
build_file = "@//extlibs:bullet.BUILD",
build_file = "@//extlibs:bullet.bzl",
sha256 = "0af974ece80e528182ac47a0c0b1506b5aeeb570fdb7d4fd7044efe67babc7a1",
strip_prefix = "bullet3-272c7099d3ba8ac9e8c142e361e8d4cf5d91b8f2",
url = "https://github.com/bulletphysics/bullet3/archive/272c7099d3ba8ac9e8c142e361e8d4cf5d91b8f2.tar.gz",
)

http_archive(
name = "sml",
build_file = "@//extlibs:sml.BUILD",
build_file = "@//extlibs:sml.bzl",
sha256 = "e3a8a76495d81b479fa53f2301b55d07251178ca3d5da781d5709814ec8baec3",
strip_prefix = "sml-07a503cc3f18de2b861ea15d8357d3b3c0c978d6",
url = "https://github.com/boost-ext/sml/archive/07a503cc3f18de2b861ea15d8357d3b3c0c978d6.tar.gz",
)

http_archive(
name = "tracy",
build_file = "@//extlibs:tracy.BUILD",
build_file = "@//extlibs:tracy.bzl",
sha256 = "c24ce6179df7efb8a114fe409d197e26e4b937c6fc1258bea15840b15b1f79ff",
strip_prefix = "tracy-37aff70dfa50cf6307b3fee6074d627dc2929143",
url = "https://github.com/wolfpld/tracy/archive/37aff70dfa50cf6307b3fee6074d627dc2929143.tar.gz",
)

http_archive(
name = "munkres_cpp",
build_file = "@//extlibs:munkres_cpp.BUILD",
build_file = "@//extlibs:munkres_cpp.bzl",
sha256 = "a59d8cb17b0776abb2c5b6341f6863e705406deb1f3dfb5a6e07af187c4203f4",
strip_prefix = "munkres-cpp-61086fcf5b3a8ad4bda578cdc2d1dca57b548786",
url = "https://github.com/saebyn/munkres-cpp/archive/61086fcf5b3a8ad4bda578cdc2d1dca57b548786.tar.gz",
Expand All @@ -207,7 +223,7 @@ use_repo(openocd, "com_openocd")

http_archive(
name = "LTC4151",
build_file = "@//extlibs:LTC4151.BUILD",
build_file = "@//extlibs:LTC4151.bzl",
sha256 = "6aa2dd380a13b08366338cdf0fbbeeeed96887512ac7b0753ee6ea1e8856df31",
strip_prefix = "LTC4151-729952f10bcdcf359877b6f728565c17a8f17423",
url = "https://github.com/kerrydwong/LTC4151/archive/729952f10bcdcf359877b6f728565c17a8f17423.tar.gz",
Expand All @@ -225,7 +241,7 @@ git_repository(

http_archive(
name = "cppcrc",
build_file = "@//extlibs:cppcrc.BUILD",
build_file = "@//extlibs:cppcrc.bzl",
strip_prefix = "cppcrc-6360eee1c8966d32b2552ce156b135ec6a3235f1",
url = "https://github.com/DarrenLevine/cppcrc/archive/6360eee1c8966d32b2552ce156b135ec6a3235f1.zip",
)
Expand Down Expand Up @@ -256,53 +272,85 @@ new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.

new_local_repository(
name = "linux_k8_gcc",
build_file = "@//extlibs:linux_k8_gcc.BUILD",
build_file = "@//extlibs:linux_k8_gcc.bzl",
path = "/",
)

new_local_repository(
name = "linux_aarch64_gcc",
build_file = "@//extlibs:linux_aarch64_gcc.BUILD",
build_file = "@//extlibs:linux_aarch64_gcc.bzl",
path = "/",
)

# libclang-dev is installed into the system through setup_software.sh
new_local_repository(
name = "libclang",
build_file = "@//extlibs:libclang.BUILD",
build_file = "@//extlibs:libclang.bzl",
path = "/usr/lib/llvm-6.0/",
)

new_local_repository(
name = "k8_aarch64_linux_gcc",
build_file = "@//extlibs:k8_aarch64_linux_gcc.BUILD",
build_file = "@//extlibs:k8_aarch64_linux_gcc.bzl",
path = "/opt/tbotspython/aarch64-tbots-linux-gnu/",
)

new_local_repository(
name = "macos_robot_gcc",
build_file = "@//extlibs:macos_robot_gcc.BUILD",
build_file = "@//extlibs:macos_robot_gcc.bzl",
path = "/opt/homebrew/opt/aarch64-unknown-linux-gnu/toolchain/",
)

new_local_repository(
name = "motor_board_gcc",
build_file = "@//extlibs:motor_board_gcc.BUILD",
build_file = "@//extlibs:motor_board_gcc.bzl",
path = "/opt/tbotspython/arm-none-eabi-gcc/",
)

new_local_repository(
name = "py_cc_toolchain_host",
build_file = "@//extlibs:py_cc_toolchain.BUILD",
build_file = "@//extlibs:py_cc_toolchain.bzl",
path = "/opt/tbotspython/py_headers/include/python3.12/",
)

new_local_repository(
name = "py_cc_toolchain_for_k8_aarch64_linux",
build_file = "@//extlibs:py_cc_toolchain.BUILD",
build_file = "@//extlibs:py_cc_toolchain.bzl",
path = "/opt/tbotspython/cross_compile_headers/include/python3.12/",
)

##############################################
# Workarounds and Fixes Below (hacks)
##############################################

# Bazel 9 compatibility: register rules_cc compatibility proxy for
# transitive dependencies that haven't been updated.
cc_compat = use_extension("@rules_cc//cc:extensions.bzl", "compatibility_proxy")
use_repo(cc_compat, "cc_compatibility_proxy")

# googletest 1.16.0.bcr.2 needs compat proxy registration for Bazel 9.
single_version_override(
module_name = "googletest",
patches = ["//starlark/patches/googletest:add_compat_proxy.patch"],
version = "1.16.0.bcr.2",
)

# pybind11_protobuf needs Bazel 9 compat and protobuf 35 API fixes.
single_version_override(
module_name = "pybind11_protobuf",
patches = [
"//starlark/patches/pybind11_protobuf:add_compat_proxy.patch",
"//starlark/patches/pybind11_protobuf:protobuf35_compat.patch",
],
)

# protobuf's Python extensions pull host headers via @system_python, which
# breaks aarch64 cross-compilation. Use @rules_python's py_cc_toolchain
# headers (@rules_python//python/cc:current_py_cc_headers) instead.
single_version_override(
module_name = "protobuf",
patches = [
"//starlark/patches/protobuf:use_py_cc_toolchain_headers.patch",
"//starlark/patches/protobuf:use_py_cc_toolchain_headers_py_extension.patch",
],
)
Loading
Loading