From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.7930.1581047037821010852 for ; Thu, 06 Feb 2020 19:43:58 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 19:43:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="404699700" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 06 Feb 2020 19:43:57 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Feb 2020 19:43:56 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 7 Feb 2020 11:43:54 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Fri, 7 Feb 2020 11:43:54 +0800 From: "Bob Feng" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Sean Brogan , "Gao, Liming" Subject: Re: [Patch 1/4] BaseTools/Build: Do not use Common.lib in Structured PCD app Thread-Topic: [Patch 1/4] BaseTools/Build: Do not use Common.lib in Structured PCD app Thread-Index: AQHV3UIx4yvEhb3mE02N8xCKUSwnVqgPFwGQ Date: Fri, 7 Feb 2020 03:43:54 +0000 Message-ID: <6eb474b72f304ce68799e0eee1978bd0@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> <20200206230715.15564-2-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-2-michael.d.kinney@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Kinney, Michael D=20 Sent: Friday, February 7, 2020 7:07 AM To: devel@edk2.groups.io Cc: Sean Brogan ; Feng, Bob C ; Gao, Liming Subject: [Patch 1/4] BaseTools/Build: Do not use Common.lib in Structured P= CD app https://bugzilla.tianocore.org/show_bug.cgi?id=3D2496 Reduce the build and env dependencies for the Structured PCD application by= removing the dependency on Common.lib that is only built when BaseTools is= built which does not happen if pre-compiled BaseToools are used. Change t= he makefile for the Structure PCD application to build all files from sourc= es which adds PcdValueCommon.c to the makefile. Also remove PcdValueCommon= .c from Common.lib. With the change to the makefile for the Structured PCD application, multipl= e C files are compiled. Only PcdValueInit.c contains the extra information= expected by the error/warning message parser. Only parse the DSC line num= ber into an error message if there is an error/warning in PcdValueInit.c. = Errors/warnings in other files should be passed through. This fixes a buil= d failure with no useful log information that was observed when there was a= compiler error in PcdValueCommon.c. Cc: Sean Brogan Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney --- BaseTools/Source/C/Common/GNUmakefile | 3 +- BaseTools/Source/C/Common/Makefile | 3 +- .../Source/Python/Workspace/DscBuildData.py | 42 ++++++++++--------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/BaseTools/Source/C/Common/GNUmakefile b/BaseTools/Source/C/Com= mon/GNUmakefile index d09111bd64..b3eef7460f 100644 --- a/BaseTools/Source/C/Common/GNUmakefile +++ b/BaseTools/Source/C/Common/GNUmakefile @@ -28,7 +28,6 @@ OBJECTS =3D \ PeCoffLoaderEx.o \ SimpleFileParsing.o \ StringFuncs.o \ - TianoCompress.o \ - PcdValueCommon.o + TianoCompress.o =20 include $(MAKEROOT)/Makefiles/lib.makefile diff --git a/BaseTools/Source/C/Common/Makefile b/BaseTools/Source/C/Common= /Makefile index ff35540dc8..ec61e45c81 100644 --- a/BaseTools/Source/C/Common/Makefile +++ b/BaseTools/Source/C/Common/Makefile @@ -28,8 +28,7 @@ OBJECTS =3D \ PeCoffLoaderEx.obj \ SimpleFileParsing.obj \ StringFuncs.obj \ - TianoCompress.obj \ - PcdValueCommon.obj + TianoCompress.obj =20 !INCLUDE ..\Makefiles\ms.lib =20 diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index be6688dc75..476c7edaf9 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -91,9 +91,6 @@ WindowsCFLAGS =3D 'CFLAGS =3D $(CFLAGS) /wd4200 /wd4034 /= wd4101 ' LinuxCFLAGS =3D 'BUILD_CFLAGS +=3D -Wno-pointer-to-int-cast -Wno-unused-va= riable ' PcdMakefileEnd =3D ''' !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common - -LIBS =3D $(LIB_PATH)\Common.lib - !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app ''' =20 @@ -2637,10 +2634,10 @@ class DscBuildData(PlatformBuildClassObject): =20 MakeApp =3D PcdMakefileHeader if sys.platform =3D=3D "win32": - MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj\n' % (self.OutputPath, PcdValueInitName) + 'INC =3D ' + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.nor= mpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Commo= n/PcdValueCommon"))) + 'INC =3D ' else: MakeApp =3D MakeApp + PcdGccMakefile - MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= , PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D %s/%s.o\n' % (self.OutputPath, PcdValueInitName) + \ + MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= ,=20 + PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D=20 + %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName,=20 + os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"],=20 + "Source/C/Common/PcdValueCommon"))) + \ 'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'IN= CLUDE +=3D' =20 IncSearchList =3D [] @@ -2739,8 +2736,8 @@ class DscBuildData(PlatformBuildClassObject): IncludeFileFullPaths.append(os.path.normpath(includefu= llpath)) break SearchPathList =3D [] - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorksp= ace, "BaseTools/Source/C/Include"))) - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorksp= ace, "BaseTools/Source/C/Common"))) + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobal= Defines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Include"))) + =20 + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobalDefi + nes["EDK_TOOLS_PATH"], "BaseTools/Source/C/Common"))) SearchPathList.extend(str(item) for item in IncSearchList) IncFileList =3D GetDependencyList(IncludeFileFullPaths, SearchPath= List) for include_file in IncFileList: @@ -2768,6 +2765,7 @@ class DscBuildData(PlatformBuildClassObject): returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Ma= keCommand) Messages =3D StdErr =20 + EdkLogger.verbose ('%s\n%s\n%s' % (MakeCommand, StdOut,=20 + StdErr)) Messages =3D Messages.split('\n') MessageGroup =3D [] if returncode !=3D 0: @@ -2777,16 +2775,21 @@ class DscBuildData(PlatformBuildClassObject): File.close() for Message in Messages: if " error" in Message or "warning" in Message: - FileInfo =3D Message.strip().split('(') - if len (FileInfo) > 1: - FileName =3D FileInfo [0] - FileLine =3D FileInfo [1].split (')')[0] - else: - FileInfo =3D Message.strip().split(':') - if len(FileInfo) < 2: - continue - FileName =3D FileInfo [0] - FileLine =3D FileInfo [1] + try: + FileInfo =3D Message.strip().split('(') + if len (FileInfo) > 1: + FileName =3D FileInfo [0] + FileLine =3D FileInfo [1].split (')')[0] + else: + FileInfo =3D Message.strip().split(':') + if len(FileInfo) < 2: + continue + FileName =3D FileInfo [0] + FileLine =3D FileInfo [1] + except: + continue + if "PcdValueInit.c" not in FileName: + continue if FileLine.isdigit(): error_line =3D FileData[int (FileLine) - 1] if r"//" in error_line: @@ -2812,13 +2815,14 @@ class DscBuildData(PlatformBuildClassObject): if MessageGroup: EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "\n".joi= n(MessageGroup) ) else: - EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute= command: %s' % MakeCommand) + EdkLogger.error('Build', COMMAND_FAILURE, 'Can not=20 + execute command: %s\n%s\n%s' % (MakeCommand, StdOut, StdErr)) =20 if DscBuildData.NeedUpdateOutput(OutputValueFile, Dest_PcdValueIni= tExe, InputValueFile): Command =3D Dest_PcdValueInitExe + ' -i %s -o %s' % (InputValu= eFile, OutputValueFile) returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Co= mmand) + EdkLogger.verbose ('%s\n%s\n%s' % (Command, StdOut,=20 + StdErr)) if returncode !=3D 0: - EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect = output from command: %s' % Command) + EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not=20 + collect output from command: %s\n%s\n' % (Command, StdOut, StdErr)) =20 File =3D open (OutputValueFile, 'r') FileBuffer =3D File.readlines() -- 2.21.0.windows.1