public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ashish Singhal" <ashishsingha@nvidia.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	Bob Feng <bob.c.feng@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>
Subject: Conditionally Include FDF File
Date: Mon, 20 Apr 2020 05:25:59 +0000	[thread overview]
Message-ID: <BYAPR12MB2726D3CF9D89A277FBF8EDF9BAD40@BYAPR12MB2726.namprd12.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4438 bytes --]

Hello,

I am trying to change my top-level FDF file layout by conditionally including an FDF depending on a build time define being passed or not. The behavior I am seeing is as follows.


  1.  I am passing the build time define and the included fdf.inc file gets included.
  2.  I am not passing the build time define and the included fdf.inc file still gets included apparently.
     *   However, there is a strange behavior which is that in the conditional block if I have anything else other than the !include statement, it gets ignored.
     *   But if there is a !include statement inside a conditional (which should fail) the include statement is still processed.

Conditional statement in top-level fdf is:

!ifdef $(BUILD_PLATFORM_XYZ)
  !include Platform/NVIDIA/XYZ.fdf.inc
!endif

When we do not pass in -D BUILD_PLATFORM_XYZ during build, Platform/NVIDIA/XYZ.fdf.inc file should not be included as it could be totally absent as well. However, the build system tries to include the file and fails with the following log.

(Python 3.5.2 on linux) Traceback (most recent call last):
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2586, in Main
    MyBuild.Launch()
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2381, in Launch
    self._MultiThreadBuildPlatform()
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2231, in _MultiThreadBuildPlatform
    Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2096, in PerformAutoGen
    self.Progress
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 43, in __init__
    self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 112, in _InitWorker
    self.ProcessModuleFromPdf()
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 188, in ProcessModuleFromPdf
    if self.FdfProfile:
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/Common/caching.py", line 28, in __get__
    Value = obj.__dict__[self._function.__name__] = self._function(obj)
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 164, in FdfProfile
    Fdf.ParseFile()
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/GenFds/FdfParser.py", line 1312, in ParseFile
    self.Preprocess()
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/GenFds/FdfParser.py", line 1291, in Preprocess
    self.PreprocessIncludeFile()
  File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/BaseTools/Source/Python/GenFds/FdfParser.py", line 625, in PreprocessIncludeFile
    self.FileName, self.CurrentLineNumber)
GenFds.FdfParser.Warning: The include file does not exist under below directories:
<Here it lists the root diectories included in the build>.
<Here it lists the line and column number of top level fdf file which has include statement for Platform/NVIDIA/XYZ.fdf.inc but under a conditional as mentioned above.

Any help getting around this if you think I am checking for the conditional incorrectly or checking the build script for a potential bug would be highly appreciated.

Thanks
Ashish




-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

[-- Attachment #2: Type: text/html, Size: 8603 bytes --]

             reply	other threads:[~2020-04-20  5:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20  5:25 Ashish Singhal [this message]
2020-04-20  6:16 ` [edk2-devel] Conditionally Include FDF File Lin, Derek (HPS SW)
2020-04-20  7:07   ` Ashish Singhal
2020-04-20  7:42     ` Ashish Singhal
2020-04-20 12:05 ` Laszlo Ersek
2020-04-20 16:33   ` Ashish Singhal

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=BYAPR12MB2726D3CF9D89A277FBF8EDF9BAD40@BYAPR12MB2726.namprd12.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