public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: Pankaj Bansal <pankaj.bansal@nxp.com>,
	"Zhu, Yonghong" <yonghong.zhu@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Udit Kumar <udit.kumar@nxp.com>, Varun Sethi <V.Sethi@nxp.com>
Subject: Re: PACKAGES_PATH in !include path in Dsc files
Date: Tue, 16 Oct 2018 01:35:59 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E33A7E6@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <HE1PR0402MB33238663E868EC59A2DAC66EF1E30@HE1PR0402MB3323.eurprd04.prod.outlook.com>

What's your usage model in DSC?

BaseTools will try to replace $(WORKSPACE) with WORKSPACE and PACKAGES_PATH, and find the first existing file. So, if you want to refer to one file in PACKAGES_PATH directory, you can also use $(WORKSPACE) macro to refer to it.

Thanks
Liming
From: Pankaj Bansal [mailto:pankaj.bansal@nxp.com]
Sent: Saturday, October 13, 2018 5:01 PM
To: Zhu, Yonghong <yonghong.zhu@intel.com>; Gao, Liming <liming.gao@intel.com>
Cc: edk2-devel@lists.01.org; Udit Kumar <udit.kumar@nxp.com>; Varun Sethi <V.Sethi@nxp.com>
Subject: PACKAGES_PATH in !include path in Dsc files

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<mailto: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


  reply	other threads:[~2018-10-16  1:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13  9:00 PACKAGES_PATH in !include path in Dsc files Pankaj Bansal
2018-10-16  1:35 ` Gao, Liming [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E33A7E6@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox