public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Conditionally Include FDF File
@ 2020-04-20  5:25 Ashish Singhal
  2020-04-20  6:16 ` [edk2-devel] " Lin, Derek (HPS SW)
  2020-04-20 12:05 ` Laszlo Ersek
  0 siblings, 2 replies; 6+ messages in thread
From: Ashish Singhal @ 2020-04-20  5:25 UTC (permalink / raw)
  To: devel@edk2.groups.io, Bob Feng, Gao, Liming

[-- 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 --]

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

end of thread, other threads:[~2020-04-20 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-20  5:25 Conditionally Include FDF File Ashish Singhal
2020-04-20  6:16 ` [edk2-devel] " 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

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