Revert "try removing submodule symlinks (#38310)"

This reverts commit b827c0f55e.
This commit is contained in:
Adeeb Shihadeh
2026-07-08 21:12:12 -07:00
parent b827c0f55e
commit f283f6703c
12 changed files with 13 additions and 52 deletions
-7
View File
@@ -15,13 +15,6 @@ a.out
.cache/
bin/
# created at launch for TICI PYTHONPATH (PC uses editable installs via pyproject.toml)
/msgq
/opendbc
/rednose
/teleoprtc
/tinygrad
*.mp4
*.dylib
*.DSYM
+4 -25
View File
@@ -27,24 +27,6 @@ AddOption('--minimal',
default=(not TICI and not release),
help='the minimum build to run openpilot. no tests, tools, etc.')
# Package symlinks are no longer tracked in git (created at launch on device).
# Create them here so PYTHONPATH-based imports find in-tree packages and
# Cython extensions during the build (especially release builds).
_repo_root = Dir('#').abspath
for _pkg, _target in (
('msgq', 'msgq_repo/msgq'),
('opendbc', 'opendbc_repo/opendbc'),
('rednose', 'rednose_repo/rednose'),
('teleoprtc', 'teleoprtc_repo/teleoprtc'),
('tinygrad', 'tinygrad_repo/tinygrad'),
):
_link = os.path.join(_repo_root, _pkg)
if os.path.lexists(_link):
if os.path.islink(_link) and os.readlink(_link) == _target:
continue
os.unlink(_link)
os.symlink(_target, _link)
# Detect platform
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
@@ -146,10 +128,7 @@ env = Environment(
CXXFLAGS=["-std=c++1z"],
CPPPATH=[
"#openpilot",
"#msgq_repo", # #include "msgq/..."
"#opendbc_repo", # #include "opendbc/..."
"#rednose_repo", # #include "rednose/..."
"#rednose_repo/rednose", # #include "logger/..." (rednose package root)
"#msgq",
"#openpilot/cereal/gen/cpp",
acados_include_dirs,
[x.INCLUDE_DIR for x in pkgs],
@@ -159,13 +138,13 @@ env = Environment(
"#openpilot/common",
"#msgq_repo",
"#openpilot/selfdrive/pandad",
"#rednose_repo/rednose/helpers",
"#rednose/helpers",
[x.LIB_DIR for x in pkgs],
],
RPATH=[ffmpeg.LIB_DIR] if ffmpeg_shared else [],
CYTHONCFILESUFFIX=".cpp",
COMPILATIONDB_USE_ABSPATH=True,
REDNOSE_ROOT="#rednose_repo",
REDNOSE_ROOT="#",
tools=["default", "cython", "compilation_db", "rednose_filter"],
toolpath=["#site_scons/site_tools", "#rednose_repo/site_scons/site_tools"],
)
@@ -270,7 +249,7 @@ Export('messaging')
SConscript(['panda/SConscript'])
# Build rednose library
SConscript(['rednose_repo/rednose/SConscript'])
SConscript(['rednose/SConscript'])
# Build system services
SConscript([
-8
View File
@@ -70,14 +70,6 @@ function launch {
ln -sfn $(pwd) /data/pythonpath
export PYTHONPATH="$PWD"
# submodule package symlinks for PYTHONPATH imports on device.
# on PC these come from editable installs via pyproject.toml / uv.
ln -sfn msgq_repo/msgq msgq
ln -sfn opendbc_repo/opendbc opendbc
ln -sfn rednose_repo/rednose rednose
ln -sfn teleoprtc_repo/teleoprtc teleoprtc
ln -sfn tinygrad_repo/tinygrad tinygrad
# hardware specific init
if [ -f /AGNOS ]; then
agnos_init
Symlink
+1
View File
@@ -0,0 +1 @@
msgq_repo/msgq
Symlink
+1
View File
@@ -0,0 +1 @@
opendbc_repo/opendbc
@@ -124,12 +124,4 @@ else
safe_checkout
fi
# submodule package symlinks for PYTHONPATH imports on device (same as launch_chffrplus.sh)
cd $TEST_DIR
ln -sfn msgq_repo/msgq msgq
ln -sfn opendbc_repo/opendbc opendbc
ln -sfn rednose_repo/rednose rednose
ln -sfn teleoprtc_repo/teleoprtc teleoprtc
ln -sfn tinygrad_repo/tinygrad tinygrad
echo "$TEST_DIR synced with $GIT_COMMIT, t=$SECONDS"
+1 -1
View File
@@ -76,7 +76,7 @@ cabana_env['CPPPATH'] += [libusb.INCLUDE_DIR]
cabana_env['LIBPATH'] += [libusb.LIB_DIR]
cabana_libs = [cereal, messaging, visionipc, replay_lib] + ffmpeg_libs + ['bz2', 'zstd', 'usb-1.0'] + base_libs
opendbc_path = '-DOPENDBC_FILE_PATH=\'"%s"\'' % (cabana_env.Dir("../../../opendbc_repo/opendbc/dbc").abspath)
opendbc_path = '-DOPENDBC_FILE_PATH=\'"%s"\'' % (cabana_env.Dir("../../../opendbc/dbc").abspath)
cabana_env['CXXFLAGS'] += [opendbc_path]
def write_assets_qrc(target, source, env):
+1 -1
View File
@@ -276,7 +276,7 @@ std::string default_dbc_template() {
DbcEditorSource resolve_dbc_editor_source(const std::string &dbc_name) {
const fs::path generated_dbc_dir = repo_root() / "openpilot" / "tools" / "jotpluggler" / "generated_dbcs";
const std::array<DbcEditorSource, 2> candidates = {{
{.path = repo_root() / "opendbc_repo" / "opendbc" / "dbc" / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Opendbc},
{.path = repo_root() / "opendbc" / "dbc" / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Opendbc},
{.path = generated_dbc_dir / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Generated},
}};
for (const DbcEditorSource &candidate : candidates) {
+2 -2
View File
@@ -385,7 +385,7 @@ std::string detect_dbc_for_fingerprint(std::string_view car_fingerprint) {
std::vector<std::string> available_dbc_names_impl() {
std::set<std::string> names;
for (const fs::path &dbc_dir : {
repo_root() / "opendbc_repo" / "opendbc" / "dbc",
repo_root() / "opendbc" / "dbc",
repo_root() / "openpilot" / "tools" / "jotpluggler" / "generated_dbcs",
}) {
if (fs::exists(dbc_dir) && fs::is_directory(dbc_dir)) {
@@ -407,7 +407,7 @@ std::vector<std::string> available_dbc_names_impl() {
fs::path resolve_dbc_path(const std::string &dbc_name) {
for (const fs::path &candidate : {
repo_root() / "opendbc_repo" / "opendbc" / "dbc" / (dbc_name + ".dbc"),
repo_root() / "opendbc" / "dbc" / (dbc_name + ".dbc"),
repo_root() / "openpilot" / "tools" / "jotpluggler" / "generated_dbcs" / (dbc_name + ".dbc"),
}) {
if (fs::exists(candidate)) return candidate;
Symlink
+1
View File
@@ -0,0 +1 @@
rednose_repo/rednose
Symlink
+1
View File
@@ -0,0 +1 @@
teleoprtc_repo/teleoprtc
Symlink
+1
View File
@@ -0,0 +1 @@
tinygrad_repo/tinygrad