From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.2639.1607393773495345014 for ; Mon, 07 Dec 2020 18:16:13 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: chasel.chiu@intel.com) IronPort-SDR: h3u3wxGkkcf5phrJigKu2CIAtfBDqz6LKQ85nA1vnFzahVD4seOFkeogioEiY4zJCMuQqiOplY SVkBfXD7qyKA== X-IronPort-AV: E=McAfee;i="6000,8403,9828"; a="173962845" X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="173962845" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 18:16:13 -0800 IronPort-SDR: bmrHGyN87yTHPCkDjwNGl8jOQl66J/d/9DO89BQq4G+LklQSLVQXosPZ4LJPFsJXKEeioNKBT0 l1m/9lO9gA2w== X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="483453440" Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.187.92]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 18:16:11 -0800 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Maurice Ma , Nate DeSimone , Star Zeng Subject: [PATCH] IntelFsp2Pkg/GenCfgOpt.py: Incremental build with UPD in sub DSC. Date: Tue, 8 Dec 2020 10:15:53 +0800 Message-Id: <20201208021553.1348-1-chasel.chiu@intel.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3107 Current script only compares main DSC and output file datetime to determine if re-generation required or not. When UPD defined in sub DSC and was modified current script cannot detect and will not re-generate output files which caused incremental build issue. Since UPD can be defined in any sub DSC the script has been updated to compare all DSC datetime with output files to determine re-generation is needed or not. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt= .py index af7e14a10a..a0b8bba81e 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -313,6 +313,7 @@ EndList self._DscFile =3D ''=0D self._FvDir =3D ''=0D self._MapVer =3D 0=0D + self._DscTime =3D 0=0D =0D def ParseMacros (self, MacroDefStr):=0D # ['-DABC=3D1', '-D', 'CFG_DEBUG=3D1', '-D', 'CFG_OUTDIR=3DBuild']= =0D @@ -423,6 +424,9 @@ EndList self._DscFile =3D DscFile=0D self._FvDir =3D FvDir=0D =0D + # Initial DSC time is parent DSC time.=0D + self._DscTime =3D os.path.getmtime(DscFile)=0D +=0D IsDefSect =3D False=0D IsPcdSect =3D False=0D IsUpdSect =3D False=0D @@ -530,6 +534,12 @@ EndList if IncludeDsc =3D=3D None:=0D print("ERROR: Cannot open file= '%s'" % IncludeFilePath)=0D raise SystemExit=0D +=0D + # Update DscTime when newer DSC ti= me found.=0D + CurrentDscTime =3D os.path.getmtim= e(os.path.realpath(IncludeDsc.name))=0D + if CurrentDscTime > self._DscTime:= =0D + self._DscTime =3D CurrentDscTi= me=0D +=0D NewDscLines =3D IncludeDsc.readlin= es()=0D IncludeDsc.close()=0D DscLines =3D NewDscLines + DscLine= s=0D @@ -815,9 +825,8 @@ EndList if not os.path.exists(OutPutFile):=0D NoFileChange =3D False=0D else:=0D - DscTime =3D os.path.getmtime(self._DscFile)=0D OutputTime =3D os.path.getmtime(OutPutFile)=0D - if DscTime > OutputTime:=0D + if self._DscTime > OutputTime:=0D NoFileChange =3D False=0D return NoFileChange=0D =0D --=20 2.28.0.windows.1