From nobody Sun May 5 03:23:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+40784+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40784+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1558005454; cv=none; d=zoho.com; s=zohoarc; b=itI3mbcsUqHQIgUsVP8gAJjEek4zeUeu9pNf0FnybLJdZ6DIF5lvoe+PYOfgzWP9yOO9tobc3qIOZfx7kNWvW3VmbxRXHj6cynJ5JwZO7FUgS4NwRYgEHQBZN39ETSLUT7PeK7NwktcM+G4lNTobllnc8QWEHSQ/csZ0Kj7KHIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558005454; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=n046mPdZwo0cLeqL9O4VBfCkxMDh9N2kb3zD5R1pf38=; b=Aw0o3wBTnN+LMEWrpXLNU6ty68BkY5BQpB02rci+y6DuDTu1TRUv1JdE/JooNkJYEJu/A3annpcfXtYmRCpYLf56vHT4TGRlL6XACwctL1wPGWARNkDtawUUXcmQdPlvOBjuFBVKl5RpvJBi7dnx8UbmH252meVTACNo4cfeaD0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40784+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1558005454564854.4519718762168; Thu, 16 May 2019 04:17:34 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Thu, 16 May 2019 04:17:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2019 04:17:31 -0700 X-ExtLoop1: 1 X-Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga006.jf.intel.com with ESMTP; 16 May 2019 04:17:29 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Michael D Kinney , Bob Feng , Liming Gao Subject: [edk2-devel] [Patch] BaseTools: Fix private includes for FILE_GUID override Date: Thu, 16 May 2019 19:17:27 +0800 Message-Id: <20190516111728.33584-1-bob.c.feng@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,bob.c.feng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1558005454; bh=txHJAGIMYlvX2QnO2e+Pu2G6Id2ghb+0//nAtLetnQk=; h=Cc:Date:From:Reply-To:Subject:To; b=oWMT+owHsyz5ZAnqQiagpNCAZNolgvwOy+ZdljbXd9kvAF/SuoRdV1z3XtSBgrZ617z SsMBPN+BQivBSdtbDJtcxSG8H7dfI+hTsMvhx7YsHcl1qHK/ACkW7hdQq1lWmg/rMPgrj u3+5Nsvb2C9pY7nk69y9xKvkgeorAFyEQcw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Michael D Kinney BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1648 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. 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. Signed-off-by: Michael D Kinney Cc: Bob Feng Cc: Liming Gao Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- BaseTools/Source/Python/Common/Misc.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= 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.Di= r) 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(PackageD= ir): IncludesList =3D list(set(Package.Includes).difference= (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/Pyth= on/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 nam= e. # # 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 # --=20 2.20.1.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 (#40784): https://edk2.groups.io/g/devel/message/40784 Mute This Topic: https://groups.io/mt/31639518/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-