Skip to content

Commit 31a203e

Browse files
committed
WIP
1 parent fca2dd8 commit 31a203e

6 files changed

Lines changed: 18 additions & 1 deletion

File tree

environment_setup/setup_software_mac.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ sudo pip install -r macos_requirements.txt
5959

6060
print_status_msg "Done Setting Up Python Environment"
6161

62+
sudo ln -s /opt/tbotspython/bin/platformio /usr/local/bin/platformio
63+
6264
print_status_msg "Fetching game controller"
6365
install_gamecontroller $sys
6466

src/software/embedded/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ cc_library(
4848
name = "spi_utils",
4949
srcs = ["spi_utils.cpp"],
5050
hdrs = ["spi_utils.h"],
51+
# Uses Linux kernel headers (linux/spi/spidev.h); robot-only.
52+
target_compatible_with = ["@platforms//os:linux"],
5153
deps = [
5254
"//software/logger",
5355
],

src/software/embedded/gpio/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ cc_library(
1010
"gpio.h",
1111
"gpio_char_dev.h",
1212
],
13+
# Uses Linux kernel headers (linux/gpio.h); robot-only.
14+
target_compatible_with = ["@platforms//os:linux"],
1315
deps = [
1416
"//software/logger",
1517
"//software/logger:network_logger",

src/software/embedded/motor_controller/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ cc_library(
2727
"stspin_motor_controller.h",
2828
"tmc_motor_controller.h",
2929
],
30+
# Uses Linux kernel headers (linux/spi/spidev.h); robot-only.
31+
target_compatible_with = ["@platforms//os:linux"],
3032
deps = [
3133
":motor_board",
3234
":motor_fault_indicator",

src/software/embedded/services/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ cc_library(
4242
name = "imu",
4343
srcs = ["imu.cpp"],
4444
hdrs = ["imu.h"],
45+
# Uses Linux kernel headers (linux/i2c-dev.h); robot-only.
46+
target_compatible_with = ["@platforms//os:linux"],
4547
deps = [
4648
"//proto:tbots_cc_proto",
4749
"//shared:constants",

src/tbots.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def create_command(config: BuildConfig, extra_args: list[str]) -> list[str]:
189189
if config.test_suite and config.action == ActionArgument.test:
190190
target = """-- //... \\
191191
-//software/gameplay_tests/... \\
192-
-//toolchains/cc/... \\
192+
-//toolchains/... \\
193193
-//software:unix_full_system_tar_gen"""
194194
else:
195195
target = fuzzy_find_target(
@@ -214,6 +214,13 @@ def create_command(config: BuildConfig, extra_args: list[str]) -> list[str]:
214214
if condition:
215215
command += list(flag.value)
216216

217+
# `test --suite` resolves to //..., and `bazel test` would also try to BUILD
218+
# every non-test target in that pattern — including robot firmware that only
219+
# compiles with the cross toolchain (e.g. thunderloop pulls in linux/* headers
220+
# that don't exist on the host). Restrict to test targets and their deps.
221+
if config.test_suite and config.action == ActionArgument.test:
222+
command += ["--build_tests_only"]
223+
217224
if config.jobs_option:
218225
command += [f"--jobs={config.jobs_option}"]
219226

0 commit comments

Comments
 (0)