mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -09:00
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>
(cherry picked from commit befb6ae81d)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
205f959018
commit
4555cb1672
@@ -60,9 +60,14 @@ def download(dldir, filename):
|
|||||||
def run_cmd_on_host(builddir, cmd):
|
def run_cmd_on_host(builddir, cmd):
|
||||||
"""Call subprocess.check_output and return the text output."""
|
"""Call subprocess.check_output and return the text output."""
|
||||||
try:
|
try:
|
||||||
|
host_bin = os.path.join(builddir, "host", "bin")
|
||||||
|
br_path = host_bin + os.pathsep + os.environ["PATH"]
|
||||||
out = subprocess.check_output(cmd,
|
out = subprocess.check_output(cmd,
|
||||||
cwd=builddir,
|
cwd=builddir,
|
||||||
env={"LANG": "C"},
|
env={
|
||||||
|
"LANG": "C",
|
||||||
|
"PATH": br_path
|
||||||
|
},
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
text=True,
|
text=True,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user