Просмотр исходного кода

fix(td): include Anlogic Qt libs in TD subprocess LD_LIBRARY_PATH

Match td2026 wrapper so bitgen/syn can load libQt5Widgets without exporting
Qt into the agent shell.

Co-authored-by: Cursor <cursoragent@cursor.com>
root 3 месяцев назад
Родитель
Сommit
3a750d37d3
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      tools/prod2u_p4_harness.py

+ 9 - 0
tools/prod2u_p4_harness.py

@@ -2380,8 +2380,10 @@ def td_process_env(
     td_home = Path(os.environ.get("ANLOGIC_TD_HOME", "/data/anlogic/TD_Release_2026.1_SP2_NL"))
     lib_candidates = [
         td_home / "lib",
+        td_home / "lib" / "Qt" / "lib",
         td_home / "bin",
         Path("/data/anlogic/BW_Release_2026.1_SP2/lib"),
+        Path("/data/anlogic/BW_Release_2026.1_SP2/lib/Qt/lib"),
     ]
     ld_parts = [str(p) for p in lib_candidates if p.is_dir()]
     existing_ld = env.get("LD_LIBRARY_PATH", "")
@@ -2389,6 +2391,13 @@ def td_process_env(
         ld_parts.append(existing_ld)
     if ld_parts:
         env["LD_LIBRARY_PATH"] = os.pathsep.join(dict.fromkeys(ld_parts))
+    # Confine Qt plugin discovery to the TD tree (matches /usr/local/bin/td2026).
+    qt_plugins = td_home / "lib" / "Qt" / "plugins"
+    if qt_plugins.is_dir():
+        env["QT_PLUGIN_PATH"] = str(qt_plugins)
+    env.setdefault("QT_QPA_PLATFORM", "offscreen")
+    env["ANLOGIC_TD_HOME"] = str(td_home)
+    env["ANLOGIC_TD2026_HOME"] = str(td_home)
     if extra:
         env.update({str(key): str(value) for key, value in extra.items()})
     return env