From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.87.1579402262609154586 for ; Sat, 18 Jan 2020 18:51:02 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2020 18:51:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,336,1574150400"; d="scan'208";a="244074861" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 18 Jan 2020 18:51:01 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 18 Jan 2020 18:51:01 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 19 Jan 2020 10:50:59 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Sun, 19 Jan 2020 10:50:59 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" Subject: Re: [Patch 1/1] BaseTools: Fixed a incremental build bug Thread-Topic: [Patch 1/1] BaseTools: Fixed a incremental build bug Thread-Index: AQHVzOYvgz6tiRIlUkOCJB2/xwuPWqfxTHmw Date: Sun, 19 Jan 2020 02:50:59 +0000 Message-ID: <97eddb5d06f94f74a3474772d9202aa3@intel.com> References: <20200117032808.3464-1-bob.c.feng@intel.com> In-Reply-To: <20200117032808.3464-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Bob: This patch fixes the incremental build issue for the header file removeme= nt.=20 Please update the commit message with the detail solution. The code chang= e is good. Reviewed-by: Liming Gao Thanks Liming -----Original Message----- From: Feng, Bob C =20 Sent: 2020=1B$BG/=1B(B1=1B$B7n=1B(B17=1B$BF|=1B(B 11:28 To: devel@edk2.groups.io Cc: Gao, Liming Subject: [Patch 1/1] BaseTools: Fixed a incremental build bug REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2451 If removing a header file from source code and file system, the incremental= build will fail. This patch is to fix this issue. Cc: Liming Gao Signed-off-by: Bob Feng --- BaseTools/Source/Python/AutoGen/GenMake.py | 9 +++++++-- BaseTools/Source/Python/AutoGen/IncludesAutoGen.py | 5 ++++- BaseTools/Source/Python/build/build.py | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index fe94f9a4c232..ba199c1aa73d 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1,9 +1,9 @@ ## @file # Create makefile for MS nmake and GNU make # -# Copyright (c) 2007 - 201= 8, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2020, Intel Corporation. All rights=20 +reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # =20 ## Import Modules # @@ -189,10 +189,13 @@ class BuildFile(object): with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps.= txt"),"w+") as fd: fd.write("") if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir= , "dependency")): with open(os.path.join(self._AutoGenObject.MakeFileDir, "depen= dency"),"w+") as fd: fd.write("") + if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir= , "deps_target")): + with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps_= target"),"w+") as fd: + fd.write("") return SaveFileOnChange(os.path.join(self._AutoGenObject.MakeFileD= ir, FileName), FileContent, False) =20 ## Return a list of directory creation command string # # @param DirList The list of directory to be created @@ -694,11 +697,13 @@ cleanlib: "dependent_library_build_directory" : self.LibraryBuildDirecto= ryList, "library_build_command" : LibraryMakeCommandList, "file_macro" : FileMacroList, "file_build_target" : self.BuildTargetList, "backward_compatible_target": BcTargetList, - "INCLUDETAG" : self._INCLUDE_CMD_[self._File= Type] + " " + os.path.join("$(MODULE_BUILD_DIR)","dependency") + "INCLUDETAG" : "\n".join([self._INCLUDE_CMD_= [self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","dependency"), + self._INCLUD= E_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","deps_tar= get") + ]) } =20 return MakefileTemplateDict =20 def ParserGenerateFfsCmd(self): diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTools= /Source/Python/AutoGen/IncludesAutoGen.py index bb6e883d84ca..1ca1798907ef 100644 --- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py @@ -1,9 +1,9 @@ ## @file # Build cache intermediate result and state # -# Copyright (c) 2019, Inte= l Corporation. All rights reserved.
+# Copyright (c) 2019 - 2020, Intel Corporation. All rights=20 +reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # from Common.caching imp= ort cached_property import Common.EdkLogger as EdkLogger import Common.Lo= ngFilePathOs as os @@ -63,10 +63,13 @@ class IncludesAutoGen(): deps_include_str =3D _INCLUDE_DEPS_TEMPLATE.Replace(deps_file) except Exception as e: print(e) SaveFileOnChange(os.path.join(self.makefile_folder,"dependency"),d= eps_include_str,False) =20 + def CreateDepsTarget(self): + =20 + SaveFileOnChange(os.path.join(self.makefile_folder,"deps_target"),"\n" + .join([item +":" for item in self.DepsCollection]),False) + @cached_property def deps_files(self): """ Get all .deps file under module build folder. """ deps_files =3D [] for root, _, files in os.walk(self.d_folder, topdown=3DFalse): diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 34acdccbdbd0..1e47e382cba9 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1,10 +1,10 @@ ## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
-# C= opyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2020, Intel Corporation. All rights=20 +reserved.
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.
#= # SPDX-License-Identifier: BSD-2-Clause-Patent # =20 @@ -278,10 +278,11 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto =3D = None): else: iau.UpdateDepsFileforNonMsvc() iau.UpdateDepsFileforTrim() iau.CreateModuleDeps() iau.CreateDepsInclude() + iau.CreateDepsTarget() return "%dms" % (int(round((time.time() - BeginTime) * 1000))) =20 ## The smallest unit that can be built in multi-thread build mode # # Th= is is the base class of build unit. The "Obj" parameter must provide -- 2.20.1.windows.1