public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Fan, ZhijuX" <zhijux.fan@intel.com>
To: "Feng, Bob C" <bob.c.feng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: FW: [PATCH] BaseTools:Guid.xref will change after increment build
Date: Wed, 6 Mar 2019 06:05:14 +0000	[thread overview]
Message-ID: <FAD0D7E0AE0FA54D987F6E72435CAFD50AF337A4@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D1600A877D@SHSMSX101.ccr.corp.intel.com>

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.fan@intel.com>; edk2-devel@lists.01.org
Cc: Gao, Liming <liming.gao@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.gao@intel.com>; Feng, Bob C <bob.c.feng@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.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@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



      reply	other threads:[~2019-03-06  6:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05  8:47 [PATCH] BaseTools:Guid.xref will change after increment build Fan, ZhijuX
2019-03-05  9:47 ` Feng, Bob C
2019-03-06  6:05   ` Fan, ZhijuX [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FAD0D7E0AE0FA54D987F6E72435CAFD50AF337A4@SHSMSX101.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox