Reviewed-by: Bob Feng <bob.c.f...@intel.com>

-----Original Message-----
From: Chen, Christine <yuwei.c...@intel.com> 
Sent: Thursday, June 30, 2022 5:04 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.f...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn>; 
Huang, Long1 <long1.hu...@intel.com>; Ni, Ray <ray...@intel.com>
Subject: [PATCH 1/1] BaseTools: Fix DSC LibraryClass precedence rule

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3965

Currently DSC LibraryClass precedence rule is not align with DSC Spec.

The expectation rule should be:
[LibraryClasses.$(ARCH)] < [LibraryClasses.Common.$(MODULE_TYPE)]

The actual behavior is:
[LibraryClasses.$(ARCH)] > [LibraryClasses.Common.$(MODULE_TYPE)]

This patch fixes the issue.

Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Long1 Huang <long1.hu...@intel.com>
Cc: Ray Ni <ray...@intel.com>
Signed-off-by: Yuwei Chen <yuwei.c...@intel.com>
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index a599c5bb7688..7a56b2b2e972 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -872,7 +872,7 @@ class DscBuildData(PlatformBuildClassObject):
                 if ModuleType != TAB_COMMON and ModuleType not in 
SUP_MODULE_LIST:
                     EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module 
type [%s]" % ModuleType,
                                     File=self.MetaFile, 
ExtraData=LibraryInstance, Line=LineNo)
-                LibraryClassDict[Arch, ModuleType, LibraryClass] = 
LibraryInstance
+                LibraryClassDict[ModuleType, Arch, LibraryClass] = 
LibraryInstance
                 if LibraryInstance not in self._LibraryInstances:
                     self._LibraryInstances.append(LibraryInstance)
 
@@ -881,7 +881,7 @@ class DscBuildData(PlatformBuildClassObject):
             for LibraryClass in LibraryClassSet:
                 # try all possible module types
                 for ModuleType in SUP_MODULE_LIST:
-                    LibraryInstance = LibraryClassDict[self._Arch, ModuleType, 
LibraryClass]
+                    LibraryInstance = LibraryClassDict[ModuleType, self._Arch, 
LibraryClass]
                     if LibraryInstance is None:
                         continue
                     self._LibraryClasses[LibraryClass, ModuleType] = 
LibraryInstance
-- 
2.26.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91210): https://edk2.groups.io/g/devel/message/91210
Mute This Topic: https://groups.io/mt/92082564/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to