From nobody Fri Mar 29 07:45:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53882+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53882+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581030439620191.64119338999683; Thu, 6 Feb 2020 15:07:19 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8DmNYY1788612xUCJTM1TfrN; Thu, 06 Feb 2020 15:07:19 -0800 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web09.4910.1581030437982500953 for ; Thu, 06 Feb 2020 15:07:18 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 15:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379222363" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 15:07:17 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bob Feng , Liming Gao Subject: [edk2-devel] [Patch 1/4] BaseTools/Build: Do not use Common.lib in Structured PCD app Date: Thu, 6 Feb 2020 15:07:12 -0800 Message-Id: <20200206230715.15564-2-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: gvtKkCFG7pbxl92vkZ3LABz6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581030439; bh=Ki+hd4VCQIGVDD2teVWZ2c0AlxDRXm8bGvZNj7teoVY=; h=Cc:Date:From:Reply-To:Subject:To; b=HQCfF86q6o6GDed1/9DE4LjiV6gWz8X4inlqCvn8mCt4vr8wsjQqtEsd5hjAP7NdM0V 5EVbRh7XTfnXrD3SjR+HL3ozZmxrkq/U8Y4RmFsW/l9OvS2bjSd2WWTADEtHmP3zoux0G yfeMWJEKKuVcnEFCUNhXNnKi7waomwwCXJs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 the makefile for the Structure PCD application to build all files from sources 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, multiple C files are compiled. Only PcdValueInit.c contains the extra information expected by the error/warning message parser. Only parse the DSC line number 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 build 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 Reviewed-by: Bob Feng --- 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= , PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.normpath(= mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdV= alueCommon"))) + \ '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"))) + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobal= Defines["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, 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 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, 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 collect = output from command: %s\n%s\n' % (Command, StdOut, StdErr)) =20 File =3D open (OutputValueFile, 'r') FileBuffer =3D File.readlines() --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#53882): https://edk2.groups.io/g/devel/message/53882 Mute This Topic: https://groups.io/mt/71036784/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Mar 29 07:45:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53883+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53883+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581030439711704.9212473652177; Thu, 6 Feb 2020 15:07:19 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0nG9YY1788612xYeoO60Jw0k; Thu, 06 Feb 2020 15:07:19 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web10.4851.1581030438653795231 for ; Thu, 06 Feb 2020 15:07:18 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 15:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379222366" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 15:07:17 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bob Feng , Liming Gao Subject: [edk2-devel] [Patch 2/4] BaseTools/PcdValueCommon: Fix 64-bit host compiler error Date: Thu, 6 Feb 2020 15:07:13 -0800 Message-Id: <20200206230715.15564-3-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: IHmvVCZ4nqb1RyeWpv7YEhF2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581030439; bh=yJLzPtaEunvhCSJ8NGD1OFjw0wbGL728Vy/qBMaIWxs=; h=Cc:Date:From:Reply-To:Subject:To; b=sc+kOftTITAtPRZJXKYJgHQwD+bt18HL/c1/Wm9/CTGtrKkJH/oYYUktv6xbZ7drLWk /NIN65zFTR/dLQx7c+1hkP0WybMdT6hfDl7fA9fLsRSIKSNggdeMH30f2CgeaLGFGFUrw NzmmzdJq38kCniagtoCu7+myl7HCIa1rGi0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=3D2496 Cc: Sean Brogan Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney Reviewed-by: Bob Feng --- BaseTools/Source/C/Common/PcdValueCommon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c b/BaseTools/Source/= C/Common/PcdValueCommon.c index 42e3581707..98023e8786 100644 --- a/BaseTools/Source/C/Common/PcdValueCommon.c +++ b/BaseTools/Source/C/Common/PcdValueCommon.c @@ -478,7 +478,7 @@ Returns: // // Read all of the file contents. // - BytesRead =3D fread (*FileBuffer, sizeof (UINT8), *FileSize, InputFile); + BytesRead =3D (UINT32)fread (*FileBuffer, sizeof (UINT8), *FileSize, Inp= utFile); if (BytesRead !=3D *FileSize * sizeof (UINT8)) { fprintf (stderr, "Error reading the input file %s\n", InputFileName); fclose (InputFile); --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#53883): https://edk2.groups.io/g/devel/message/53883 Mute This Topic: https://groups.io/mt/71036785/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Mar 29 07:45:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53884+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53884+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581030440111856.7305935109522; Thu, 6 Feb 2020 15:07:20 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id nFcnYY1788612xEsFsBChRJF; Thu, 06 Feb 2020 15:07:19 -0800 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web09.4910.1581030437982500953 for ; Thu, 06 Feb 2020 15:07:19 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 15:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379222370" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 15:07:17 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bob Feng , Liming Gao Subject: [edk2-devel] [Patch 3/4] BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env Date: Thu, 6 Feb 2020 15:07:14 -0800 Message-Id: <20200206230715.15564-4-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: aMLlI0lb0vrIJ4HTSgHROSYZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581030439; bh=x7fn7ke5roeOl9+kDK6GcMynnzrU096CDjnUUZ/8YnU=; h=Cc:Date:From:Reply-To:Subject:To; b=vIGJvlt4epeF2qZZ/ySA44vjtLtqal6pv1ZRmbszyYAU2eisgWYks0cB5gwqNESmoxy TMgpdijGNVFMKyN5MVo+jpprby1yBPYDEJus4PendKN1CNqOMnfPd8YNHUjby/Q+6c8OY K0PizimUB8DF4XhWnjTQ2Bl3bf+/+P5HypM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 Update the WindowsVsToolChain plugin to setup the VS2017 or VS2019 development environment. This is required to build BaseTools and Structured PCD host applications. Cc: Sean Brogan Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney Reviewed-by: Bob Feng --- .../WindowsVsToolChain/WindowsVsToolChain.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/Ba= seTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py index a8202e5992..e3c4cc94a3 100644 --- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py +++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py @@ -21,6 +21,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): =20 def do_pre_build(self, thebuilder): self.Logger =3D logging.getLogger("WindowsVsToolChain") + interesting_keys =3D ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPAT= H", "UniversalCRTSdkDir", + "UCRTVersion", "WindowsLibPath", "WindowsSdkBi= nPath", "WindowsSdkDir", "WindowsSdkVerBinPath", + "WindowsSDKVersion", "VCToolsInstallDir", "Pat= h"] =20 # # VS2017 - Follow VS2017 where there is potential for many version= s of the tools. @@ -52,6 +55,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_P= REFIX", prefix) =20 + shell_env =3D shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for th= e vars that interest us. + vs_vars =3D locate_tools.QueryVcVariables( + interesting_keys, "amd64", vs_version=3D"vs2017") + for (k, v) in vs_vars.items(): + if k.upper() =3D=3D "PATH": + shell_env.insert_path(v) + else: + shell_env.set_shell_var(k, v) + # now confirm it exists if not os.path.exists(shell_environment.GetEnvironment().get_s= hell_var("VS2017_PREFIX")): self.Logger.error("Path for VS2017 toolchain is invalid") @@ -87,6 +100,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_P= REFIX", prefix) =20 + shell_env =3D shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for th= e vars that interest us. + vs_vars =3D locate_tools.QueryVcVariables( + interesting_keys, "amd64", vs_version=3D"vs2019") + for (k, v) in vs_vars.items(): + if k.upper() =3D=3D "PATH": + shell_env.insert_path(v) + else: + shell_env.set_shell_var(k, v) + # now confirm it exists if not os.path.exists(shell_environment.GetEnvironment().get_s= hell_var("VS2019_PREFIX")): self.Logger.error("Path for VS2019 toolchain is invalid") --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#53884): https://edk2.groups.io/g/devel/message/53884 Mute This Topic: https://groups.io/mt/71036786/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Mar 29 07:45:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53885+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53885+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581030440214610.2948791209113; Thu, 6 Feb 2020 15:07:20 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8saJYY1788612xsBqV4i2K3X; Thu, 06 Feb 2020 15:07:19 -0800 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.4851.1581030438653795231 for ; Thu, 06 Feb 2020 15:07:19 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 15:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379222373" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 15:07:17 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bob Feng , Liming Gao Subject: [edk2-devel] [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source formatting Date: Thu, 6 Feb 2020 15:07:15 -0800 Message-Id: <20200206230715.15564-5-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: 3hKM4UZbMbBbCuzsV3l7hPdHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581030439; bh=izKzGFZWJkDrnO3rSa8D8IYrmGvc8YcE738rkRlk9K0=; h=Cc:Date:From:Reply-To:Subject:To; b=CSdOgu1LwWsViimxCjhfNqwjmEkUdabtmWlUfzmevny/s0JiGOH/K69QChlhNzLnX6U 5eGqwWjPbav96Pr0gR29c3E27d/5HwZUdY2QVlHcGG5bJJdjh45R/+POk2gZtPhlPKS2M RBLunVCYQxq643XxMlcskju4VhVOGUvhyGM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 Cc: Sean Brogan Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney Reviewed-by: Bob Feng --- .../WindowsVsToolChain/WindowsVsToolChain.py | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/Ba= seTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py index e3c4cc94a3..c9279e1c75 100644 --- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py +++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py @@ -1,4 +1,4 @@ -## @file WindowsVsToolChain.py +# @file WindowsVsToolChain.py # Plugin to configures paths for the VS2017 and VS2019 tool chain ## # This plugin works in conjuncture with the tools_def @@ -14,6 +14,7 @@ from edk2toollib.windows.locate_tools import FindWithVsWh= ere from edk2toolext.environment import shell_environment from edk2toolext.environment import version_aggregator =20 + class WindowsVsToolChain(IUefiBuildPlugin): =20 def do_post_build(self, thebuilder): @@ -28,9 +29,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): # # VS2017 - Follow VS2017 where there is potential for many version= s of the tools. # If a specific version is required then the user must set both en= v variables: - ## VS150INSTALLPATH: base install path on system to VC install di= r. Here you will find the VC folder, etc - ## VS150TOOLVER: version number for the VC compiler tools - ## VS2017_PREFIX: path to MSVC compiler folder with trailing s= lash (can be used instead of two vars above) + # VS150INSTALLPATH: base install path on system to VC install dir= . Here you will find the VC folder, etc + # VS150TOOLVER: version number for the VC compiler tools + # VS2017_PREFIX: path to MSVC compiler folder with trailing sl= ash (can be used instead of two vars above) if thebuilder.env.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2017": =20 # check to see if full path already configured @@ -38,11 +39,13 @@ class WindowsVsToolChain(IUefiBuildPlugin): self.Logger.info("VS2017_PREFIX is already set.") =20 else: - install_path =3D self._get_vs_install_path("VS2017".lower(= ), "VS150INSTALLPATH") + install_path =3D self._get_vs_install_path( + "VS2017".lower(), "VS150INSTALLPATH") vc_ver =3D self._get_vc_version(install_path, "VS150TOOLVE= R") =20 if install_path is None or vc_ver is None: - self.Logger.error("Failed to configure environment for= VS2017") + self.Logger.error( + "Failed to configure environment for VS2017") return -1 =20 version_aggregator.GetVersionAggregator().ReportVersion( @@ -50,8 +53,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion( "VC Version", vc_ver, version_aggregator.VersionTypes.= TOOL) =20 - #make VS2017_PREFIX to align with tools_def.txt - prefix =3D os.path.join(install_path, "VC", "Tools", "MSVC= ", vc_ver) + # make VS2017_PREFIX to align with tools_def.txt + prefix =3D os.path.join(install_path, "VC", + "Tools", "MSVC", vc_ver) prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_P= REFIX", prefix) =20 @@ -73,9 +77,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): # # VS2019 - Follow VS2019 where there is potential for many version= s of the tools. # If a specific version is required then the user must set both en= v variables: - ## VS160INSTALLPATH: base install path on system to VC install di= r. Here you will find the VC folder, etc - ## VS160TOOLVER: version number for the VC compiler tools - ## VS2019_PREFIX: path to MSVC compiler folder with trailing s= lash (can be used instead of two vars above) + # VS160INSTALLPATH: base install path on system to VC install dir= . Here you will find the VC folder, etc + # VS160TOOLVER: version number for the VC compiler tools + # VS2019_PREFIX: path to MSVC compiler folder with trailing sl= ash (can be used instead of two vars above) elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2019": =20 # check to see if full path already configured @@ -83,11 +87,13 @@ class WindowsVsToolChain(IUefiBuildPlugin): self.Logger.info("VS2019_PREFIX is already set.") =20 else: - install_path =3D self._get_vs_install_path("VS2019".lower(= ), "VS160INSTALLPATH") + install_path =3D self._get_vs_install_path( + "VS2019".lower(), "VS160INSTALLPATH") vc_ver =3D self._get_vc_version(install_path, "VS160TOOLVE= R") =20 if install_path is None or vc_ver is None: - self.Logger.error("Failed to configure environment for= VS2019") + self.Logger.error( + "Failed to configure environment for VS2019") return -1 =20 version_aggregator.GetVersionAggregator().ReportVersion( @@ -95,8 +101,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion( "VC Version", vc_ver, version_aggregator.VersionTypes.= TOOL) =20 - #make VS2019_PREFIX to align with tools_def.txt - prefix =3D os.path.join(install_path, "VC", "Tools", "MSVC= ", vc_ver) + # make VS2019_PREFIX to align with tools_def.txt + prefix =3D os.path.join(install_path, "VC", + "Tools", "MSVC", vc_ver) prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_P= REFIX", prefix) =20 @@ -126,14 +133,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): if rc =3D=3D 0 and path is not None and os.path.exists(path): self.Logger.debug("Found VS instance for %s", vs_version) else: - self.Logger.error("Failed to find VS instance with VsWhere= (%d)" % rc) + self.Logger.error( + "Failed to find VS instance with VsWhere (%d)" % rc) return path =20 def _get_vc_version(self, path, varname): # check if already specified vc_ver =3D shell_environment.GetEnvironment().get_shell_var(varnam= e) if (path is None): - self.Logger.critical("Failed to find Visual Studio tools. Mig= ht need to check for VS install") + self.Logger.critical( + "Failed to find Visual Studio tools. Might need to check = for VS install") return vc_ver if(vc_ver is None): # Not specified...find latest @@ -145,5 +154,3 @@ class WindowsVsToolChain(IUefiBuildPlugin): vc_ver =3D os.listdir(p2)[-1].strip() # get last in list self.Logger.debug("Found VC Tool version is %s" % vc_ver) return vc_ver - - --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#53885): https://edk2.groups.io/g/devel/message/53885 Mute This Topic: https://groups.io/mt/71036787/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-