From 55e8443571cd977b6e0e70a0db83dd42ce8881a9 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Tue, 3 Aug 2021 15:06:03 +0800 Subject: [PATCH] board_inspector/cli: export PATH to the legacy board parser Customized environment variables are not inherited to child processes created by the subprocess module. As a result the legacy board parser may not be able to locate the prerequisite utilities if they can be found only with the customized PATH. This patch passes the PATH of cli.py to the legacy parser so that both scripts use the same PATH to search for utilities. This patch is added in v2 of the series. Tracked-On: #6287 Signed-off-by: Junjie Mao --- misc/config_tools/board_inspector/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config_tools/board_inspector/cli.py b/misc/config_tools/board_inspector/cli.py index aae880113..d178bfff7 100755 --- a/misc/config_tools/board_inspector/cli.py +++ b/misc/config_tools/board_inspector/cli.py @@ -19,7 +19,7 @@ def main(board_name, board_xml, args): try: # First invoke the legacy board parser to create the board XML ... legacy_parser = os.path.join(script_dir, "legacy", "board_parser.py") - env = { "PYTHONPATH": script_dir } + env = { "PYTHONPATH": script_dir, "PATH": os.environ["PATH"] } subprocess.run([sys.executable, legacy_parser, args.board_name, "--out", board_xml], check=True, env=env) # ... then load the created board XML and append it with additional data by invoking the extractors.