From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by mx.groups.io with SMTP id smtpd.web12.566.1587360366162875749 for ; Sun, 19 Apr 2020 22:26:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rIDs43AY; spf=pass (domain: nvidia.com, ip: 203.18.50.4, mailfrom: ashishsingha@nvidia.com) Received: from hkpgpgate102.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 20 Apr 2020 13:26:03 +0800 Received: from HKMAIL103.nvidia.com ([10.18.16.12]) by hkpgpgate102.nvidia.com (PGP Universal service); Sun, 19 Apr 2020 22:26:03 -0700 X-PGP-Universal: processed; by hkpgpgate102.nvidia.com on Sun, 19 Apr 2020 22:26:03 -0700 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 20 Apr 2020 05:26:02 +0000 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.50) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 20 Apr 2020 05:26:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4T5UJ5aaBcASGaL51J4z+0a40lP8mJ+b8Q8ifix6xNh4pcrSqUiJ9rkY64usQewBeoA2Xa9q1NiD0IhMaB8zdB080TcnEumofmT5AO4868AKFtS+ph6xYp7fJ80D2WMeuMHrtbA0Ct7Km7RisFPCJg1wRs/hcFW2MVapgJkjGML2uzCVvPGEleoEV8BqXAFYs9vYyLLjWTPg72mKybKC5pP7F7PV1j7eAmAAGKKpyNxcRg3JuxrdyRWdPk86GiaaOQNsjO+1vnzo9gJIG5u1i7V2Z99LrSj2jYR5qHN+Sf8GQUaNmt5+Gsb3C2Z2qn78s6esrHPj7EfAzeqr8ikuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zyqbZL7UfxDF0C3AIKAkoh62YDFmMpm9eU2QN/1q17U=; b=Rdc/2Dpz8jgLWOYlfu/7iLpKXGhdxTVwZSlwp5sqaYrccDBWbdhQqECouZ+G2WDpP+5U3NRctBE+nV1fi1ROD8F9sWOC6XC1sVf1m2g3Tweusi3WpVC74RlwlqZ5EyF+JJDFnLu3EgAXaSrgGKQqjriVoBAjLNuUpJIOPGPClOV1W3cNL5aEx2s9MSVRi5spU0jgjdATcXK7MnD9EUbC17wT/00fHOUCvxaxgx9sYRoVNrhpfhdOVITttXucg1wvQrpUJZHfZbPxj8/Yxa5Phh4E2XsDOksuFO1d/r1Jqm7H2rTg/4LqIb/HGDTzVg/F8rZZppguKscp0DINJBLirw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from BYAPR12MB2726.namprd12.prod.outlook.com (2603:10b6:a03:66::17) by BYAPR12MB3494.namprd12.prod.outlook.com (2603:10b6:a03:ad::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Mon, 20 Apr 2020 05:25:59 +0000 Received: from BYAPR12MB2726.namprd12.prod.outlook.com ([fe80::61e1:6a43:d8b:f7a4]) by BYAPR12MB2726.namprd12.prod.outlook.com ([fe80::61e1:6a43:d8b:f7a4%6]) with mapi id 15.20.2921.027; Mon, 20 Apr 2020 05:25:59 +0000 From: "Ashish Singhal" To: "devel@edk2.groups.io" , Bob Feng , "Gao, Liming" Subject: Conditionally Include FDF File Thread-Topic: Conditionally Include FDF File Thread-Index: AQHWFtKZxMAU2rFjGkuX7RWe3+BlnA== Date: Mon, 20 Apr 2020 05:25:59 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ashishsingha@nvidia.com; x-originating-ip: [216.228.112.22] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 35a6a3c2-df5d-4824-80f5-08d7e4eb4f32 x-ms-traffictypediagnostic: BYAPR12MB3494: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 03793408BA x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(346002)(366004)(39850400004)(136003)(396003)(376002)(81156014)(8936002)(8676002)(26005)(316002)(86362001)(478600001)(3480700007)(55016002)(6506007)(71200400001)(186003)(33656002)(66556008)(66446008)(66476007)(64756008)(76116006)(5660300002)(19627405001)(110136005)(2906002)(52536014)(7696005)(66946007)(9686003);DIR:OUT;SFP:1101; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SRYhRDrXdfJSKTEbEzM03tuqv0bDytvt4WcdpvTpDQsD0Xd6HoPh4dl6BL2bRAotKKUPUOE7VHGAOpnoS8kMNWf7bjnEDnYzJPmXyIwmnI+evQ+tRKBpOOzLQgajH4aRtfTrCkIEgr9Em6mI9oSMz/3px6ej50ze2faNb7R8rsDhxMrnWlKyqScn6jPFTq+iQV8WoDnnLryPwRF9dlGTYQzKx6NUa6UY9UcAl8PgJ8R918svkB4svnjAFTDcIiNVYiGqay+0K1tCA1QmQRv+0M/ZJbhzIOrR0qGEHHbxciU4eW6D9NSlCJIZARGt5llonb/U1DTPDM/PFSZLGdmHPck9ZGhn8LNzzOk7YLIg1tFiXfnqpCOwOWpCK8khbkiFnWGms0boPUxF5fSMGip7vb6OkNccpwAB2zcWP67KisiMFPA93EdkbcRISJyh0zef x-ms-exchange-antispam-messagedata: ntWgStDrxgJS6ZZ0r9xHSXCW5iEvMzSIs02i+3UoJ0zQe8WaLGyFMf34Ci4wUeCYDJtVXz5/59zt5n1GDJe68LgLRsydfmkWpHbgWLECE7OQ0WYOHSk3sVzpbAulQTdKzA8CHbYljgvwnYml/NuYAQ== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 35a6a3c2-df5d-4824-80f5-08d7e4eb4f32 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2020 05:25:59.1063 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Se8KsAOQ2Ulo+w6+2mC/NB+ytH+el3Fes8hX05JKDLHE5w+1zomFP+o1T5Sice9Yzux6ePRur2YCdTaLf3/pug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3494 Return-Path: ashishsingha@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1587360363; bh=5VEh11BTB3RysqI4P3Jn2VAgvsb0eit6LRoYE/VbB8k=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:Subject:Thread-Topic: Thread-Index:Date:Message-ID:Accept-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-forefront-prvs: x-forefront-antispam-report:received-spf: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type; b=rIDs43AYqVeifKtYgOp/7Md0FzcdpU8nlf6KD4DfJw3U0rlPkk+QS4xljhohD6e/e 7Tbz6Y9yAnGjKp3rCPFporTauzf6TChs1eF4Mf6+WhtGSzMpCifaxGNJL71YNHj6aE tO7x263yM22HlZs0nsqeqp29WJJi1roUbkuEbArtMaA7erTuX0MG1eQPtwxdMvI55n Wf2nL6X1LDxNVA5LUbE3oq2/o3irUUfk6QPwPRwB/8GeI6crE6hDPZlL9N8CI5vdXj lmEmRwDCeAi7ADBbY+nMLhfhLvlQIX3IVf2gO2wF/NSBm+AcDajv8NQ60/S7CbyeqG axDsFVcd4tTNg== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR12MB2726D3CF9D89A277FBF8EDF9BAD40BYAPR12MB2726namp_" --_000_BYAPR12MB2726D3CF9D89A277FBF8EDF9BAD40BYAPR12MB2726namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I am trying to change my top-level FDF file layout by conditionally inclu= ding an FDF depending on a build time define being passed or not. The beh= avior I am seeing is as follows. =20 1. I am passing the build time define and the included fdf.inc file = gets included. =20 2. I am not passing the build time define and the included fdf.inc f= ile still gets included apparently. =20 * However, there is a strange behavior which is that in the cond= itional block if I have anything else other than the !include statement, = it gets ignored. =20 * But if there is a !include statement inside a conditional (whi= ch should fail) the include statement is still processed. Conditional statement in top-level fdf is: !ifdef $(BUILD_PLATFORM_XYZ) =20 !include Platform/NVIDIA/XYZ.fdf.inc !endif When we do not pass in -D BUILD_PLATFORM_XYZ during build, Platform/NVIDI= A/XYZ.fdf.inc file should not be included as it could be totally absent a= s well. However, the build system tries to include the file and fails wit= h the following log. (Python 3.5.2 on linux) Traceback (most recent call last): =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line = 2586, in Main =20 MyBuild.Launch() =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line = 2381, in Launch =20 self._MultiThreadBuildPlatform() =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line = 2231, in _MultiThreadBuildPlatform =20 Wa, self.BuildModules =3D self.PerformAutoGen(BuildTarget,ToolChain= ) =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line = 2096, in PerformAutoGen =20 self.Progress =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 43, in __init__= =20 self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *arg= s, **kwargs) =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 112, in _InitWo= rker =20 self.ProcessModuleFromPdf() =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 188, in Process= ModuleFromPdf =20 if self.FdfProfile: =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/Common/caching.py", line 28, in __get__ =20 Value =3D obj.__dict__[self._function.__name__] =3D self._function(= obj) =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", line 164, in FdfProf= ile =20 Fdf.ParseFile() =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/GenFds/FdfParser.py", line 1312, in ParseFile =20 self.Preprocess() =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/GenFds/FdfParser.py", line 1291, in Preprocess =20 self.PreprocessIncludeFile() =20 File "/media/ashishsingha/Workspace/UEFI/out/nvidia/bootloader/uefi/B= aseTools/Source/Python/GenFds/FdfParser.py", line 625, in PreprocessInclu= deFile =20 self.FileName, self.CurrentLineNumber) GenFds.FdfParser.Warning: The include file does not exist under below dir= ectories: .
Hello,

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

  1. I am passing the build time define and the included fdf.inc file gets= =20included.
  2. I am not passing the build time define and the inclu= ded fdf.inc file still gets included apparently.
    1. However, there is a strange behavior which is that in the conditional= =20block if I have anything else other than the !include statement, it ge= ts ignored.
    2. But if there is a !include statement inside a conditi= onal (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 =20file should not be included as it could be totally absent as well. How= ever, the build system tries to include the file and fails with the follo= wing log.

    (Python =203.5.2 on linux) Traceback (most recent call last):
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/bui= ld.py", line 2586, in Main
        MyBuild.Launch()
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/bui= ld.py", line 2381, in Launch
        self._MultiThreadBuildPlatform()
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/bui= ld.py", line 2231, in _MultiThreadBuildPlatform
        Wa, self.BuildModules =3D self.PerformAutoGen(BuildTar= get,ToolChain)
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/bui= ld.py", line 2096, in PerformAutoGen
        self.Progress
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", li= ne 43, in __init__
        self._InitWorker(Workspace, MetaFile, Target, Toolchai= n, Arch, *args, **kwargs)
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", li= ne 112, in _InitWorker
        self.ProcessModuleFromPdf()
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", li= ne 188, in ProcessModuleFromPdf
        if self.FdfProfile:
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/Common/caching.py", line 28, in = __get__
        Value =3D obj.__dict__[self._function.__name__] =3D se= lf._function(obj)
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py", li= ne 164, in FdfProfile
        Fdf.ParseFile()
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/GenFds/FdfParser.py", line 1312,= =20in ParseFile
        self.Preprocess()
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/uefi/BaseTools/Source/Python/GenFds/FdfParser.py", line 1291,= =20in Preprocess
        self.PreprocessIncludeFile()
      File "/media/ashishsingha/Workspace/UEFI/out/nvidia/boot= loader/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 bel= ow directories:
    <Here =20it lists the root diectories included in the build>.<= /span>
    <Here =20it lists the line and column number of top level fdf file which has in= clude statement for Platform/NVIDIA/XYZ.fdf.inc but under =20a conditional as mentioned above.

    Any help getting around this if you think I am checking for the cond= itional incorrectly or checking the build script for a potential bug woul= d be highly appreciated.

    Thanks
    Ashish




This email message is for the sole use of the intended recipient(s) = and may=20 contain confidential information.  Any unauthorized review, use, dis= closure=20 or distribution is prohibited.  If you are not the intended recipien= t,=20 please contact the sender by reply email and destroy all copies of the or= iginal=20 message.

--_000_BYAPR12MB2726D3CF9D89A277FBF8EDF9BAD40BYAPR12MB2726namp_--