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.88, mailfrom: bob.c.feng@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Thu, 18 Apr 2019 02:49:07 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 02:49:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,365,1549958400"; d="scan'208";a="132390015" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga007.jf.intel.com with ESMTP; 18 Apr 2019 02:49:06 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 18 Apr 2019 02:49:06 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 18 Apr 2019 02:49:05 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.21]) with mapi id 14.03.0415.000; Thu, 18 Apr 2019 17:49:04 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH V2] BaseTools:Makefiles cause data errors on some platforms Thread-Topic: [PATCH V2] BaseTools:Makefiles cause data errors on some platforms Thread-Index: AdT1vSTc63eynzW2QbmZ7XZ3TneFQwADrTTQ Date: Thu, 18 Apr 2019 09:49:03 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600E4C38@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 Zhiju, please update the title. -Bob -----Original Message----- From: Fan, ZhijuX=20 Sent: Thursday, April 18, 2019 4:05 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Feng, Bob C Subject: [PATCH V2] BaseTools:Makefiles cause data errors on some platforms 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