From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: liming.gao@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Mon, 20 May 2019 19:43:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 May 2019 19:43:50 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 20 May 2019 19:43:50 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 20 May 2019 19:43:50 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 20 May 2019 19:43:49 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.33]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.10]) with mapi id 14.03.0415.000; Tue, 21 May 2019 10:43:48 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" CC: "Kinney, Michael D" Subject: Re: [Patch] BaseTools: Fix private includes for FILE_GUID override Thread-Topic: [Patch] BaseTools: Fix private includes for FILE_GUID override Thread-Index: AQHVC9j5jVE8/T3wJECoZOtTCwdkmKZ05k/A Date: Tue, 21 May 2019 02:43:47 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E44E372@SHSMSX104.ccr.corp.intel.com> References: <20190516111728.33584-1-bob.c.feng@intel.com> In-Reply-To: <20190516111728.33584-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGM0MjJkMTMtYzZmNC00MWU5LWJkNTQtNDg1MzQ3ZGIxNzc5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZUNhU1hGTGZlZ3pcL3RFcG14eGZUT1FIaEN6SjduOFBIZGN5a1hnSk5OZldKTDJkd2FRT1AxUjJFS0wwbWVDWVgifQ== dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] 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 Reviewed-by: Liming Gao > -----Original Message----- > From: Feng, Bob C > Sent: Thursday, May 16, 2019 7:17 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Feng, Bob C ; Gao, Liming > Subject: [Patch] BaseTools: Fix private includes for FILE_GUID override >=20 > From: Michael D Kinney >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1648 >=20 > When a module in a DSC file uses a FILE_GUID override in the > module scoped section, a copy of the modified INF file > is placed in the Conf/.cache directory. The check for private > includes uses the INF path to determine if the module is allowed > to use the private includes. Since the INF path in this case is > not in any package, this check always fails, and no private > include paths are possible. >=20 > The fix is to keep both the OriginalPath and the new Path in > the PathClass object, and always use the OriginalPath to see if > the module INF is in the package with private includes. >=20 > Signed-off-by: Michael D Kinney > Cc: Bob Feng > Cc: Liming Gao > --- > BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- > BaseTools/Source/Python/Common/Misc.py | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Sourc= e/Python/AutoGen/AutoGen.py > index 31721a6f9f..c174b5a0bb 100644 > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > @@ -3414,11 +3414,11 @@ class ModuleAutoGen(AutoGen): > PackageDir =3D mws.join(self.WorkspaceDir, Package.MetaFile.= Dir) > if PackageDir not in RetVal: > RetVal.append(PackageDir) > IncludesList =3D Package.Includes > if Package._PrivateIncludes: > - if not self.MetaFile.Path.startswith(PackageDir): > + if not self.MetaFile.OriginalPath.Path.startswith(Packag= eDir): > IncludesList =3D list(set(Package.Includes).differen= ce(set(Package._PrivateIncludes))) > for Inc in IncludesList: > if Inc not in RetVal: > RetVal.append(str(Inc)) > return RetVal > diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Py= thon/Common/Misc.py > index 0e0cb45ebe..d082c58bef 100644 > --- a/BaseTools/Source/Python/Common/Misc.py > +++ b/BaseTools/Source/Python/Common/Misc.py > @@ -279,10 +279,11 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace)= : > # The BaseName is the FILE_GUID which is also the output directory n= ame. > # > # > RtPath.Path =3D TempFullPath > RtPath.BaseName =3D BaseName > + RtPath.OriginalPath =3D Path > # > # If file exists, compare contents > # > if os.path.exists(TempFullPath): > with open(str(Path), 'rb') as f1, open(TempFullPath, 'rb') as f2= : > @@ -1403,10 +1404,11 @@ class PathClass(object): > self.IsBinary =3D IsBinary > self.Target =3D Target > self.TagName =3D TagName > self.ToolCode =3D ToolCode > self.ToolChainFamily =3D ToolChainFamily > + self.OriginalPath =3D self >=20 > ## Convert the object of this class to a string > # > # Convert member Path of the class to a string > # > -- > 2.20.1.windows.1