Hi: The items to be added to the PcdList are "(PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy5)" "Dummy5" can distinguish PCDS with the same name, So the results are consistent except for the order change.
Any question, please let me know. Thanks. Best Regards Fan Zhiju -----Original Message----- From: Feng, Bob C Sent: Tuesday, March 5, 2019 5:48 PM To: Fan, ZhijuX <zhijux....@intel.com>; edk2-devel@lists.01.org Cc: Gao, Liming <liming....@intel.com> Subject: RE: [edk2][PATCH] BaseTools:Guid.xref will change after increment build Hi Zhiju, Since you changed a set() to a list, I think you need to check if the item is already in the list before appending it. Thanks, Bob -----Original Message----- From: Fan, ZhijuX Sent: Tuesday, March 5, 2019 4:48 PM To: edk2-devel@lists.01.org Cc: Gao, Liming <liming....@intel.com>; Feng, Bob C <bob.c.f...@intel.com> Subject: [edk2][PATCH] BaseTools:Guid.xref will change after increment build the order of the data may change if set() is used Cc: Bob Feng <bob.c.f...@intel.com> Cc: Liming Gao <liming....@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux....@intel.com> --- BaseTools/Source/Python/Workspace/DscBuildData.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 5e7d7dcd63..342b9472a2 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1654,7 +1654,7 @@ class DscBuildData(PlatformBuildClassObject): AvailableSkuIdSet = copy.copy(self.SkuIds) PcdDict = tdict(True, 4) - PcdSet = set() + PcdList = [] # Find out all possible PCD candidates for self._Arch RecordList = self._RawData[Type, self._Arch] PcdValueDict = OrderedDict() @@ -1666,10 +1666,10 @@ class DscBuildData(PlatformBuildClassObject): File=self.MetaFile, Line=Dummy5) if SkuName in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COMMON): if "." not in TokenSpaceGuid and "[" not in PcdCName: - PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5)) + PcdList.append((PcdCName, TokenSpaceGuid, SkuName, + Dummy5)) PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting - for PcdCName, TokenSpaceGuid, SkuName, Dummy4 in PcdSet: + for PcdCName, TokenSpaceGuid, SkuName, Dummy4 in PcdList: Setting = PcdDict[self._Arch, PcdCName, TokenSpaceGuid, SkuName] if Setting is None: continue @@ -2874,7 +2874,7 @@ class DscBuildData(PlatformBuildClassObject): # PCD settings for certain ARCH and SKU # PcdDict = tdict(True, 5) - PcdSet = set() + PcdList = [] RecordList = self._RawData[Type, self._Arch] # Find out all possible PCD candidates for self._Arch AvailableSkuIdSet = copy.copy(self.SkuIds) @@ -2896,12 +2896,12 @@ class DscBuildData(PlatformBuildClassObject): EdkLogger.error('build', PARAMETER_INVALID, 'DefaultStores %s is not defined in [DefaultStores] section' % DefaultStore, File=self.MetaFile, Line=Dummy5) if "." not in TokenSpaceGuid and "[" not in PcdCName: - PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy5)) + PcdList.append((PcdCName, TokenSpaceGuid, SkuName, + DefaultStore, Dummy5)) PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore] = Setting # Remove redundant PCD candidates, per the ARCH and SKU - for PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4 in PcdSet: + for PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4 in PcdList: Setting = PcdDict[self._Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore] if Setting is None: -- 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel