]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Resolve a issue of Incremental build
authorBob Feng <bob.c.feng@intel.com>
Mon, 16 Dec 2019 10:18:46 +0000 (18:18 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 18 Dec 2019 07:24:45 +0000 (07:24 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311

In patch set 13c5e34a - 0c3e8e99, we implemented incremental build with
using compiler/pre-processor generate dependent header file function.

A issue is found for MSVC compiler, that the cl.exe /showIncludes
build option generate header file list to either stdout or stderr.
For .c file, the header file list is print out to stdout while for
.vfr, .aslc and .nasm file, the file list is print out to stderr.

The build tool use two threads to process the message from stdout and
stderr, but to generate correct *.deps file, build tool need to
combine the header file list from stderr and other messages from stdout
together with correct time sequence order.

So this patch is trying to combine the stdout and stderr together for
the process which is for calling make program.

The impact of this patch is that the output message of build with -q
will be changed. The compiler error message will not print out.
The build behavior of other log level setting will not be impacted.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/build/build.py

index 77b46341b5adb2a535a2538e15d40ef9ed6b5922..3cc4220e2ff85e88a99287a5a32c37e44113140d 100755 (executable)
@@ -24,7 +24,7 @@ import traceback
 import multiprocessing\r
 from threading import Thread,Event,BoundedSemaphore\r
 import threading\r
-from subprocess import Popen,PIPE\r
+from subprocess import Popen,PIPE, STDOUT\r
 from collections import OrderedDict, defaultdict\r
 from Common.buildoptions import BuildOption,BuildTarget\r
 from AutoGen.PlatformAutoGen import PlatformAutoGen\r
@@ -230,7 +230,7 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto = None):
     EndOfProcedure = None\r
     try:\r
         # launch the command\r
-        Proc = MakeSubProc(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True)\r
+        Proc = MakeSubProc(Command, stdout=PIPE, stderr=STDOUT, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True)\r
 \r
         # launch two threads to read the STDOUT and STDERR\r
         EndOfProcedure = Event()\r
@@ -241,11 +241,6 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto = None):
             StdOutThread.setDaemon(False)\r
             StdOutThread.start()\r
 \r
-        if Proc.stderr:\r
-            StdErrThread = Thread(target=ReadMessage, args=(Proc.stderr, EdkLogger.quiet, EndOfProcedure,Proc.ProcOut))\r
-            StdErrThread.setName("STDERR-Redirector")\r
-            StdErrThread.setDaemon(False)\r
-            StdErrThread.start()\r
 \r
         # waiting for program exit\r
         Proc.wait()\r
@@ -261,8 +256,6 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto = None):
 \r
     if Proc.stdout:\r
         StdOutThread.join()\r
-    if Proc.stderr:\r
-        StdErrThread.join()\r
 \r
     # check the return code of the program\r
     if Proc.returncode != 0:\r