From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Sun, 21 Apr 2019 19:30:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Apr 2019 19:30:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,380,1549958400"; d="scan'208";a="317850979" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 21 Apr 2019 19:30:50 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 21 Apr 2019 19:30:49 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 21 Apr 2019 19:29:48 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.149]) with mapi id 14.03.0415.000; Mon, 22 Apr 2019 10:29:46 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH V3] BaseTools:fixed the incorrect autogen makefile which cause build failure. Thread-Topic: [PATCH V3] BaseTools:fixed the incorrect autogen makefile which cause build failure. Thread-Index: AdT11vtgSR+pVv6iRAKqVeGZ6oBvPgC3Dn3g Date: Mon, 22 Apr 2019 02:29:46 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600E629E@SHSMSX101.ccr.corp.intel.com> References: In-Reply-To: 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 Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX=20 Sent: Thursday, April 18, 2019 7:21 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Feng, Bob C Subject: [PATCH V3] BaseTools:fixed the incorrect autogen makefile which ca= use build failure. BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1729 On some build environment, build fails but on the other build machines, bui= ld success. This is the regression issue introduced by commit 05217d210e8da37b47d0be58ec363f7af2fa1c18 As Dict is unordered, an error occurs when extract the index of the Dict in= the order of the keys after the creation of a new item. Keys are indexed inconsistently before and after adding a new item. The logic of the program is to store the key's corresponding index as refer= ence data in the MakeFile and use it as part of the macro. The data model is: $(LIST_%d) % Dict.keys().index(Key) So for now, use Orde= reDict instead of Dict. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/AutoGen/GenMake.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index 7562dc68b3..3e770ad7c4 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -429,7 +429,7 @@ cleanlib: self.CommonFileDependency =3D [] self.FileListMacros =3D {} self.ListFileMacros =3D {} - self.ObjTargetDict =3D {} + self.ObjTargetDict =3D OrderedDict() self.FileCache =3D {} self.LibraryBuildCommandList =3D [] self.LibraryFileList =3D [] @@ -943,6 +943,12 @@ cleanlib: DependencyDict[File] =3D list(NewDepSet) =20 # Convert target description object to target string in makefile + if self._AutoGenObject.BuildRuleFamily =3D=3D TAB_COMPILER_MSFT an= d TAB_C_CODE_FILE in self._AutoGenObject.Targets: + for T in self._AutoGenObject.Targets[TAB_C_CODE_FILE]: + NewFile =3D self.PlaceMacro(str(T), self.Macros) + if not self.ObjTargetDict.get(T.Target.SubDir): + self.ObjTargetDict[T.Target.SubDir] =3D set() + self.ObjTargetDict[T.Target.SubDir].add(NewFile) for Type in self._AutoGenObject.Targets: for T in self._AutoGenObject.Targets[Type]: # Generate related macros if needed @@ -952,13 +958,6 @@ c= leanlib: self.ListFileMacros[T.ListFileMacro] =3D [] if T.GenIncListFile and T.IncListFileMacro not in self.Lis= tFileMacros: self.ListFileMacros[T.IncListFileMacro] =3D [] - if self._AutoGenObject.BuildRuleFamily =3D=3D TAB_COMPILER= _MSFT and Type =3D=3D TAB_C_CODE_FILE: - NewFile =3D self.PlaceMacro(str(T), self.Macros) - if self.ObjTargetDict.get(T.Target.SubDir): - self.ObjTargetDict[T.Target.SubDir].add(NewFile) - else: - self.ObjTargetDict[T.Target.SubDir] =3D set() - self.ObjTargetDict[T.Target.SubDir].add(NewFile) =20 Deps =3D [] CCodeDeps =3D [] -- 2.14.1.windows.1