From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.7084.1576648625851451818 for ; Tue, 17 Dec 2019 21:57:06 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Dec 2019 21:57:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,328,1571727600"; d="scan'208";a="209971793" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 17 Dec 2019 21:57:04 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Dec 2019 21:57:04 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Dec 2019 21:57:03 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0439.000; Wed, 18 Dec 2019 13:57:02 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" CC: "Shi, Steven" , "Kinney, Michael D" Subject: Re: [Patch 1/1] BaseTools: Resolve a issue of Incremental build Thread-Topic: [Patch 1/1] BaseTools: Resolve a issue of Incremental build Thread-Index: AQHVtHz0C12OHfYyJEi1jBT4EFxcR6e/ZvCA Date: Wed, 18 Dec 2019 05:57:01 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E567622@SHSMSX104.ccr.corp.intel.com> References: <20191217015431.53296-1-bob.c.feng@intel.com> In-Reply-To: <20191217015431.53296-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Tuesday, December 17, 2019 9:55 AM >To: devel@edk2.groups.io >Cc: Gao, Liming ; Shi, Steven = ; >Kinney, Michael D >Subject: [Patch 1/1] BaseTools: Resolve a issue of Incremental build > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2311 > >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. > > >Cc: Liming Gao >Cc: Steven Shi >Cc: Michael D Kinney >Signed-off-by: Bob Feng >--- > BaseTools/Source/Python/build/build.py | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > >diff --git a/BaseTools/Source/Python/build/build.py >b/BaseTools/Source/Python/build/build.py >index 8a8e32e496f8..5263c54e5ae0 100755 >--- a/BaseTools/Source/Python/build/build.py >+++ b/BaseTools/Source/Python/build/build.py >@@ -22,11 +22,11 @@ import time > import platform > import traceback > import multiprocessing > from threading import Thread,Event,BoundedSemaphore > import threading >-from subprocess import Popen,PIPE >+from subprocess import Popen,PIPE, STDOUT > from collections import OrderedDict, defaultdict > from Common.buildoptions import BuildOption,BuildTarget > from AutoGen.PlatformAutoGen import PlatformAutoGen > from AutoGen.ModuleAutoGen import ModuleAutoGen > from AutoGen.WorkspaceAutoGen import WorkspaceAutoGen >@@ -227,26 +227,21 @@ def LaunchCommand(Command, >WorkingDir,ModuleAuto =3D None): > > Proc =3D None > EndOfProcedure =3D None > try: > # launch the command >- Proc =3D MakeSubProc(Command, stdout=3DPIPE, stderr=3DPIPE, >env=3Dos.environ, cwd=3DWorkingDir, bufsize=3D-1, shell=3DTrue) >+ Proc =3D MakeSubProc(Command, stdout=3DPIPE, stderr=3DSTDOUT, >env=3Dos.environ, cwd=3DWorkingDir, bufsize=3D-1, shell=3DTrue) > > # launch two threads to read the STDOUT and STDERR > EndOfProcedure =3D Event() > EndOfProcedure.clear() > if Proc.stdout: > StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc.st= dout, >EdkLogger.info, EndOfProcedure,Proc.ProcOut)) > StdOutThread.setName("STDOUT-Redirector") > StdOutThread.setDaemon(False) > StdOutThread.start() > >- if Proc.stderr: >- StdErrThread =3D Thread(target=3DReadMessage, args=3D(Proc.st= derr, >EdkLogger.quiet, EndOfProcedure,Proc.ProcOut)) >- StdErrThread.setName("STDERR-Redirector") >- StdErrThread.setDaemon(False) >- StdErrThread.start() > > # waiting for program exit > Proc.wait() > except: # in case of aborting > # terminate the threads redirecting the program output >@@ -258,12 +253,10 @@ def LaunchCommand(Command, >WorkingDir,ModuleAuto =3D None): > Command =3D " ".join(Command) > EdkLogger.error("build", COMMAND_FAILURE, "Failed to start >command", ExtraData=3D"%s [%s]" % (Command, WorkingDir)) > > if Proc.stdout: > StdOutThread.join() >- if Proc.stderr: >- StdErrThread.join() > > # check the return code of the program > if Proc.returncode !=3D 0: > if not isinstance(Command, type("")): > Command =3D " ".join(Command) >-- >2.20.1.windows.1