Skip to content

Hermeticity (Bazel) RFC Parent PR - #3993

Open
nycrat wants to merge 72 commits into
masterfrom
avah/minimal_environment_setup_tscope
Open

nycrat wants to merge 72 commits into
masterfrom
avah/minimal_environment_setup_tscope

Conversation

@nycrat

@nycrat nycrat commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Description

This PR is a part of my investigation for an upcoming Bazel Hermeticity RFC, focusing on reducing system dependencies, installing everything into a sandbox, and relying more on Bazel for hermetic builds.

# From the root of the repo:
sudo ./environment_setup/setup_minimal.sh
source /opt/tbots/bin/activate
cd src
bazel test //software/geom:angle_test

Testing Done

Added macos action runners, all existing unit tests and gameplay tests pass on Ubuntu 24.04 LTS AMD64 and macOS ARM64.
Successfully flashed all robot firmware from ubuntu + mac

Resolved Issues

https://docs.google.com/document/d/1cam8jKuT5yypffBHXzS4RuQz8_JQPsnU5AbguNIHlpY/edit?usp=sharing

Length Justification and Key Files to Review

... technically we broke it apart as much as possible, but we just need to do a final review of everything cause everything is dependent

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

nycrat added 30 commits October 11, 2026 21:23
@nycrat
nycrat force-pushed the avah/minimal_environment_setup_tscope branch from 18ddc9f to 7140518 Compare November 20, 2026 00:03
nycrat and others added 2 commits November 19, 2026 17:17
* undo linter and formatter changes for PR cleanliness

* Replace bazel run x5 with bazel build to all targets in one line, remove temp folder

* Add newlines x2

---------

Co-authored-by: Avah Xiao <avahxiao@gmail.com>
@nycrat
nycrat removed this pull request from stack #4058 November 20, 2026 00:24
Comment on lines +38 to +44
// (void)this used to avoid -Wunused-lambda-capture.
#define DEFINE_SML_GUARD(FUNCTION) \
const auto FUNCTION##_G = [this](auto event) { return FUNCTION(event); };
const auto FUNCTION##_G = [this](auto event) \
{ \
(void)this; \
return FUNCTION(event); \
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we have to cast this to void here when we don't for the other macros, e.g. DEFINE_SML_ACTION

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure actually, I just know that this specific macro was emitting -Wunused-lambda-capture warning. I think grayson's #3920 PR (whenever he finishes it) will completely change these macros anyways

Comment thread src/software/util/typename/typename.cpp Resolved
Comment thread src/starlark/lint/requirements.in Resolved
Comment thread environment_setup/setup_minimal.sh Resolved

@williamckha williamckha Nov 21, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this the setup script to use now? If so can we just name it setup.sh

What are we doing with the other files in environment_setup (setup_software.sh, setup_software_mac.sh, requirements.txt, util.sh), are we going to delete them?

Also need to update Getting Started docs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was initially thinking of doing a final clean up PR, but idk I kinda want to get this merged asap. Maybe i'll do a stack so it'll be easier to review later today

Comment thread src/extlibs/bullet.bzl Resolved
Comment thread src/extlibs/bullet.bzl Resolved
Comment thread src/extlibs/g3log.bzl Resolved
@GrantYu9
GrantYu9 self-requested a review November 21, 2026 19:50
maggiettu and others added 9 commits November 21, 2026 13:30
* TIGERs AutoRef is pulled by Bazel

* Bazel uses hermetic Java/JDK

* changing setup script to not install autoref

* Thunderscope can run AutoRef with explicit java flag

* wrapper for jave version

* Minor import fix

* Revert game controller change

* Simplify java version 21 config

* Remove outdated references to autoref

* Remove unzip refernece no longer needed

* Rename BUILD.bazel to BUILD

* Remove checks that should never fail

* Fix no newline

* Update runtime file path

---------

Co-authored-by: Avah Xiao <avahxiao@gmail.com>
* Remove already indirectly included pyqt6-qt6 dependency

* Create minimal environment setup for running thunderscope

* Re-write setup to only use wget and install all into /opt/tbots

* Fix user vs sudo_user bug

* Fix autoref binary context manager to refer to new path

* Add tigers autoref installation in minimal script

* Fix issues caused by merge

* Run minimal setup on ci/cd

* Run setup as sudo on ci

* Use hermetic llvm toolchain for c++ builds

* some clang compatibility stuff on linux

* Use /opt/tbots/ for thunderscope local files for now

* Install xvfb on action runner to make headless ui work

* Debug ci gui dependencies

* Test

* Test ci again

* fix floating point exception in bullet when O3 is on

* Add gui dependency for linux ci runner

* Re-enable -Werror and fix lots of warnings

* Fix autoref unzip destination

* Fix signed type

* Simplify setup minimal script

* Perhaps this will work for cross compile for robot software

* Get rid of gcc thing that isn't relevant with clang

* Cross compile for STM32 motor board

* Remove old toolchain configs (this might break everything)

* Hermetic platformio

* Fix diagnostics cli not finding python venv

* update requirements_lock.txt

* Patch to resolve esptool thingy

* Fix some minor issues

* Update CI stuff

* Define starlark transition to be able to flash robot software on any

* Add unzip as a system requirement in comment

* Remove unused variable

* Update bcr googletest version, removing patches

* Fix googletest version compat issues

* Fix previously ignored unit tests

* Add chardet as explicit dependency for platformio

* Add --no-annotate flag for platformio requirements lock

* Resolve small type error

* Remove temporary test script

* Nonsense

* Let's see if this works

* Test

* Test

* Test

* Add CI actions for my branch

* Implement CI actions for stack PRs for Bazel RFC

* Fix

* Fix

* Please work please work please work

* Please fix it

* Please fix it

* More fixes

* Maybe fix

* Maybe fix

* Better name

Better Feng Shui

* Some more fixes

* Remove nonsense

* Maybe fix

* Yay maybe

* idoqiweftn

* twaoieftna

* Fix

* Done

* Fix

* Addition

* Fix

* Fix

* Fix

* idk

* idk

* idk

* Fix

* idk

* Fix

* idk

* fix

* fix

---------

Co-authored-by: Avah Xiao <avahxiao@gmail.com>

@GrantYu9 GrantYu9 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me 🔥💯🔥💯🔥💯

@Thunderbots
Thunderbots force-pushed the avah/minimal_environment_setup_tscope branch from 5e2fab9 to 2003e8b Compare November 22, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants