Răsfoiți Sursa

support/testing: infra: add host bin dir to PATH when running host command

Some host commands need to call other host commands: For example,
"mkimage" from host-uboot-tools needs to run "dtc". This would fail or
call system commands without adding the host bin dir to PATH.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
[Julien: use python functions/constants to build path]
Signed-off-by: Julien Olivain <ju.o@free.fr>
Fiona Klute 1 lună în urmă
părinte
comite
befb6ae81d
1 a modificat fișierele cu 6 adăugiri și 1 ștergeri
  1. 6 1
      support/testing/infra/__init__.py

+ 6 - 1
support/testing/infra/__init__.py

@@ -60,9 +60,14 @@ def download(dldir, filename):
 def run_cmd_on_host(builddir, cmd):
     """Call subprocess.check_output and return the text output."""
     try:
+        host_bin = os.path.join(builddir, "host", "bin")
+        br_path = host_bin + os.pathsep + os.environ["PATH"]
         out = subprocess.check_output(cmd,
                                       cwd=builddir,
-                                      env={"LANG": "C"},
+                                      env={
+                                          "LANG": "C",
+                                          "PATH": br_path
+                                      },
                                       stderr=subprocess.STDOUT,
                                       text=True,
                                       universal_newlines=True)