From: Michael D Kinney <michael.d.kin...@intel.com>

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

When a module in a DSC file uses a FILE_GUID override in the
module scoped <Defines> section, a copy of the modified INF file
is placed in the Conf/.cache directory.  The check for private
includes uses the INF path to determine if the module is allowed
to use the private includes.  Since the INF path in this case is
not in any package, this check always fails, and no private
include paths are possible.

The fix is to keep both the OriginalPath and the new Path in
the PathClass object, and always use the OriginalPath to see if
the module INF is in the package with private includes.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Liming Gao <liming....@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
 BaseTools/Source/Python/Common/Misc.py     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 31721a6f9f..c174b5a0bb 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3414,11 +3414,11 @@ class ModuleAutoGen(AutoGen):
             PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)
             if PackageDir not in RetVal:
                 RetVal.append(PackageDir)
             IncludesList = Package.Includes
             if Package._PrivateIncludes:
-                if not self.MetaFile.Path.startswith(PackageDir):
+                if not self.MetaFile.OriginalPath.Path.startswith(PackageDir):
                     IncludesList = 
list(set(Package.Includes).difference(set(Package._PrivateIncludes)))
             for Inc in IncludesList:
                 if Inc not in RetVal:
                     RetVal.append(str(Inc))
         return RetVal
diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 0e0cb45ebe..d082c58bef 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -279,10 +279,11 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace):
     # The BaseName is the FILE_GUID which is also the output directory name.
     #
     #
     RtPath.Path = TempFullPath
     RtPath.BaseName = BaseName
+    RtPath.OriginalPath = Path
     #
     # If file exists, compare contents
     #
     if os.path.exists(TempFullPath):
         with open(str(Path), 'rb') as f1, open(TempFullPath, 'rb') as f2:
@@ -1403,10 +1404,11 @@ class PathClass(object):
         self.IsBinary = IsBinary
         self.Target = Target
         self.TagName = TagName
         self.ToolCode = ToolCode
         self.ToolChainFamily = ToolChainFamily
+        self.OriginalPath = self
 
     ## Convert the object of this class to a string
     #
     #  Convert member Path of the class to a string
     #
-- 
2.20.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40784): https://edk2.groups.io/g/devel/message/40784
Mute This Topic: https://groups.io/mt/31639518/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to