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; Fri, 20 Sep 2019 03:30:47 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2019 03:30:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,528,1559545200"; d="scan'208";a="188362149" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga007.fm.intel.com with ESMTP; 20 Sep 2019 03:30:46 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Sep 2019 03:30:46 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Sep 2019 03:30:44 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.195]) with mapi id 14.03.0439.000; Fri, 20 Sep 2019 18:30:42 +0800 From: "Bob Feng" To: "devel@edk2.groups.io" , "Gao, Liming" Subject: Re: [edk2-devel] [Patch] Revert "BaseTools: Improve GetDependencyList function" Thread-Topic: [edk2-devel] [Patch] Revert "BaseTools: Improve GetDependencyList function" Thread-Index: AQHVb3i6WbWnIvQOQkChdPaZqUcUaac0XcRw Date: Fri, 20 Sep 2019 10:30:41 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D161537D8D@SHSMSX104.ccr.corp.intel.com> References: <20190920060012.16248-1-liming.gao@intel.com> In-Reply-To: <20190920060012.16248-1-liming.gao@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 I agree.=20 Reviewed-by: Bob Feng -----Original Message----- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Limi= ng Gao Sent: Friday, September 20, 2019 2:00 PM To: devel@edk2.groups.io Cc: Feng, Bob C Subject: [edk2-devel] [Patch] Revert "BaseTools: Improve GetDependencyList= function" 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 Signed-off-by: Liming Gao --- 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, Fi= le, ForceList, SearchPathList) CurrentFileDependencyList =3D DepDb[F] else: try: - with open(F.Path, 'rb') as Fd: - FileContent =3D Fd.read(1) - Fd.seek(0) - if not FileContent: - continue - if FileContent[0] =3D=3D 0xff or FileContent[0] =3D= =3D 0xfe: - FileContent2 =3D Fd.read() - FileContent2 =3D FileContent2.decode('utf-16') - IncludedFileList =3D gIncludePattern.findall(File= Content2) - else: - FileLines =3D Fd.readlines() - FileContent2 =3D [line for line in FileLines if s= tr(line).lstrip("#\t ")[:8] =3D=3D "include "] - simpleFileContent=3D"".join(FileContent2) - - IncludedFileList =3D gIncludePattern.findall(simp= leFileContent) + Fd =3D open(F.Path, 'rb') + FileContent =3D Fd.read() + Fd.close() except BaseException as X: EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DF= .Path + "\n\t" + str(X)) - if not FileContent: + if len(FileContent) =3D=3D 0: + continue + try: + if FileContent[0] =3D=3D 0xff or FileContent[0] =3D=3D 0x= fe: + FileContent =3D FileContent.decode('utf-16') + else: + FileContent =3D FileContent.decode() + except: + # The file is not txt file. for example .mcb file continue + IncludedFileList =3D gIncludePattern.findall(FileContent) =20 for Inc in IncludedFileList: Inc =3D Inc.strip() --=20 2.13.0.windows.1