From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.7508.1580696360898477202 for ; Sun, 02 Feb 2020 18:19:21 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, 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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2020 18:19:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,396,1574150400"; d="scan'208";a="223782999" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 02 Feb 2020 18:19:20 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 2 Feb 2020 18:19:19 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 3 Feb 2020 10:19:18 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Mon, 3 Feb 2020 10:19:17 +0800 From: "Liming Gao" To: "Kinney, Michael D" , "devel@edk2.groups.io" , "Bi, Dandan" CC: "Feng, Bob C" , "Gao, Liming" Subject: Re: [Patch] BaseTools/Build: Fix Structured PCD app host env issues Thread-Topic: [Patch] BaseTools/Build: Fix Structured PCD app host env issues Thread-Index: AQHV1xZDegBzwCWO006u6LBAC6xme6gEb5cwgAAHEACABEneIA== Date: Mon, 3 Feb 2020 02:19:17 +0000 Message-ID: <379f985417fd4626a569756abaa1d41e@intel.com> References: <20200130023744.5852-1-michael.d.kinney@intel.com> <79ea765b862d46f0aa03084c9a40558a@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.239.127.36] 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 Mike: Sorry. This edk2\BaseTools\get_vsvars.bat can set VS host env.=20 Thanks Liming > -----Original Message----- > From: Kinney, Michael D > Sent: Saturday, February 1, 2020 12:43 AM > To: Gao, Liming ; devel@edk2.groups.io; Kinney, Mic= hael D > Cc: Feng, Bob C > Subject: RE: [Patch] BaseTools/Build: Fix Structured PCD app host env iss= ues >=20 > Liming, >=20 > That script does not set everything up to build > host apps for all VS20xx tool chains. It works > for VS2017, VS2019, but not any of the others. > It sets env vars for those other tool chains but > Does not run the VS environment setup script that > updates PATH and sets LIBS and INC to support > build of POSIX apps. >=20 > Mike >=20 > > -----Original Message----- > > From: Gao, Liming > > Sent: Friday, January 31, 2020 12:27 AM > > To: Kinney, Michael D ; > > devel@edk2.groups.io > > Cc: Feng, Bob C > > Subject: RE: [Patch] BaseTools/Build: Fix Structured > > PCD app host env issues > > > > Mike: > > I suggest to call BaseTools\set_vsprefix_envs.bat to > > setup VS environment. Its input parameter is VS2012, > > VS2013, VS2015, VS2017, VS2019. If so, we don't need to > > add VS installation path in Build python script. > > > > Thanks > > Liming > > > -----Original Message----- > > > From: Kinney, Michael D > > > Sent: Thursday, January 30, 2020 10:38 AM > > > To: devel@edk2.groups.io > > > Cc: Feng, Bob C ; Gao, Liming > > > > > Subject: [Patch] BaseTools/Build: Fix Structured PCD > > app host env issues > > > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2496 > > > > > > Structured PCD processing requires a host POSIX build > > > environment. If the Structure PCD application can > > not > > > be built using the default environment under Windows, > > then > > > retry the build after setting up the host environment > > for > > > the current tool chain tag. > > > > > > Also reduce the build dependencies for the Structured > > PCD > > > application to increase compiler compatibility. > > > > > > Cc: Bob Feng > > > Cc: Liming Gao > > > Signed-off-by: Michael D Kinney > > > > > --- > > > .../Source/Python/Workspace/DscBuildData.py | 35 > > +++++++++++++++---- > > > 1 file changed, 28 insertions(+), 7 deletions(-) > > > > > > diff --git > > a/BaseTools/Source/Python/Workspace/DscBuildData.py > > b/BaseTools/Source/Python/Workspace/DscBuildData.py > > > index c65a0dd346..bc3f32bb1d 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-variable ' > > > 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 > > > ''' > > > > > > @@ -2637,10 +2634,10 @@ class > > DscBuildData(PlatformBuildClassObject): > > > > > > MakeApp =3D PcdMakefileHeader > > > if sys.platform =3D=3D "win32": > > > - MakeApp =3D MakeApp + 'APPFILE =3D > > %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + > > 'APPNAME =3D %s\n' % > > > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj\n' % > > (self.OutputPath, PcdValueInitName) + 'INC =3D ' > > > + MakeApp =3D MakeApp + 'APPFILE =3D > > %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + > > 'APPNAME =3D %s\n' % > > > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj %s.obj\n' % > > (self.OutputPath, PcdValueInitName, > > > > > os.path.normpath(mws.join(GlobalData.gGlobalDefines["ED > > K_TOOLS_PATH"], "Source/C/Common/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["ED > > K_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + \ > > > 'include > > $(MAKEROOT)/Makefiles/app.makefile\n' + 'INCLUDE +=3D' > > > > > > IncSearchList =3D [] > > > @@ -2723,8 +2720,8 @@ class > > DscBuildData(PlatformBuildClassObject): > > > > > IncludeFileFullPaths.append(os.path.normpath(includeful > > lpath)) > > > break > > > SearchPathList =3D [] > > > - > > SearchPathList.append(os.path.normpath(mws.join(GlobalD > > ata.gWorkspace, "BaseTools/Source/C/Include"))) > > > - > > SearchPathList.append(os.path.normpath(mws.join(GlobalD > > ata.gWorkspace, "BaseTools/Source/C/Common"))) > > > + > > SearchPathList.append(os.path.normpath(mws.join(GlobalD > > ata.gGlobalDefines["EDK_TOOLS_PATH"], > > > "BaseTools/Source/C/Include"))) > > > + > > SearchPathList.append(os.path.normpath(mws.join(GlobalD > > ata.gGlobalDefines["EDK_TOOLS_PATH"], > > > "BaseTools/Source/C/Common"))) > > > SearchPathList.extend(str(item) for item in > > IncSearchList) > > > IncFileList =3D > > GetDependencyList(IncludeFileFullPaths, SearchPathList) > > > for include_file in IncFileList: > > > @@ -2743,9 +2740,33 @@ class > > DscBuildData(PlatformBuildClassObject): > > > else: > > > Dest_PcdValueInitExe =3D > > os.path.join(self.OutputPath, PcdValueInitName) +".exe" > > > Messages =3D '' > > > + > > > + VsDevCmd =3D { > > > + "VS2019" : '"C:\\Program Files > > (x86)\\Microsoft Visual > > Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" > > ', > > > + "VS2017" : '"C:\\Program Files > > (x86)\\Microsoft Visual > > Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" > > ', > > > + "VS2015" : '"C:\\Program Files > > (x86)\\Microsoft Visual Studio > > 14.0\\Common7\\Tools\\VsDevCmd.bat"', > > > + "VS2015x86": '"C:\\Program Files > > (x86)\\Microsoft Visual Studio > > 14.0\\Common7\\Tools\\VsDevCmd.bat"', > > > + "VS2013" : '"C:\\Program Files > > (x86)\\Microsoft Visual Studio > > 12.0\\Common7\\Tools\\VsDevCmd.bat"', > > > + "VS2013x86": '"C:\\Program Files > > (x86)\\Microsoft Visual Studio > > 12.0\\Common7\\Tools\\VsDevCmd.bat"', > > > + "VS2012" : '"C:\\Program Files > > (x86)\\Microsoft Visual Studio > > 11.0\\Common7\\Tools\\VsDevCmd.bat"', > > > + "VS2012x86": '"C:\\Program Files > > (x86)\\Microsoft Visual Studio > > 11.0\\Common7\\Tools\\VsDevCmd.bat"', > > > + "VS2010" : '"C:\\Program Files > > (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat" > > x86', > > > + "VS2010x86": '"C:\\Program Files > > (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat" > > x86' > > > + } > > > + > > > if sys.platform =3D=3D "win32": > > > MakeCommand =3D 'nmake -f %s' % > > (MakeFileName) > > > returncode, StdOut, StdErr =3D > > DscBuildData.ExecuteCommand (MakeCommand) > > > + if returncode !=3D 0: > > > + # > > > + # If the nmake command failed, then > > lookup and run the VS > > > + # Development Environment script for > > the current ToolChain and > > > + # try the nmake command again. > > > + # > > > + if self._Toolchain in VsDevCmd: > > > + MakeCommand =3D > > VsDevCmd[self._Toolchain] + '&' + MakeCommand > > > + if os.path.exists > > (MakeCommand.split('"')[1]): > > > + returncode, StdOut, StdErr =3D > > DscBuildData.ExecuteCommand (MakeCommand) > > > Messages =3D StdOut > > > else: > > > MakeCommand =3D 'make -f %s' % > > (MakeFileName) > > > -- > > > 2.21.0.windows.1