Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
2acb047
init
Andrewyx May 18, 2025
2eb6ad6
partial migration
Andrewyx May 19, 2025
d01e6ba
new bazel upgrade
Andrewyx May 19, 2025
136acf4
partial convert
Andrewyx May 23, 2025
1335c81
libs
Andrewyx May 23, 2025
3ed74a1
workaround on eigen
Lmh-java May 23, 2025
c921654
changes
Andrewyx May 23, 2025
5d8ee06
deduplicate proto lib
Lmh-java May 24, 2025
e6d7efb
instanity
Andrewyx May 24, 2025
8ff5e83
mergeed
Andrewyx May 24, 2025
00069ad
chaos
Andrewyx May 31, 2025
830ebae
WIP: fix protobuf headers
Lmh-java May 31, 2025
4421035
diffs
Andrewyx May 31, 2025
d19541a
Merge branch 'Andrewyx/Upgrade_bazel_8' of https://github.com/Andrewy…
Andrewyx May 31, 2025
3493dc4
working
Andrewyx May 31, 2025
6a8a0c3
logging change
Andrewyx May 31, 2025
77b2217
use eigen from bcr
Lmh-java May 31, 2025
8dc4c04
estop fixed
Andrewyx May 31, 2025
7da3528
caching working + offline usage
Andrewyx Jun 1, 2025
7099a81
merged
Andrewyx Jun 1, 2025
d1c33e6
minor cleanup
Andrewyx Jun 1, 2025
622a89a
toolchain protoc
Andrewyx Jun 1, 2025
f223e95
g3log repo rules
Andrewyx Jun 18, 2025
daef692
merged
Andrewyx Jun 18, 2025
93f2639
changes
Andrewyx Jun 18, 2025
841232f
use bazelisk
Andrewyx Jun 18, 2025
aa3f8c4
cleanup
Andrewyx Jun 19, 2025
54f0b6b
use bazelisk & cleanup
Andrewyx Jun 21, 2025
0c28b8e
refactored
Andrewyx Jun 21, 2025
c33f7d2
merged
Andrewyx Jun 21, 2025
edb69c7
rework gen
Andrewyx Jun 25, 2025
ebd2c25
removed
Andrewyx Jun 25, 2025
aeefc1a
building
Andrewyx Jun 26, 2025
42a21e6
protos compile
Andrewyx Jun 28, 2025
91344ae
Add grpcio-tools to requirements
williamckha Jun 28, 2025
6a05376
almost working
Andrewyx Jul 5, 2025
93f00bb
Merge branch 'Andrewyx/Upgrade_bazel_8' of https://github.com/Andrewy…
Andrewyx Jul 5, 2025
5401e23
building
Andrewyx Jul 5, 2025
f03ac53
pathing issues
Andrewyx Jul 8, 2025
7acd718
hacky
Andrewyx Jul 12, 2025
742d4ac
fix g3log
Lmh-java Jul 13, 2025
52511e5
fix cross compile on aarch64
Lmh-java Jul 20, 2025
45cee49
revise util.sh
Lmh-java Jul 20, 2025
f381061
fix nanopb pb.h
Lmh-java Jul 26, 2025
bc34160
[may revert] fix powerloop tar package
Lmh-java Jul 27, 2025
913e95e
rename generated nanopb files to .nanopb.c and .nanopb.h
Lmh-java Aug 6, 2025
96db9bb
got nanopb to work
Lmh-java Aug 7, 2025
832d5ec
fix aarch64 absolute path issue
Lmh-java Aug 7, 2025
96453c0
fix ci
Lmh-java Aug 8, 2025
3e9a0db
cleanup comments
Lmh-java Aug 8, 2025
aa54064
deps fix
Lmh-java Aug 9, 2025
3584f10
remove sensor_msg from src
Lmh-java Aug 9, 2025
2ed63b7
fixes protolibs
Andrewyx Aug 9, 2025
2df37e0
merged
Andrewyx Aug 9, 2025
69f0c63
missing deps
Andrewyx Aug 9, 2025
05f3f4f
debug removed
Andrewyx Aug 9, 2025
e17158d
missing deps
Andrewyx Aug 10, 2025
f395f0a
missing deps
Andrewyx Aug 10, 2025
9d64a37
deps fixes
Andrewyx Aug 10, 2025
349aeff
linking fixes
Andrewyx Aug 10, 2025
ac7a0f8
updated crc
Andrewyx Aug 10, 2025
fcee549
proto fixes
Andrewyx Aug 10, 2025
0467d6a
hermit fixes
Andrewyx Aug 10, 2025
e726c1d
fix uart test case failure
Lmh-java Aug 11, 2025
7a40c0d
fixes
Andrewyx Aug 11, 2025
266bb51
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 12, 2025
2cc5abc
fix nanopb constraints
Lmh-java Aug 12, 2025
b3e7db0
generalize nanopb options
Lmh-java Aug 15, 2025
3fdcc1d
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 15, 2025
42fd15b
remove hacky copts
Lmh-java Aug 15, 2025
dd6cae9
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 15, 2025
aef0acb
rework buildifier
Lmh-java Aug 16, 2025
fba6d39
integrate new buildifier to ci
Lmh-java Aug 17, 2025
ef253f7
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Aug 22, 2025
5c9d219
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Aug 22, 2025
79e37e7
fixes and changed platformio build upstream
Andrewyx Aug 23, 2025
d5185d0
working on robot
Thunderbots Aug 30, 2025
07727ab
address comments
Lmh-java Sep 4, 2025
b8f4920
pass ci
Lmh-java Sep 4, 2025
0845115
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
Thunderbots Sep 4, 2025
7642f62
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 4, 2025
a1d66cf
Add nanopb requirements to compile_pip_requirements.sh
Thunderbots Sep 4, 2025
682bdea
Merge branch 'Andrewyx/Upgrade_bazel_8' of https://github.com/Andrewy…
Thunderbots Sep 4, 2025
1669768
cleanup
Andrewyx Sep 5, 2025
2e526c6
merged
Andrewyx Sep 5, 2025
521ec25
removed trinamic hacks
Lmh-java Sep 5, 2025
c7bdcfc
Merge branch 'Andrewyx/Upgrade_bazel_8' of github.com:Andrewyx/Softwa…
Andrewyx Sep 5, 2025
16a6c85
working on robot, tar broken
Thunderbots Sep 9, 2025
8e60dd2
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Sep 9, 2025
6a543cb
tar fixes
Andrewyx Sep 11, 2025
f97c2e6
partial fix to warnings
Thunderbots Sep 14, 2025
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
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/embedded/... \
-//cc_toolchain/...
-//toolchains/cc/...

