From a0792697bc54e5472e2126c6fbff8031868426a9 Mon Sep 17 00:00:00 2001 From: "Feng, Bob C" Date: Fri, 2 Aug 2019 14:40:31 +0800 Subject: [PATCH] BaseTools: Fixed an issue that build raise exception 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 Signed-off-by: Bob Feng Reviewed-by: Liming Gao --- 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 383aeaaa15..d2b5ccbb7a 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1075,13 +1075,10 @@ class DscBuildData(PlatformBuildClassObject): 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 =="":