public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] BaseTools: Fixed an issue that build raise exception
@ 2019-08-02  7:21 Bob Feng
  2019-08-08  0:39 ` [edk2-devel] " Liming Gao
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Feng @ 2019-08-02  7:21 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng

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

Build raise exception if there is libraryclass
missing in dsc file and --pcd build option is used.

Build should report the missing libraryclass but not
a call stack.

This patch is going to fix it.

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

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 620e48fa7f59..3ec1a35bfa3f 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1073,17 +1073,14 @@ class DscBuildData(PlatformBuildClassObject):
                     if not IsValid:
                         EdkLogger.error("build", FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))
                 GlobalData.BuildOptionPcd[i] = (TokenSpaceGuidCName, TokenCName, FieldName, pcdvalue, ("build command options", 1))
 
         if GlobalData.BuildOptionPcd:
+            inf_objs = [item for item in self._Bdb._CACHE_.values() if item.Arch == self.Arch and item.MetaFile.Ext.lower() == '.inf']
             for pcd in GlobalData.BuildOptionPcd:
                 (TokenSpaceGuidCName, TokenCName, FieldName, pcdvalue, _) = pcd
-                for BuildData in self._Bdb._CACHE_.values():
-                    if BuildData.Arch != self.Arch:
-                        continue
-                    if BuildData.MetaFile.Ext == '.dec' or BuildData.MetaFile.Ext == '.dsc':
-                        continue
+                for BuildData in inf_objs:
                     for key in BuildData.Pcds:
                         PcdItem = BuildData.Pcds[key]
                         if (TokenSpaceGuidCName, TokenCName) == (PcdItem.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName =="":
                             PcdItem.DefaultValue = pcdvalue
                             PcdItem.PcdValueFromComm = pcdvalue
-- 
2.20.1.windows.1


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

end of thread, other threads:[~2019-08-08  0:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02  7:21 [Patch 1/1] BaseTools: Fixed an issue that build raise exception Bob Feng
2019-08-08  0:39 ` [edk2-devel] " Liming Gao

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