From nobody Tue Apr 30 04:24:14 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+40377+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+40377+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1557437262; cv=none; d=zoho.com; s=zohoarc; b=OS1Z3/2uxjHZ1tChpjXI43pSUVc8OLNv7eB52qSUFk+/7mRcbB6D7rbCSVBCnh57Lcf7/Xvxvns3GczujsbMpvZ1BLzj91f2/d9Zc/fvYIjdotLRqp1BNKI2cbinJPcIrkflytn3GsF40KRPYEPHlR7ETCtXbKwnN+dlWmDmm/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557437262; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=ya6MLmUNxvyehetuFvrGrMJ8NxMw4qmE8+OumXBO0bc=; b=b4VHRSgV6yTcPdj08N3jDXRVzhSYQ62ApT4UTPx+86FuS1gBGCt1YtbPvrLd0t3sdTn7fwYukkkdmVpOxQTK6wjS4qzQe3HMECJAFUDLuhzFXlZXcN+JZZhUTMq2t8gC/ZG87ntBN7InP0JXH2gtMIQiED/1L4k+R0rjnmwcv4k= 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+40377+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 1557437262260406.7070915026002; Thu, 9 May 2019 14:27:42 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Thu, 09 May 2019 14:27:40 -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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 14:27:39 -0700 X-ExtLoop1: 1 X-Received: from rodrigu3-desk.amr.corp.intel.com ([10.7.163.75]) by orsmga006.jf.intel.com with ESMTP; 09 May 2019 14:27:39 -0700 From: "Christian Rodriguez" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yonghong Zhu Subject: [edk2-devel] [PATCH] BaseTools: Include headers not mentioned in inf are not hashed Date: Thu, 9 May 2019 14:27:19 -0700 Message-Id: <20190509212719.6156-1-christian.rodriguez@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,christian.rodriguez@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=1557437261; bh=KaEm0WPpmBgo1lKoIWAwYu0A4qoUBLHiZ2ReLNio4QY=; h=Cc:Date:From:Reply-To:Subject:To; b=NQU1U2HwbAi/dCMfH/yZec4kXvU5lH42wVz1bwgOLqktiI2Ms3k8JeITQHtxPnDgnex ErDxa+cUPmGZKR18/fOd+0/SHm51oBZjZleYgK2+lGmjWQEFqrNjtb03PG/G6OefNDmqd EGQN1KsEzqcVfucj8K2Uy/HXf5rjxfq4XyQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1787 Get a list of local header files that are not present in the MetaFile for this module. Add those local header files into the hashing algorithm for a module. If a local header file is not present in the MetaFile, the module will still build correctly though the hashing system didn't know about it before. Signed-off-by: Christian Rodriguez Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu Reviewed-by: jaben carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 31721a6f9f..bd282d3ec1 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -4098,8 +4098,10 @@ class ModuleAutoGen(AutoGen): if self.Name in GlobalData.gModuleHash[self.Arch] and GlobalData.g= BinCacheSource and self.AttemptModuleCacheCopy(): return False m =3D hashlib.md5() + # Add Platform level hash m.update(GlobalData.gPlatformHash.encode('utf-8')) + # Add Package level hash if self.DependentPackageList: for Pkg in sorted(self.DependentPackageList, key=3Dlambda x: x= .PackageName): @@ -4118,14 +4120,36 @@ class ModuleAutoGen(AutoGen): Content =3D f.read() f.close() m.update(Content) + # Add Module's source files + localSourceFileList =3D set() if self.SourceFileList: for File in sorted(self.SourceFileList, key=3Dlambda x: str(x)= ): + localSourceFileList.add(str(File)) f =3D open(str(File), 'rb') Content =3D f.read() f.close() m.update(Content) =20 + # Get a list of Module's local header files not included in metaFi= le + localHeaderList =3D set() + if self.SourceDir: + for root, dirs, files in os.walk(self.SourceDir): + for aFile in files: + filePath =3D os.path.join(self.WorkspaceDir, os.path.j= oin(root, aFile)) + if not filePath.endswith(('.h', '.H')): + continue + if filePath not in localSourceFileList: + localHeaderList.add(filePath) + + # Add Module's local header files + localHeaderList =3D list(localHeaderList) + for File in sorted(localHeaderList): + f =3D open(str(File), 'rb') + Content =3D f.read() + f.close() + m.update(Content) + ModuleHashFile =3D path.join(self.BuildDir, self.Name + ".hash") if self.Name not in GlobalData.gModuleHash[self.Arch]: GlobalData.gModuleHash[self.Arch][self.Name] =3D m.hexdigest() --=20 2.19.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 (#40377): https://edk2.groups.io/g/devel/message/40377 Mute This Topic: https://groups.io/mt/31570019/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-