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.43, mailfrom: bob.c.feng@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Mon, 08 Apr 2019 22:09:29 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 22:09:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,328,1549958400"; d="scan'208";a="335063424" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 08 Apr 2019 22:09:28 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Apr 2019 22:09:28 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Apr 2019 22:09:28 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.25]) with mapi id 14.03.0415.000; Tue, 9 Apr 2019 13:09:26 +0800 From: "BobCF" To: "Rodriguez, Christian" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Zhu, Yonghong" Subject: Re: [Patch V2 1/4] BaseTools: Fix corner-cases of --hash feature Thread-Topic: [Patch V2 1/4] BaseTools: Fix corner-cases of --hash feature Thread-Index: AQHU6wAlS02o9dAvdU205ghqgAjL2qYzTr6g Date: Tue, 9 Apr 2019 05:09:26 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600DB39A@SHSMSX101.ccr.corp.intel.com> References: <20190404160423.5268-1-christian.rodriguez@intel.com> <20190404160423.5268-2-christian.rodriguez@intel.com> In-Reply-To: <20190404160423.5268-2-christian.rodriguez@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Rodriguez, Christian=20 Sent: Friday, April 5, 2019 12:04 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming ;= Zhu, Yonghong Subject: [Patch V2 1/4] BaseTools: Fix corner-cases of --hash feature BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1680 Consider modules with .inc source files as Binary Modules and do not Skip b= y hash. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Christian Rodriguez Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/AutoGen.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 8c7c20a386..792bc99f54 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3923,8 +3923,13 @@ class ModuleAutoGen(AutoGen): shutil.copy2(File, FileDir) =20 def AttemptModuleCacheCopy(self): + # If library or Module is binary do not skip by hash if self.IsBinaryModule: return False + # .inc is contains binary information so do not skip by hash as we= ll + for f_ext in self.SourceFileList: + if '.inc' in str(f_ext): + return False FileDir =3D path.join(GlobalData.gBinCacheSource, self.Arch, self.= SourceDir, self.MetaFile.BaseName) HashFile =3D path.join(FileDir, self.Name + '.hash') if os.path.exists(HashFile): @@ -4126,7 +4131,16 @@ class ModuleAutoGen(AutoGen): =20 ## Decide whether we can skip the ModuleAutoGen process def CanSkipbyHash(self): + # If library or Module is binary do not skip by hash + if self.IsBinaryModule: + return False + # .inc is contains binary information so do not skip by hash as we= ll + for f_ext in self.SourceFileList: + if '.inc' in str(f_ext): + return False if GlobalData.gUseHashCache: + # If there is a valid hash or function generated a valid hash;= function will return False + # and the statement below will return True return not self.GenModuleHash() return False =20 -- 2.19.1.windows.1