public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* PACKAGES_PATH in !include path in Dsc files
@ 2018-10-13  9:00 Pankaj Bansal
  2018-10-16  1:35 ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Pankaj Bansal @ 2018-10-13  9:00 UTC (permalink / raw)
  To: Yonghong Zhu, Liming Gao; +Cc: edk2-devel@lists.01.org, Udit Kumar, Varun Sethi

Hello All,

I am trying to add this functionality that we can specify PACKAGES_PATH in !include path in Dsc files just like we can specify WORKSPACE.
I did below changes for it:

--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1530,6 +1530,7 @@ class DscParser(MetaFileParser):
             # Allow using system environment variables  in path after !include
             #
             __IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
+            __IncludeMacros['PACKAGES_PATH'] = GlobalData.gGlobalDefines['PACKAGES_PATH']^M
             if "ECP_SOURCE" in GlobalData.gGlobalDefines:
                 __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
             #
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index d74082fc26..61dce3a856 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -197,6 +197,7 @@ def CheckEnvVariable():
     GlobalData.gEcpSource = EcpSourceDir

     GlobalData.gGlobalDefines["WORKSPACE"]  = WorkspaceDir
+    GlobalData.gGlobalDefines["PACKAGES_PATH"]  = PackagesPath^M
     GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
     GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
     GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir

With these changes the compilation starts OK, but I get this error later on:

GenFds.py...
: error C0DE: Tools code failure
        Please send email to edk2-devel@lists.01.org for help, attaching following call stack trace!

Traceback (most recent call last):
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/GenFds/GenFds.py", line 246, in main
    TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, TAB_COMMON, Options.BuildTarget, Options.ToolChain].SupArchList) & set(ArchList)
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py", line 132, in __getitem__
    Toolchain
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/DscBuildData.py", line 221, in __init__
    self._HandleOverridePath()
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/DscBuildData.py", line 282, in _HandleOverridePath
    RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaFileParser.py", line 257, in __getitem__
    self._PostProcess()
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaFileParser.py", line 1358, in _PostProcess
    Processer[self._ItemType]()
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaFileParser.py", line 1533, in __ProcessDirective
    __IncludeMacros['PACKAGES_PATH'] = GlobalData.gGlobalDefines['PACKAGES_PATH']
KeyError: 'PACKAGES_PATH'



build.py...
: error 7000: Failed to execute command
        GenFds -f /home/nxa34148/Desktop/uefi/edk2-platforms/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf --conf=/home/nxa34148/Desktop/uefi/Conf -o /home/nxa34148/Desktop/uefi/Build/LS1043aRdbPkg/RELEASE_GCC49 -t GCC49 -b RELEASE -p /home/nxa34148/Desktop/uefi/edk2-platforms/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc -a AARCH64 -D "EFI_SOURCE=/home/nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D "EDK_SOURCE=/home/nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D "TOOL_CHAIN_TAG=GCC49" -D "TOOLCHAIN=GCC49" -D "FAMILY=GCC" -D "PACKAGES_PATH=/home/nxa34148/Desktop/uefi/edk2-platforms" -D "EDK_TOOLS_PATH=/home/nxa34148/Desktop/uefi/BaseTools" -D "WORKSPACE=/home/nxa34148/Desktop/uefi" -D "ARCH=AARCH64" -D "ECP_SOURCE=/home/nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D "TARGET=RELEASE" [/home/nxa34148/Desktop/uefi]

- Failed -

I am not able to understand the cause of this error.

Can you please help?

Regards,
Pankaj Bansal


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

end of thread, other threads:[~2018-10-16  6:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-13  9:00 PACKAGES_PATH in !include path in Dsc files Pankaj Bansal
2018-10-16  1:35 ` Gao, Liming
2018-10-16  2:40   ` Pankaj Bansal
2018-10-16  3:11     ` Ard Biesheuvel
2018-10-16  5:23       ` Pankaj Bansal
2018-10-16  5:28         ` Gao, Liming
2018-10-16  6:00           ` Pankaj Bansal

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