From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 058902116373F for ; Mon, 15 Oct 2018 18:36:26 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2018 18:36:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,386,1534834800"; d="scan'208,217";a="271613675" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 15 Oct 2018 18:36:26 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 Oct 2018 18:36:26 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 Oct 2018 18:36:25 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.48]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0319.002; Tue, 16 Oct 2018 09:36:00 +0800 From: "Gao, Liming" To: Pankaj Bansal , "Zhu, Yonghong" CC: "edk2-devel@lists.01.org" , Udit Kumar , Varun Sethi Thread-Topic: PACKAGES_PATH in !include path in Dsc files Thread-Index: AdRi0VkZgDJjRBnmQAu3SgG7JULGpgCHv2Vg Date: Tue, 16 Oct 2018 01:35:59 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E33A7E6@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: PACKAGES_PATH in !include path in Dsc files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 01:36:27 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 i= t. Thanks Liming From: Pankaj Bansal [mailto:pankaj.bansal@nxp.com] Sent: Saturday, October 13, 2018 5:01 PM To: Zhu, Yonghong ; Gao, Liming Cc: edk2-devel@lists.01.org; Udit Kumar ; 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 !inc= lude # __IncludeMacros['WORKSPACE'] =3D GlobalData.gGlobalDefines['WO= RKSPACE'] + __IncludeMacros['PACKAGES_PATH'] =3D GlobalData.gGlobalDefines= ['PACKAGES_PATH']^M if "ECP_SOURCE" in GlobalData.gGlobalDefines: __IncludeMacros['ECP_SOURCE'] =3D GlobalData.gGlobalDefine= s['ECP_SOURCE'] # diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/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 =3D EcpSourceDir GlobalData.gGlobalDefines["WORKSPACE"] =3D WorkspaceDir + GlobalData.gGlobalDefines["PACKAGES_PATH"] =3D PackagesPath^M GlobalData.gGlobalDefines["EFI_SOURCE"] =3D EfiSourceDir GlobalData.gGlobalDefines["EDK_SOURCE"] =3D EdkSourceDir GlobalData.gGlobalDefines["ECP_SOURCE"] =3D 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.p= y", line 246, in main TargetArchList =3D set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.= ActivePlatform, TAB_COMMON, Options.BuildTarget, Options.ToolChain].SupArch= List) & set(ArchList) File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/Works= paceDatabase.py", line 132, in __getitem__ Toolchain File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/DscBu= ildData.py", line 221, in __init__ self._HandleOverridePath() File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/DscBu= ildData.py", line 282, in _HandleOverridePath RecordList =3D self._RawData[MODEL_META_DATA_COMPONENT, self._Arch] File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaF= ileParser.py", line 257, in __getitem__ self._PostProcess() File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaF= ileParser.py", line 1358, in _PostProcess Processer[self._ItemType]() File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaF= ileParser.py", line 1533, in __ProcessDirective __IncludeMacros['PACKAGES_PATH'] =3D GlobalData.gGlobalDefines['PACKAGE= S_PATH'] KeyError: 'PACKAGES_PATH' build.py... : error 7000: Failed to execute command GenFds -f /home/nxa34148/Desktop/uefi/edk2-platforms/Platform/NXP/L= S1043aRdbPkg/LS1043aRdbPkg.fdf --conf=3D/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/LS1043aR= dbPkg/LS1043aRdbPkg.dsc -a AARCH64 -D "EFI_SOURCE=3D/home/nxa34148/Desktop/= uefi/EdkCompatibilityPkg" -D "EDK_SOURCE=3D/home/nxa34148/Desktop/uefi/EdkC= ompatibilityPkg" -D "TOOL_CHAIN_TAG=3DGCC49" -D "TOOLCHAIN=3DGCC49" -D "FAM= ILY=3DGCC" -D "PACKAGES_PATH=3D/home/nxa34148/Desktop/uefi/edk2-platforms" = -D "EDK_TOOLS_PATH=3D/home/nxa34148/Desktop/uefi/BaseTools" -D "WORKSPACE= =3D/home/nxa34148/Desktop/uefi" -D "ARCH=3DAARCH64" -D "ECP_SOURCE=3D/home/= nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D "TARGET=3DRELEASE" [/home/nxa= 34148/Desktop/uefi] - Failed - I am not able to understand the cause of this error. Can you please help? Regards, Pankaj Bansal