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; Sun, 01 Sep 2019 18:48:10 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Sep 2019 18:48:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,457,1559545200"; d="scan'208";a="206683037" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2019 18:48:09 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 1 Sep 2019 18:48:09 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 1 Sep 2019 18:48:09 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.86]) with mapi id 14.03.0439.000; Mon, 2 Sep 2019 09:48:07 +0800 From: "Liming Gao" To: "Shi, Steven" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [PATCH] BaseTools: Support more file types in build cache Thread-Topic: [PATCH] BaseTools: Support more file types in build cache Thread-Index: AQHVXJas4bbbmg3nJkW2EpbApjRBhKcXp7uQ Date: Mon, 2 Sep 2019 01:48:07 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F00E1@SHSMSX104.ccr.corp.intel.com> References: <20190827051646.4100-1-steven.shi@intel.com> In-Reply-To: <20190827051646.4100-1-steven.shi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTRiZmUwMjUtYjljNy00MWRjLWI2M2YtZTMxZDM5ZjZiODQ3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMHJpTWRnMjVrd2QxK05zTitnS2ZcL1B3aWtVeWZ1T0lMajNrVEtoQmFMbFpvVVNiM3gwVitqNm95ZGR6clg2TjQifQ== dlp-product: dlpe-windows dlp-version: 11.2.0.6 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: Shi, Steven > Sent: Tuesday, August 27, 2019 1:17 PM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Feng, Bob C ; Shi, Steven > Subject: [PATCH] BaseTools: Support more file types in build cache >=20 > From: "Shi, Steven" >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1958 >=20 > Current build cache does not store and restore all > types file of Hii/vfr, version and dpx. This patch > adds more file types to support them in build cache. >=20 > Cc: Liming Gao > Cc: Bob Feng > Signed-off-by: Steven Shi > --- > BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 34 ++++++++++++++----= ---------------- > 1 file changed, 14 insertions(+), 20 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools= /Source/Python/AutoGen/ModuleAutoGen.py > index 2cd0d3859e..4f17dee9a4 100755 > --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py > @@ -1267,29 +1267,30 @@ class ModuleAutoGen(AutoGen): > @cached_property > def OutputFile(self): > retVal =3D set() > + > OutputDir =3D self.OutputDir.replace('\\', '/').strip('/') > DebugDir =3D self.DebugDir.replace('\\', '/').strip('/') > - FfsOutputDir =3D self.FfsOutputDir.replace('\\', '/').rstrip('/'= ) > for Item in self.CodaTargetList: > File =3D Item.Target.Path.replace('\\', '/').strip('/').repl= ace(DebugDir, '').replace(OutputDir, '').strip('/') > - retVal.add(File) > - if self.DepexGenerated: > - retVal.add(self.Name + '.depex') > + NewFile =3D path.join(self.OutputDir, File) > + retVal.add(NewFile) >=20 > Bin =3D self._GenOffsetBin() > if Bin: > - retVal.add(Bin) > + NewFile =3D path.join(self.OutputDir, Bin) > + retVal.add(NewFile) >=20 > - for Root, Dirs, Files in os.walk(OutputDir): > + for Root, Dirs, Files in os.walk(self.OutputDir): > for File in Files: > - if File.lower().endswith('.pdb'): > - retVal.add(File) > + # lib file is already added through above CodaTargetList= , skip it here > + if not (File.lower().endswith('.obj') or File.lower().en= dswith('.lib')): > + NewFile =3D path.join(self.OutputDir, File) > + retVal.add(NewFile) >=20 > - for Root, Dirs, Files in os.walk(FfsOutputDir): > + for Root, Dirs, Files in os.walk(self.FfsOutputDir): > for File in Files: > - if File.lower().endswith('.ffs') or File.lower().endswit= h('.offset') or File.lower().endswith('.raw') \ > - or File.lower().endswith('.raw.txt'): > - retVal.add(File) > + NewFile =3D path.join(self.FfsOutputDir, File) > + retVal.add(NewFile) >=20 > return retVal >=20 > @@ -1659,15 +1660,8 @@ class ModuleAutoGen(AutoGen): > Ma =3D self.BuildDatabase[self.MetaFile, self.Arch, self.Bui= ldTarget, self.ToolChain] > self.OutputFile =3D Ma.Binaries > for File in self.OutputFile: > - File =3D str(File) > - if not os.path.isabs(File): > - NewFile =3D os.path.join(self.OutputDir, File) > - if not os.path.exists(NewFile): > - NewFile =3D os.path.join(self.FfsOutputDir, File) > - File =3D NewFile > if os.path.exists(File): > - if File.lower().endswith('.ffs') or File.lower().endswit= h('.offset') or File.lower().endswith('.raw') \ > - or File.lower().endswith('.raw.txt'): > + if File.startswith(os.path.abspath(self.FfsOutputDir)+os= .sep): > self.CacheCopyFile(FfsDir, self.FfsOutputDir, File) > else: > self.CacheCopyFile(FileDir, self.OutputDir, File) > -- > 2.17.1