Repository navigation
rj_protos Cleanup - #2582
rj_protos Cleanup#2582sanatd33 wants to merge 21 commits into
Conversation
automated style fixes Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>
automated style fixes Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>
automated style fixes Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>
N8BWert
left a comment
There was a problem hiding this comment.
Changes seem good to me. I ran this in sim and with the external referee and things seem to work as expected so PR looks good to me.
CameronLyon
left a comment
There was a problem hiding this comment.
Left some comments, but basically complete on the functionality of rj_protos. I'd say check out the "dubious ownership" issue and see if my other two comments need any changes, then merge when you feel ready.
| if ! $NO_SUBMODULES; then | ||
| make update-submodules | ||
| fi |
There was a problem hiding this comment.
This might fail under "dubious ownership in repository". You got something earlier:
Become root
if [ $UID -ne 0 ]; then
echo "-- Becoming root"
exec sudo
fi
ubuntu-setup restarts itself with sudo, and the new git submodule update sits after that restart, so Git runs as root. Then in that root term, it then tries to use git commands within "make update-submodules":
update-submodules:
git submodule update --init --recursive
Unless we got some setting in our repo that says otherwise, this will cause github to refuse this request under the reasoning that this new user (root), is attempting to change a repo owned by someone else (the actual user of the repo). I think you have to switch it back to the user in order for this to work:
if ! $NO_SUBMODULES; then
if [ -n "${SUDO_USER:-}" ]; then
sudo -u "$SUDO_USER" -- make -C "$BASE" update-submodules
else
make -C "$BASE" update-submodules
fi
fi
| | **Current responsibilities** | _List the responsibilities currently owned by this package._ | | ||
| | **Out of scope** | _State what this package must not own or attempt to solve._ | | ||
| | **Plain-language purpose** | Contains protobuf files for SSL-owned interfaces such as game controller and vision processor. | | ||
| | **Current responsibilities** | Owns the protocol for recieving data from SSL-owned interfaces. | |
|
|
||
| set(PROTO_SRCS) | ||
| set(PROTO_HDRS) | ||
| foreach(proto ${GC_PROTOS} ${SIM_PROTOS}) |
There was a problem hiding this comment.
SIM_PROTO_SRC is src/rj_protos/ssl-simulation-protocol/proto, set on line 12. file(READ) opens ssl_simulation_config.proto and the rest of SIM_PROTOS. If the submodule was never checked out, CMake stops with its own vague message, along the lines of file failed to open for reading plus that path. Nothing in that message says the submodule is missing or what command to run, so maybe add a check + a fatal error message indicating an easy fix for any user who encounters this:
if(NOT EXISTS ${proto_root})
message(FATAL_ERROR
"Proto submodule is missing at ${proto_root}. "
"From the repo root, run: make update-submodules")
Description
Cleaning up rj_protos. Removes any unused protobuf files, and refactors the rest to come from git submodules to the source of truth repos (https://github.com/RoboCup-SSL/ssl-game-controller/ and https://github.com/RoboCup-SSL/ssl-simulation-protocol/)
Associated / Resolved Issue
Resolves ClickUp card
Steps to Test
colon buildExpected result: It builds
Key Files to Review
CMakeLists.txtReview Checklist