From cdadcf814a85e558bd1c59b954d5ceac18605825 Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Sun, 16 Nov 2025 21:20:52 +0100 Subject: [PATCH] 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 [Julien: use python functions/constants to build path] Signed-off-by: Julien Olivain (cherry picked from commit befb6ae81d274342d316061a648c2f276e44db23) Signed-off-by: Thomas Perale --- support/testing/infra/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/support/testing/infra/__init__.py b/support/testing/infra/__init__.py index 52308395a3..be61d8cc4f 100644 --- a/support/testing/infra/__init__.py +++ b/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)