From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: bob.c.feng@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Mon, 08 Apr 2019 22:09:44 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 22:09:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,328,1549958400"; d="scan'208";a="336174037" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2019 22:09:42 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Apr 2019 22:09:42 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.42]) with mapi id 14.03.0415.000; Tue, 9 Apr 2019 13:09:40 +0800 From: "BobCF" To: "devel@edk2.groups.io" , "Rodriguez, Christian" CC: "Gao, Liming" , "Zhu, Yonghong" Subject: Re: [edk2-devel] [Patch V2 4/4] BaseTools: Fix corner-cases of --hash feature Thread-Topic: [edk2-devel] [Patch V2 4/4] BaseTools: Fix corner-cases of --hash feature Thread-Index: AQHU6wAln16xv+15bEKdGZVjy2dQUqYzTtPg Date: Tue, 9 Apr 2019 05:09:39 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600DB3B9@SHSMSX101.ccr.corp.intel.com> References: <20190404160423.5268-1-christian.rodriguez@intel.com> <20190404160423.5268-5-christian.rodriguez@intel.com> In-Reply-To: <20190404160423.5268-5-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: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chri= stian Rodriguez Sent: Friday, April 5, 2019 12:04 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming = ; Zhu, Yonghong Subject: [edk2-devel] [Patch V2 4/4] BaseTools: Fix corner-cases of --hash= feature BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1680 Re-use libraries, since they have already been hashed. 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/GenMake.py | 6 +++--- BaseTools/Source/Python/build/build.py | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source= /Python/AutoGen/GenMake.py index b441817b52..537314e33b 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -983,7 +983,7 @@ cleanlib: ## For creating makefile targets for dependent libraries def ProcessDependentLibrary(self): for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList: - if not LibraryAutoGen.IsBinaryModule: + if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.C= anSkipbyHash(): self.LibraryBuildDirectoryList.append(self.PlaceMacro(Lib= raryAutoGen.BuildDir, self.Macros)) =20 ## Return a list containing source file's dependencies @@ -1486,7 +14= 86,7 @@ cleanlib: def GetLibraryBuildDirectoryList(self): DirList =3D [] for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList: - if not LibraryAutoGen.IsBinaryModule: + if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.C= anSkipbyHash(): DirList.append(os.path.join(self._AutoGenObject.BuildDir,= LibraryAutoGen.BuildDir)) return DirList =20 @@ -1622,7 +1622,7 @@ class TopLevelMakefile(BuildFile): def GetLibraryBuildDirectoryList(self): DirList =3D [] for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList: - if not LibraryAutoGen.IsBinaryModule: + if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.C= anSkipbyHash(): DirList.append(os.path.join(self._AutoGenObject.BuildDir,= LibraryAutoGen.BuildDir)) return DirList =20 diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyt= hon/build/build.py index de641fb452..8c59fc9e84 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1775,7 +1775,8 @@ class Build(): for Module in Pa.Platform.Modules: if self.ModuleFile.Dir =3D=3D Module.Dir and self= .ModuleFile.Name =3D=3D Module.Name: Ma =3D ModuleAutoGen(Wa, Module, BuildTarget,= ToolChain, Arch, self.PlatformFile) - if Ma is None: continue + if Ma is None: + continue MaList.append(Ma) if Ma.CanSkipbyHash(): self.HashSkipModules.append(Ma) @@ -2149,= 10 +2150,21 @@ class Build(): RemoveDirectory(os.path.dirname(GlobalData.gDatabasePath), Tr= ue) =20 def CreateAsBuiltInf(self): + all_lib_set =3D set() + all_mod_set =3D set() for Module in self.BuildModules: Module.CreateAsBuiltInf() + all_mod_set.add(Module) for Module in self.HashSkipModules: Module.CreateAsBuiltInf(True) + all_mod_set.add(Module) + for Module in all_mod_set: + for lib in Module.LibraryAutoGenList: + all_lib_set.add(lib) + for lib in all_lib_set: + lib.CreateAsBuiltInf(True) + all_lib_set.clear() + all_mod_set.clear() self.BuildModules =3D [] self.HashSkipModules =3D [] ## Do some clean-up works when error occurred -- 2.19.1.windows.1