public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Pankaj Bansal <pankaj.bansal@nxp.com>
To: "Gao, Liming" <liming.gao@intel.com>,
	"Zhu, Yonghong" <yonghong.zhu@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Michael D Kinney <michael.d.kinney@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 02:40:18 +0000	[thread overview]
Message-ID: <HE1PR0402MB3323F9A729C56EB3A2303A1DF1FE0@HE1PR0402MB3323.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E33A7E6@SHSMSX104.ccr.corp.intel.com>

+edk2-platforms maintainers in To list

Thank you Liming for replying.

Our entire code is in edk2-platforms (https://github.com/tianocore/edk2-platforms) which is denoted by PACKAGES_PATH.
The PACKAGES_PATH directory can be anywhere in WORKSPACE depending on the sync directory defined by user.
i.e. it can be $(WORKSPACE)/edk2-platforms or $(WORKSPACE)/<any directory name that user can define during git sync>
As our dsc files are relative to PACKAGES_PATH, I want to specify their path in dsc file like this:

!include $(PACKAGES_PATH)/Silicon/NXP/<Silicon Name>.dsc

Using $(WORKSPACE), I cannot specify above path, as it can be at place other than $(WORKSPACE)/edk2-platforms

Regards,
Pankaj Bansal

From: Gao, Liming [mailto:liming.gao@intel.com]
Sent: Tuesday, October 16, 2018 7:06 AM
To: Pankaj Bansal <pankaj.bansal@nxp.com>; Zhu, Yonghong <yonghong.zhu@intel.com>
Cc: 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

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<mailto:yonghong.zhu@intel.com>>; Gao, Liming <liming.gao@intel.com<mailto:liming.gao@intel.com>>
Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>; Udit Kumar <udit.kumar@nxp.com<mailto:udit.kumar@nxp.com>>; Varun Sethi <V.Sethi@nxp.com<mailto: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  2:40 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
2018-10-16  2:40   ` Pankaj Bansal [this message]
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=HE1PR0402MB3323F9A729C56EB3A2303A1DF1FE0@HE1PR0402MB3323.eurprd04.prod.outlook.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