From b926f2f2a4cd404df1d2c1dddbcd1178acc63b5e Mon Sep 17 00:00:00 2001 From: Michael Kinney Date: Tue, 31 Jan 2017 09:21:20 -0800 Subject: [PATCH 1/1] BaseTools/Build: Support python scripts in PREBUILD/POSTBUILD https://bugzilla.tianocore.org/show_bug.cgi?id=627 Add shell=True in Popen() calls to support direct execution of python scripts Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/build/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index cfd28a4b5b..1e14fb4dcc 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1036,7 +1036,7 @@ class Build(): os.remove(self.PlatformBuildPath) if sys.platform == "win32": args = ' && '.join((self.Prebuild, 'set > ' + PrebuildEnvFile)) - Process = Popen(args, stdout=PIPE, stderr=PIPE) + Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True) else: args = ' && '.join((self.Prebuild, 'env > ' + PrebuildEnvFile)) Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True) @@ -1079,7 +1079,7 @@ class Build(): if self.Postbuild: EdkLogger.info("\n- Postbuild Start -\n") if sys.platform == "win32": - Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE) + Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True) else: Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True) # launch two threads to read the STDOUT and STDERR -- 2.39.2