From: "Feng, Bob C" <bob.c.feng@intel.com>
To: "Carsey, Jaben" <jaben.carsey@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [Patch v1 4/4] BaseTools/build/build: delete variable
Date: Mon, 28 Jan 2019 03:45:39 +0000 [thread overview]
Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16007612A@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <2c6e8317b7e20ff8410d229ffef4dbacba30343f.1548270790.git.jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: Carsey, Jaben
Sent: Friday, January 25, 2019 12:14 AM
To: edk2-devel@lists.01.org
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [Patch v1 4/4] BaseTools/build/build: delete variable
delete the shared global variable from Common.Misc delete the uncalled users of the variable from build.build
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
---
BaseTools/Source/Python/Common/Misc.py | 3 - BaseTools/Source/Python/build/build.py | 60 +-------------------
2 files changed, 1 insertion(+), 62 deletions(-)
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/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 = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.
StructPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$')
-## Dictionary used to store file time stamp for quick re-access
-gFileTimeStampCache = {} # {file path : file time stamp}
-
## Dictionary used to store dependencies of files
gDependencyDatabase = {} # arch : {file path : [dependent files list]}
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/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.<BR> -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2019, Intel Corporation. All rights
+reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # This program and the accompanying materials @@ -72,43 +72,6 @@ gToolsDefinition = "tools_def.txt"
TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
TmpTableDict = {}
-## 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 = None
- try:
- Fd = open(File, 'wb')
- pickle.dump(Data, Fd, pickle.HIGHEST_PROTOCOL)
- except:
- EdkLogger.error("", FILE_OPEN_FAILURE, ExtraData=File, RaiseError=False)
- 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 = None
- Fd = None
- try:
- Fd = open(File, 'rb')
- Data = pickle.load(Fd)
- except Exception as e:
- EdkLogger.verbose("Failed to load [%s]\n\t%s" % (File, str(e)))
- Data = None
- finally:
- if Fd is not None:
- Fd.close()
- return Data
-
## Check environment PATH variable to make sure the specified tool is found #
# If the tool is found in the PATH, then True is returned
@@ -2192,31 +2155,11 @@ class Build():
def Relinquish(self):
OldLogLevel = EdkLogger.GetLevel()
EdkLogger.SetLevel(EdkLogger.ERROR)
- #self.DumpBuildData()
Utils.Progressor.Abort()
if self.SpawnMode == True:
BuildTask.Abort()
EdkLogger.SetLevel(OldLogLevel)
- def DumpBuildData(self):
- CacheDirectory = os.path.dirname(GlobalData.gDatabasePath)
- Utils.CreateDirectory(CacheDirectory)
- Utils._DataDump(Utils.gFileTimeStampCache, os.path.join(CacheDirectory, "gFileTimeStampCache"))
- Utils._DataDump(Utils.gDependencyDatabase, os.path.join(CacheDirectory, "gDependencyDatabase"))
-
- def RestoreBuildData(self):
- FilePath = os.path.join(os.path.dirname(GlobalData.gDatabasePath), "gFileTimeStampCache")
- if Utils.gFileTimeStampCache == {} and os.path.isfile(FilePath):
- Utils.gFileTimeStampCache = Utils._DataRestore(FilePath)
- if Utils.gFileTimeStampCache is None:
- Utils.gFileTimeStampCache = {}
-
- FilePath = os.path.join(os.path.dirname(GlobalData.gDatabasePath), "gDependencyDatabase")
- if Utils.gDependencyDatabase == {} and os.path.isfile(FilePath):
- Utils.gDependencyDatabase = Utils._DataRestore(FilePath)
- if Utils.gDependencyDatabase is None:
- Utils.gDependencyDatabase = {}
-
def ParseDefines(DefineList=[]):
DefineDict = {}
if DefineList is not None:
@@ -2440,7 +2383,6 @@ def Main():
if not (MyBuild.LaunchPrebuildFlag and os.path.exists(MyBuild.PlatformBuildPath)):
MyBuild.Launch()
- #MyBuild.DumpBuildData()
#
# All job done, no error found and no exception raised
#
--
2.16.2.windows.1
prev parent reply other threads:[~2019-01-28 3:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-24 16:14 [Patch v1 0/4] Cleanup the Common.misc file Jaben Carsey
2019-01-24 16:14 ` [Patch v1 1/4] BaseTools/Common/Misc: move private functions Jaben Carsey
2019-01-28 3:45 ` Feng, Bob C
2019-01-24 16:14 ` [Patch v1 2/4] BaseTools/Common/Misc: remove uncalled code Jaben Carsey
2019-01-28 3:45 ` Feng, Bob C
2019-01-24 16:14 ` [Patch v1 3/4] BaseTools/Common/Misc: Cleanup the imports Jaben Carsey
2019-01-28 3:45 ` Feng, Bob C
2019-01-24 16:14 ` [Patch v1 4/4] BaseTools/build/build: delete variable Jaben Carsey
2019-01-28 3:45 ` Feng, Bob C [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=08650203BA1BD64D8AD9B6D5D74A85D16007612A@SHSMSX101.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox