From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3FBA9211A6D56 for ; Sun, 27 Jan 2019 19:45:44 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jan 2019 19:45:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,532,1539673200"; d="scan'208";a="111560003" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 27 Jan 2019 19:45:43 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 27 Jan 2019 19:45:43 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 27 Jan 2019 19:45:43 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.102]) with mapi id 14.03.0415.000; Mon, 28 Jan 2019 11:45:40 +0800 From: "Feng, Bob C" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [Patch v1 4/4] BaseTools/build/build: delete variable Thread-Index: AQHUs//mhfU7d29TXUyO/8eG6P0/iqXED9mw Date: Mon, 28 Jan 2019 03:45:39 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16007612A@SHSMSX101.ccr.corp.intel.com> References: <2c6e8317b7e20ff8410d229ffef4dbacba30343f.1548270790.git.jaben.carsey@intel.com> In-Reply-To: <2c6e8317b7e20ff8410d229ffef4dbacba30343f.1548270790.git.jaben.carsey@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 Subject: Re: [Patch v1 4/4] BaseTools/build/build: delete variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 03:45:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Carsey, Jaben=20 Sent: Friday, January 25, 2019 12:14 AM To: edk2-devel@lists.01.org Cc: Feng, Bob C ; Gao, Liming Subject: [Patch v1 4/4] BaseTools/build/build: delete variable delete the shared global variable from Common.Misc delete the uncalled user= s of the variable from build.build Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 3 - BaseTools/Source/Python/bui= ld/build.py | 60 +------------------- 2 files changed, 1 insertion(+), 62 deletions(-) diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index e8be8f866511..0b4dd7a7c162 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -54,9 +54,6 @@ secReGeneral =3D re.compile('^([\da-fA-F]+):([\da-fA-F]+)= +([\da-fA-F]+)[Hh]? +([. =20 StructPattern =3D re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$') =20 -## Dictionary used to store file time stamp for quick re-access -gFileTimeStampCache =3D {} # {file path : file time stamp} - ## Dictionary used to store dependencies of files gDependencyDatabase =3D {} # arch : {file path : [dependent files list]= } =20 diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 44ad86b780da..e79949fa28f9 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2,7 +2,7 @@ # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
-# C= opyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2019, Intel Corporation. All rights=20 +reserved.
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.
#= # This program and the accompanying materials @@ -72,43 +72,6 @@ gToolsD= efinition =3D "tools_def.txt" TemporaryTablePattern =3D re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$') TmpTableDict =3D {} =20 -## Make a Python object persistent on file system -# -# @param Data The object to be stored in file -# @param File The path of file to store the object -# -def _DataDump(Data, File): - Fd =3D None - try: - Fd =3D open(File, 'wb') - pickle.dump(Data, Fd, pickle.HIGHEST_PROTOCOL) - except: - EdkLogger.error("", FILE_OPEN_FAILURE, ExtraData=3DFile, RaiseErro= r=3DFalse) - finally: - if Fd is not None: - Fd.close() - -## Restore a Python object from a file -# -# @param File The path of file stored the object -# -# @retval object A python object -# @retval None If failure in file operation -# -def _DataRestore(File): - Data =3D None - Fd =3D None - try: - Fd =3D open(File, 'rb') - Data =3D pickle.load(Fd) - except Exception as e: - EdkLogger.verbose("Failed to load [%s]\n\t%s" % (File, str(e))) - Data =3D None - finally: - if Fd is not None: - Fd.close() - return Data - ## Check environment PATH variable to make sure the specified tool is foun= d # # If the tool is found in the PATH, then True is returned @@ -2192,31 +2155,11 @@ class Build(): def Relinquish(self): OldLogLevel =3D EdkLogger.GetLevel() EdkLogger.SetLevel(EdkLogger.ERROR) - #self.DumpBuildData() Utils.Progressor.Abort() if self.SpawnMode =3D=3D True: BuildTask.Abort() EdkLogger.SetLevel(OldLogLevel) =20 - def DumpBuildData(self): - CacheDirectory =3D os.path.dirname(GlobalData.gDatabasePath) - Utils.CreateDirectory(CacheDirectory) - Utils._DataDump(Utils.gFileTimeStampCache, os.path.join(CacheDirec= tory, "gFileTimeStampCache")) - Utils._DataDump(Utils.gDependencyDatabase, os.path.join(CacheDirec= tory, "gDependencyDatabase")) - - def RestoreBuildData(self): - FilePath =3D os.path.join(os.path.dirname(GlobalData.gDatabasePath= ), "gFileTimeStampCache") - if Utils.gFileTimeStampCache =3D=3D {} and os.path.isfile(FilePath= ): - Utils.gFileTimeStampCache =3D Utils._DataRestore(FilePath) - if Utils.gFileTimeStampCache is None: - Utils.gFileTimeStampCache =3D {} - - FilePath =3D os.path.join(os.path.dirname(GlobalData.gDatabasePath= ), "gDependencyDatabase") - if Utils.gDependencyDatabase =3D=3D {} and os.path.isfile(FilePath= ): - Utils.gDependencyDatabase =3D Utils._DataRestore(FilePath) - if Utils.gDependencyDatabase is None: - Utils.gDependencyDatabase =3D {} - def ParseDefines(DefineList=3D[]): DefineDict =3D {} if DefineList is not None: @@ -2440,7 +2383,6 @@ def Main(): if not (MyBuild.LaunchPrebuildFlag and os.path.exists(MyBuild.Plat= formBuildPath)): MyBuild.Launch() =20 - #MyBuild.DumpBuildData() # # All job done, no error found and no exception raised # -- 2.16.2.windows.1