From f283f6703c08807de326707addc6f77098064e3f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 8 Jul 2026 21:12:12 -0700 Subject: [PATCH] Revert "try removing submodule symlinks (#38310)" This reverts commit b827c0f55e65f8c3ffeefd9c0994dde054656982. --- .gitignore | 7 ----- SConstruct | 29 +++----------------- launch_chffrplus.sh | 8 ------ msgq | 1 + opendbc | 1 + openpilot/selfdrive/test/setup_device_ci.sh | 8 ------ openpilot/tools/cabana/SConscript | 2 +- openpilot/tools/jotpluggler/layout.cc | 2 +- openpilot/tools/jotpluggler/sketch_layout.cc | 4 +-- rednose | 1 + teleoprtc | 1 + tinygrad | 1 + 12 files changed, 13 insertions(+), 52 deletions(-) create mode 120000 msgq create mode 120000 opendbc create mode 120000 rednose create mode 120000 teleoprtc create mode 120000 tinygrad diff --git a/.gitignore b/.gitignore index 5c9956758..6581b90e7 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/SConstruct b/SConstruct index 548553da9..7e102add9 100644 --- a/SConstruct +++ b/SConstruct @@ -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([ diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 4f767f3b1..17a765e07 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -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 diff --git a/msgq b/msgq new file mode 120000 index 000000000..df09146f6 --- /dev/null +++ b/msgq @@ -0,0 +1 @@ +msgq_repo/msgq \ No newline at end of file diff --git a/opendbc b/opendbc new file mode 120000 index 000000000..7cd9a5bd1 --- /dev/null +++ b/opendbc @@ -0,0 +1 @@ +opendbc_repo/opendbc \ No newline at end of file diff --git a/openpilot/selfdrive/test/setup_device_ci.sh b/openpilot/selfdrive/test/setup_device_ci.sh index d458e047a..3fe353e72 100755 --- a/openpilot/selfdrive/test/setup_device_ci.sh +++ b/openpilot/selfdrive/test/setup_device_ci.sh @@ -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" diff --git a/openpilot/tools/cabana/SConscript b/openpilot/tools/cabana/SConscript index 26c20ddba..ec94fec26 100644 --- a/openpilot/tools/cabana/SConscript +++ b/openpilot/tools/cabana/SConscript @@ -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): diff --git a/openpilot/tools/jotpluggler/layout.cc b/openpilot/tools/jotpluggler/layout.cc index 6bc3a6168..dc7109808 100644 --- a/openpilot/tools/jotpluggler/layout.cc +++ b/openpilot/tools/jotpluggler/layout.cc @@ -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 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) { diff --git a/openpilot/tools/jotpluggler/sketch_layout.cc b/openpilot/tools/jotpluggler/sketch_layout.cc index ee307653f..fcc4b183d 100644 --- a/openpilot/tools/jotpluggler/sketch_layout.cc +++ b/openpilot/tools/jotpluggler/sketch_layout.cc @@ -385,7 +385,7 @@ std::string detect_dbc_for_fingerprint(std::string_view car_fingerprint) { std::vector available_dbc_names_impl() { std::set 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 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; diff --git a/rednose b/rednose new file mode 120000 index 000000000..674cfec35 --- /dev/null +++ b/rednose @@ -0,0 +1 @@ +rednose_repo/rednose \ No newline at end of file diff --git a/teleoprtc b/teleoprtc new file mode 120000 index 000000000..3d3dbc8de --- /dev/null +++ b/teleoprtc @@ -0,0 +1 @@ +teleoprtc_repo/teleoprtc \ No newline at end of file diff --git a/tinygrad b/tinygrad new file mode 120000 index 000000000..cb003823c --- /dev/null +++ b/tinygrad @@ -0,0 +1 @@ +tinygrad_repo/tinygrad \ No newline at end of file