From: "Liming Gao" <liming.gao@intel.com>
To: devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@Intel.com>
Subject: [Patch] Revert "BaseTools: Improve GetDependencyList function"
Date: Fri, 20 Sep 2019 14:00:12 +0800 [thread overview]
Message-ID: <20190920060012.16248-1-liming.gao@intel.com> (raw)
This reverts commit bc9e4194cf3edaf9524c83098ba3f72008c70190.
This change causes the dependent header files are missing in Makefile.
It makes the incremental build not work. So, revert this change.
Cc: Bob Feng<bob.c.feng@Intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
BaseTools/Source/Python/AutoGen/GenMake.py | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 940136248f..2fe0e78bec 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -1696,25 +1696,22 @@ def GetDependencyList(AutoGenObject, FileCache, File, ForceList, SearchPathList)
CurrentFileDependencyList = DepDb[F]
else:
try:
- with open(F.Path, 'rb') as Fd:
- FileContent = Fd.read(1)
- Fd.seek(0)
- if not FileContent:
- continue
- if FileContent[0] == 0xff or FileContent[0] == 0xfe:
- FileContent2 = Fd.read()
- FileContent2 = FileContent2.decode('utf-16')
- IncludedFileList = gIncludePattern.findall(FileContent2)
- else:
- FileLines = Fd.readlines()
- FileContent2 = [line for line in FileLines if str(line).lstrip("#\t ")[:8] == "include "]
- simpleFileContent="".join(FileContent2)
-
- IncludedFileList = gIncludePattern.findall(simpleFileContent)
+ Fd = open(F.Path, 'rb')
+ FileContent = Fd.read()
+ Fd.close()
except BaseException as X:
EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=F.Path + "\n\t" + str(X))
- if not FileContent:
+ if len(FileContent) == 0:
+ continue
+ try:
+ if FileContent[0] == 0xff or FileContent[0] == 0xfe:
+ FileContent = FileContent.decode('utf-16')
+ else:
+ FileContent = FileContent.decode()
+ except:
+ # The file is not txt file. for example .mcb file
continue
+ IncludedFileList = gIncludePattern.findall(FileContent)
for Inc in IncludedFileList:
Inc = Inc.strip()
--
2.13.0.windows.1
next reply other threads:[~2019-09-20 6:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 6:00 Liming Gao [this message]
2019-09-20 10:30 ` [edk2-devel] [Patch] Revert "BaseTools: Improve GetDependencyList function" Bob Feng
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=20190920060012.16248-1-liming.gao@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