public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-stable201908] BaseTools: Fixed regression issue for building !x86 builds
@ 2019-08-28  9:17 Bob Feng
  2019-08-28 14:01 ` [edk2-devel] " Leif Lindholm
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Feng @ 2019-08-28  9:17 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2134

This patch is to fix a build tool regression issue which
was introduced by commit e8449e1d8e.

In commit e8449e1d8e, build tool check the pcd before
filter out the irrelevant library instance.

The logic of evaluating the priority of the library class
resolutions was not changed.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
---
 .../Source/Python/Workspace/InfBuildData.py   | 29 ++++++++++---------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py
index e63246b03b..7675b0ea00 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -154,12 +154,11 @@ class InfBuildData(ModuleBuildClassObject):
         self._PcdComments = None
         self._BuildOptions = None
         self._DependencyFileList = None
         self.LibInstances = []
         self.ReferenceModules = set()
-        self.Guids
-        self.Pcds
+
     def SetReferenceModule(self,Module):
         self.ReferenceModules.add(Module)
         return self
 
     ## XXX[key] = value
@@ -654,10 +653,24 @@ class InfBuildData(ModuleBuildClassObject):
                                 "Value of Guid [%s] is not found under [Guids] section in" % CName,
                                 ExtraData=PackageList, File=self.MetaFile, Line=Record[-1])
             RetVal[CName] = Value
             CommentRecords = self._RawData[MODEL_META_DATA_COMMENT, self._Arch, self._Platform, Record[5]]
             self._GuidComments[CName] = [a[0] for a in CommentRecords]
+
+        for Type in [MODEL_PCD_FIXED_AT_BUILD,MODEL_PCD_PATCHABLE_IN_MODULE,MODEL_PCD_FEATURE_FLAG,MODEL_PCD_DYNAMIC,MODEL_PCD_DYNAMIC_EX]:
+            RecordList = self._RawData[Type, self._Arch, self._Platform]
+            for TokenSpaceGuid, _, _, _, _, _, LineNo in RecordList:
+                # get the guid value
+                if TokenSpaceGuid not in RetVal:
+                    Value = GuidValue(TokenSpaceGuid, self.Packages, self.MetaFile.Path)
+                    if Value is None:
+                        PackageList = "\n\t".join(str(P) for P in self.Packages)
+                        EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
+                                        "Value of Guid [%s] is not found under [Guids] section in" % TokenSpaceGuid,
+                                        ExtraData=PackageList, File=self.MetaFile, Line=LineNo)
+                    RetVal[TokenSpaceGuid] = Value
+                    self._GuidsUsedByPcd[TokenSpaceGuid] = Value
         return RetVal
 
     ## Retrieve include paths necessary for this module (for Edk.x style of modules)
     @cached_property
     def Includes(self):
@@ -856,11 +869,11 @@ class InfBuildData(ModuleBuildClassObject):
             if file_name.upper().endswith("DEC"):
                 pkg = os.path.join(TopDir,file_name)
         return pkg
     @cached_class_function
     def GetGuidsUsedByPcd(self):
-        self.Pcds
+        self.Guid
         return self._GuidsUsedByPcd
 
     ## Retrieve PCD for given type
     def _GetPcd(self, Type):
         Pcds = OrderedDict()
@@ -868,20 +881,10 @@ class InfBuildData(ModuleBuildClassObject):
         PcdList = []
         RecordList = self._RawData[Type, self._Arch, self._Platform]
         for TokenSpaceGuid, PcdCName, Setting, Arch, Platform, Id, LineNo in RecordList:
             PcdDict[Arch, Platform, PcdCName, TokenSpaceGuid] = (Setting, LineNo)
             PcdList.append((PcdCName, TokenSpaceGuid))
-            # get the guid value
-            if TokenSpaceGuid not in self.Guids:
-                Value = GuidValue(TokenSpaceGuid, self.Packages, self.MetaFile.Path)
-                if Value is None:
-                    PackageList = "\n\t".join(str(P) for P in self.Packages)
-                    EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
-                                    "Value of Guid [%s] is not found under [Guids] section in" % TokenSpaceGuid,
-                                    ExtraData=PackageList, File=self.MetaFile, Line=LineNo)
-                self.Guids[TokenSpaceGuid] = Value
-                self._GuidsUsedByPcd[TokenSpaceGuid] = Value
             CommentRecords = self._RawData[MODEL_META_DATA_COMMENT, self._Arch, self._Platform, Id]
             Comments = []
             for CmtRec in CommentRecords:
                 Comments.append(CmtRec[0])
             self._PcdComments[TokenSpaceGuid, PcdCName] = Comments
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-29 16:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-28  9:17 [Patch][edk2-stable201908] BaseTools: Fixed regression issue for building !x86 builds Bob Feng
2019-08-28 14:01 ` [edk2-devel] " Leif Lindholm
2019-08-28 15:22   ` Liming Gao
2019-08-28 18:42     ` Michael D Kinney
2019-08-29  3:15       ` Bob Feng
2019-08-29 14:32         ` Laszlo Ersek
2019-08-29 16:00           ` Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox