From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.7954.1580488970561137664 for ; Fri, 31 Jan 2020 08:42:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: michael.d.kinney@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2020 08:42:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,386,1574150400"; d="scan'208";a="377391400" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga004.jf.intel.com with ESMTP; 31 Jan 2020 08:42:49 -0800 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 31 Jan 2020 08:42:49 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.57]) by ORSMSX161.amr.corp.intel.com ([169.254.4.2]) with mapi id 14.03.0439.000; Fri, 31 Jan 2020 08:42:49 -0800 From: "Michael D Kinney" To: "Gao, Liming" , "devel@edk2.groups.io" , "Kinney, Michael D" CC: "Feng, Bob C" 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: AQHV2BA2rHYonfMbr0+Ia97EhwoC/KgE982w Date: Fri, 31 Jan 2020 16:42:48 +0000 Message-ID: References: <20200130023744.5852-1-michael.d.kinney@intel.com> <79ea765b862d46f0aa03084c9a40558a@intel.com> In-Reply-To: <79ea765b862d46f0aa03084c9a40558a@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Liming, 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=20 updates PATH and sets LIBS and INC to support=20 build of POSIX apps. Mike > -----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 >=20 > 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. >=20 > 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