]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix DSC LibraryClass precedence rule
authorChen, Christine <Yuwei.Chen@intel.com>
Thu, 30 Jun 2022 09:04:05 +0000 (17:04 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 17 Jul 2022 03:33:41 +0000 (03:33 +0000)
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.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Long1 Huang <long1.huang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/Workspace/DscBuildData.py

index e9f68384b429727a27af0360a5c28baf54265010..41f93c93f2a743e7ee1dbd72bb687adb4748dd81 100644 (file)
@@ -872,7 +872,7 @@ class DscBuildData(PlatformBuildClassObject):
                 if ModuleType != TAB_COMMON and ModuleType not in SUP_MODULE_LIST:\r
                     EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module type [%s]" % ModuleType,\r
                                     File=self.MetaFile, ExtraData=LibraryInstance, Line=LineNo)\r
-                LibraryClassDict[Arch, ModuleType, LibraryClass] = LibraryInstance\r
+                LibraryClassDict[ModuleType, Arch, LibraryClass] = LibraryInstance\r
                 if LibraryInstance not in self._LibraryInstances:\r
                     self._LibraryInstances.append(LibraryInstance)\r
 \r
@@ -881,7 +881,7 @@ class DscBuildData(PlatformBuildClassObject):
             for LibraryClass in LibraryClassSet:\r
                 # try all possible module types\r
                 for ModuleType in SUP_MODULE_LIST:\r
-                    LibraryInstance = LibraryClassDict[self._Arch, ModuleType, LibraryClass]\r
+                    LibraryInstance = LibraryClassDict[ModuleType, self._Arch, LibraryClass]\r
                     if LibraryInstance is None:\r
                         continue\r
                     self._LibraryClasses[LibraryClass, ModuleType] = LibraryInstance\r