- name: Jetson Nano Build Test
run: |
cd src
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//cc_toolchain:robot
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//toolchains/cc:robot

- name: Raspberry Pi Build Test
run: |
cd src
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//cc_toolchain:robot
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//toolchains/cc:robot


software-tests:
Expand All @@ -68,7 +68,7 @@ jobs:
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/ai/navigator/... \
-//cc_toolchain/...
-//toolchains/cc/...

robot-tests:
name: Robot Software Tests
Expand Down Expand Up @@ -97,13 +97,13 @@ jobs:
- name: Jetson Nano Build
run: |
cd src
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//cc_toolchain:robot
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=NANO --platforms=//toolchains/cc:robot


- name: Raspberry Pi Build
run: |
cd src
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//cc_toolchain:robot
bazel build //software/embedded:thunderloop_main --copt=-O3 --//software/embedded:host_platform=PI --platforms=//toolchains/cc:robot


simulated-gameplay-tests:
Expand All @@ -112,7 +112,7 @@ jobs:
steps:
# checks-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v4

- name: Environment Setup
run: |
"${GITHUB_WORKSPACE}"/environment_setup/setup_software.sh
Expand Down
1 change: 1 addition & 0 deletions environment_setup/ubuntu20_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ PyOpenGL==3.1.6
ruff==0.5.5
pyqt-toast-notification==1.3.2
md-toc==9.0.0
grpcio-tools==1.71.0
1 change: 1 addition & 0 deletions environment_setup/ubuntu22_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ numpy==1.26.4
ruff==0.5.5
pyqt-toast-notification==1.3.2
md-toc==9.0.0
grpcio-tools==1.71.0
1 change: 1 addition & 0 deletions environment_setup/ubuntu24_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ PyOpenGL==3.1.6
ruff==0.5.5
pyqt-toast-notification==1.3.2
md-toc==9.0.0
grpcio-tools==1.71.0
40 changes: 23 additions & 17 deletions environment_setup/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ install_autoref() {
}

