mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-07-25 11:22:04 +08:00
remove submodule symlinks (#38312)
This commit is contained in:
@@ -15,6 +15,13 @@ 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
|
||||
|
||||
+23
-5
@@ -27,6 +27,21 @@ AddOption('--minimal',
|
||||
default=(not TICI and not release),
|
||||
help='the minimum build to run openpilot. no tests, tools, etc.')
|
||||
|
||||
submodule_python_paths = [
|
||||
Dir("#").abspath,
|
||||
Dir("#msgq_repo").abspath,
|
||||
Dir("#opendbc_repo").abspath,
|
||||
Dir("#rednose_repo").abspath,
|
||||
Dir("#teleoprtc_repo").abspath,
|
||||
Dir("#tinygrad_repo").abspath,
|
||||
]
|
||||
for p in reversed(submodule_python_paths):
|
||||
if p not in sys.path:
|
||||
sys.path.insert(0, p)
|
||||
|
||||
if external_pythonpath := os.environ.get("PYTHONPATH"):
|
||||
submodule_python_paths += [p for p in external_pythonpath.split(os.pathsep) if p and p not in submodule_python_paths]
|
||||
|
||||
# Detect platform
|
||||
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||||
if platform.system() == "Darwin":
|
||||
@@ -106,7 +121,7 @@ def _libflags(target, source, env, for_signature):
|
||||
env = Environment(
|
||||
ENV={
|
||||
"PATH": os.environ['PATH'],
|
||||
"PYTHONPATH": Dir("#").abspath,
|
||||
"PYTHONPATH": os.pathsep.join(submodule_python_paths),
|
||||
"ACADOS_SOURCE_DIR": acados.DIR,
|
||||
"ACADOS_PYTHON_INTERFACE_PATH": acados.TEMPLATE_DIR,
|
||||
"TERA_PATH": acados.TERA_PATH
|
||||
@@ -128,7 +143,10 @@ env = Environment(
|
||||
CXXFLAGS=["-std=c++1z"],
|
||||
CPPPATH=[
|
||||
"#openpilot",
|
||||
"#msgq",
|
||||
"#msgq_repo", # #include "msgq/..."
|
||||
"#opendbc_repo", # #include "opendbc/..."
|
||||
"#rednose_repo", # #include "rednose/..."
|
||||
"#rednose_repo/rednose", # #include "logger/..." (rednose package root)
|
||||
"#openpilot/cereal/gen/cpp",
|
||||
acados_include_dirs,
|
||||
[x.INCLUDE_DIR for x in pkgs],
|
||||
@@ -138,13 +156,13 @@ env = Environment(
|
||||
"#openpilot/common",
|
||||
"#msgq_repo",
|
||||
"#openpilot/selfdrive/pandad",
|
||||
"#rednose/helpers",
|
||||
"#rednose_repo/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_ROOT="#rednose_repo",
|
||||
tools=["default", "cython", "compilation_db", "rednose_filter"],
|
||||
toolpath=["#site_scons/site_tools", "#rednose_repo/site_scons/site_tools"],
|
||||
)
|
||||
@@ -249,7 +267,7 @@ Export('messaging')
|
||||
SConscript(['panda/SConscript'])
|
||||
|
||||
# Build rednose library
|
||||
SConscript(['rednose/SConscript'])
|
||||
SConscript(['rednose_repo/rednose/SConscript'])
|
||||
|
||||
# Build system services
|
||||
SConscript([
|
||||
|
||||
@@ -70,6 +70,14 @@ 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
|
||||
|
||||
@@ -124,4 +124,12 @@ 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"
|
||||
|
||||
@@ -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/dbc").abspath)
|
||||
opendbc_path = '-DOPENDBC_FILE_PATH=\'"%s"\'' % (cabana_env.Dir("../../../opendbc_repo/opendbc/dbc").abspath)
|
||||
cabana_env['CXXFLAGS'] += [opendbc_path]
|
||||
|
||||
def write_assets_qrc(target, source, env):
|
||||
|
||||
@@ -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" / "dbc" / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Opendbc},
|
||||
{.path = repo_root() / "opendbc_repo" / "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) {
|
||||
|
||||
@@ -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" / "dbc",
|
||||
repo_root() / "opendbc_repo" / "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" / "dbc" / (dbc_name + ".dbc"),
|
||||
repo_root() / "opendbc_repo" / "opendbc" / "dbc" / (dbc_name + ".dbc"),
|
||||
repo_root() / "openpilot" / "tools" / "jotpluggler" / "generated_dbcs" / (dbc_name + ".dbc"),
|
||||
}) {
|
||||
if (fs::exists(candidate)) return candidate;
|
||||
|
||||
Reference in New Issue
Block a user