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.1383.1580459222711576754 for ; Fri, 31 Jan 2020 00:27:02 -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 orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2020 00:27:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,385,1574150400"; d="scan'208";a="309944812" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 31 Jan 2020 00:27:02 -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; Fri, 31 Jan 2020 00:27:01 -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; Fri, 31 Jan 2020 16:27:00 +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; Fri, 31 Jan 2020 16:27:00 +0800 From: "Liming Gao" To: "Kinney, Michael D" , "devel@edk2.groups.io" 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: AQHV1xZDegBzwCWO006u6LBAC6xme6gEb5cw Date: Fri, 31 Jan 2020 08:27:00 +0000 Message-ID: <79ea765b862d46f0aa03084c9a40558a@intel.com> References: <20200130023744.5852-1-michael.d.kinney@intel.com> In-Reply-To: <20200130023744.5852-1-michael.d.kinney@intel.com> 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: 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 >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2496 >=20 > 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. >=20 > Also reduce the build dependencies for the Structured PCD > application to increase compiler compatibility. >=20 > 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(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/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 > ''' >=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.Outp= utPath, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj\n' % (self.OutputPath, PcdVal= ueInitName) + 'INC =3D ' > + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Outp= utPath, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj %s.obj\n' % (self.OutputPath,= PcdValueInitName, > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "S= ource/C/Common/PcdValueCommon"))) + 'INC =3D ' > else: > MakeApp =3D MakeApp + PcdGccMakefile > - MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPa= th, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) > + 'OBJECTS =3D %s/%s.o\n' % (self.OutputPath, PcdValueInitName) + \ > + MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPa= th, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s/%s.o %s.o\n' % (self.OutputPath, Pcd= ValueInitName, > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "S= ource/C/Common/PcdValueCommon"))) + \ > 'include $(MAKEROOT)/Makefiles/app.makefile\n' + '= INCLUDE +=3D' >=20 > IncSearchList =3D [] > @@ -2723,8 +2720,8 @@ class DscBuildData(PlatformBuildClassObject): > IncludeFileFullPaths.append(os.path.normpath(include= fullpath)) > break > SearchPathList =3D [] > - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWork= space, "BaseTools/Source/C/Include"))) > - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWork= space, "BaseTools/Source/C/Common"))) > + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlob= alDefines["EDK_TOOLS_PATH"], > "BaseTools/Source/C/Include"))) > + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlob= alDefines["EDK_TOOLS_PATH"], > "BaseTools/Source/C/Common"))) > SearchPathList.extend(str(item) for item in IncSearchList) > IncFileList =3D GetDependencyList(IncludeFileFullPaths, SearchPa= thList) > for include_file in IncFileList: > @@ -2743,9 +2740,33 @@ class DscBuildData(PlatformBuildClassObject): > else: > Dest_PcdValueInitExe =3D os.path.join(self.OutputPath, PcdVa= lueInitName) +".exe" > Messages =3D '' > + > + VsDevCmd =3D { > + "VS2019" : '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2017" : '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2015" : '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 14.0\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2015x86": '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 14.0\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2013" : '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 12.0\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2013x86": '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 12.0\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2012" : '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 11.0\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2012x86": '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 11.0\\Common7\\Tools\\VsDevCmd.bat"', > + "VS2010" : '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 10.0\\VC\\vcvarsall.bat" x86', > + "VS2010x86": '"C:\\Program Files (x86)\\Microsoft Visual Stu= dio 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 V= S > + # Development Environment script for the current ToolCha= in and > + # try the nmake command again. > + # > + if self._Toolchain in VsDevCmd: > + MakeCommand =3D VsDevCmd[self._Toolchain] + '&' + Ma= keCommand > + if os.path.exists (MakeCommand.split('"')[1]): > + returncode, StdOut, StdErr =3D DscBuildData.Exec= uteCommand (MakeCommand) > Messages =3D StdOut > else: > MakeCommand =3D 'make -f %s' % (MakeFileName) > -- > 2.21.0.windows.1