install_bazel() {
download=https://github.com/bazelbuild/bazel/releases/download/5.4.0/bazel-5.4.0-linux-arm64
download=https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-arm64

if is_x86 $1; then
download=https://github.com/bazelbuild/bazel/releases/download/5.4.0/bazel-5.4.0-linux-x86_64
download=https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-amd64
fi

wget -nc $download -O /tmp/tbots_download_cache/bazel
sudo mv /tmp/tbots_download_cache/bazel /usr/bin/bazel
sudo chmod +x /usr/bin/bazel
Expand Down Expand Up @@ -96,28 +95,35 @@ install_java () {
}

install_python_dev_cross_compile_headers() {
mkdir -p /opt/tbotspython/cross_compile_headers
wget -N https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz -O /tmp/tbots_download_cache/python-3.12.0.tar.xz
tar -xf /tmp/tbots_download_cache/python-3.12.0.tar.xz -C /tmp/tbots_download_cache/
cd /tmp/tbots_download_cache/Python-3.12.0

# The configuration is taken from the examples provided in https://docs.python.org/3.12/using/configure.html
echo ac_cv_buggy_getaddrinfo=no > config.site-aarch64
echo ac_cv_file__dev_ptmx=yes >> config.site-aarch64
echo ac_cv_file__dev_ptc=no >> config.site-aarch64
if is_x86 $1; then
mkdir -p /opt/tbotspython/cross_compile_headers
wget -N https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz -O /tmp/tbots_download_cache/python-3.12.0.tar.xz
tar -xf /tmp/tbots_download_cache/python-3.12.0.tar.xz -C /tmp/tbots_download_cache/
cd /tmp/tbots_download_cache/Python-3.12.0

# The configuration is taken from the examples provided in https://docs.python.org/3.12/using/configure.html
echo ac_cv_buggy_getaddrinfo=no > config.site-aarch64
echo ac_cv_file__dev_ptmx=yes >> config.site-aarch64
echo ac_cv_file__dev_ptc=no >> config.site-aarch64
CONFIG_SITE=config.site-aarch64 ./configure \
--build=x86_64-pc-linux-gnu \
--host=aarch64-unknown-linux-gnu \
-with-build-python=/usr/bin/python3.12 \
--enable-optimizations \
--prefix=/opt/tbotspython/cross_compile_headers > /dev/null
make inclinstall -j$(nproc) > /dev/null

cd -
rm -rf /tmp/tbots_download_cache/Python-3.12.0
rm -rf /tmp/tbots_download_cache/python-3.12.0.tar.xz
else
CONFIG_SITE=config.site-aarch64 ./configure \
--build=aarch64-pc-linux-gnu \
--host=aarch64-unknown-linux-gnu \
-with-build-python=/usr/bin/python3.12 \
--enable-optimizations \
--prefix=/opt/tbotspython/cross_compile_headers > /dev/null
fi
make inclinstall -j$(nproc) > /dev/null

cd -
rm -rf /tmp/tbots_download_cache/Python-3.12.0
rm -rf /tmp/tbots_download_cache/python-3.12.0.tar.xz
}

is_x86() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/compile_pip_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BAZEL_ROOT_DIR="$CURR_DIR/../src"

cd $BAZEL_ROOT_DIR
bazel run //extlibs:nanopb_requirements.update
bazel run //software/thunderscope:requirements.update
bazel run //software/embedded/ansible:requirements.update
bazel run //software/simulated_tests:requirements.update
bazel run //software/embedded/robot_diagnostics_cli:requirements.update
bazel run //starlark/nanopb:requirements.update
2 changes: 1 addition & 1 deletion scripts/lint_and_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function run_clang_format () {
function run_bazel_formatting () {
printf "Running bazel buildifier to format all bazel BUILD files...\n\n"
cd $BAZEL_ROOT_DIR
bazel run @com_github_bazelbuild_buildtools//:buildifier
bazel run //starlark/buildifier:buildifier.fix

if [[ "$?" != 0 ]]; then
printf "\n***Failed to format bazel BUILD files!***\n\n"
Expand Down
84 changes: 62 additions & 22 deletions src/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@

# We rely on all symbols being included when linking for our implementation of
# the "factory" design pattern.
build --incompatible_remove_legacy_whole_archive=False
################## 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

# Use Our Custom Toolchain
build --crosstool_top=//cc_toolchain:toolchain

# Add warnings to Thunderbots code only
build --per_file_copt=//proto/.*,//proto/message_translation/.*,//proto/primitive/.*,//software/.*,//shared/.*@-Wall,-Wextra,-Wconversion,-Wno-unused-parameter,-Wno-deprecated,-Werror,-Wno-deprecated-declarations
################## Bazel Debug Configs ##################

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

# Automatically set the CPU environment based on the `--cpu` flag as per our
# defined CPU environments
build --auto_cpu_environment_group=//cc_toolchain:cpus
# Enable the following commands to debug Bazel. Note that the additional overhead from these commands will
# cause CI to fail
# common --verbose_failures
Comment thread
Andrewyx marked this conversation as resolved.
# common --sandbox_debug

# 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
################ 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
Expand All @@ -34,6 +26,54 @@ build --test_env=DISPLAY
build --action_env=PYTHON_BIN_PATH=/opt/tbotspython/bin/python3.12
build --action_env=PYTHON_LIB_PATH=/opt/tbotspython/lib/python3.12

# Enable the new cc_toolchain resolution strategy
# #TODO(#3382): Delete when we upgrade to Bazel 7.0
build --incompatible_enable_cc_toolchain_resolution
# 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
build --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
Comment on lines +77 to +78

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do these options do?


2 changes: 1 addition & 1 deletion src/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0
8.2.1
3 changes: 1 addition & 2 deletions src/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@rules_python//python:defs.bzl", "py_runtime")
load("@rules_python//python:defs.bzl", "py_runtime_pair")
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
Loading
Loading