From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=zhijux.fan@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1AF6021C8EFB5 for ; Mon, 14 Jan 2019 21:54:51 -0800 (PST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 21:54:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,480,1539673200"; d="dat'59?scan'59,208,59";a="116817501" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 14 Jan 2019 21:54:50 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 14 Jan 2019 21:54:50 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 14 Jan 2019 21:54:50 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.196]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.44]) with mapi id 14.03.0415.000; Tue, 15 Jan 2019 13:54:47 +0800 From: "Fan, ZhijuX" To: "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Feng, Bob C" Thread-Topic: [edk2][PATCH] BaseTools:Build fail when PCD use in the [DEPEX] section of INF files Thread-Index: AdSslq01rvgTLb28Tii68pZAitgW2A== Date: Tue, 15 Jan 2019 05:54:47 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [PATCH] BaseTools:Build fail when PCD use in the [DEPEX] section of INF 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, 15 Jan 2019 05:54:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable https://vthsd.intel.com/hsd/tiano/tracker/default.aspx?tracker_id=3D223983 1. Define one fixedatbuild PCD in dec: [PcdsFixedAtBuild] gUefiOvmfPkgTokenSpaceGuid.test1| {0x01, 0x02}|VOID*|0x3c 2. Define this PCD point to a depex GUID in dsc: MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf { NULL|OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf gUefiOvmfPkgTokenSpaceGuid.test1| gEfiSmbiosProtocolGuid } 3. Define this PCD under [Depex] and [pcd] section in above lib file: [Pcd] gUefiOvmfPkgTokenSpaceGuid.test1 [Depex] gUefiOvmfPkgTokenSpaceGuid.test1 Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/AutoGen/AutoGen.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index cfe2d29099..b3dda1adeb 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2779,11 +2779,21 @@ class ModuleAutoGen(AutoGen): if '.' not in item: NewList.append(item) else: - if item not in self._FixedPcdVoidTypeDict: + if item not in self.FixedVoidTypePcds.keys(): EdkLogger.error("build", FORMAT_INVALID, "{} u= sed in [Depex] section should be used as FixedAtBuild type and VOID* datum = type in the module.".format(item)) else: - Value =3D self._FixedPcdVoidTypeDict[item] - if len(Value.split(',')) !=3D 16: + Value =3D self.FixedVoidTypePcds[item] + if Value.startswith('"') and Value.endswith('"= '): + GuidValue =3D Value[1:-1] + GuidList =3D self.GuidList + GuidList.update(self.PpiList) + GuidList.update(self.ProtocolList) + try: + Value =3D GuidList[GuidValue] + except: + EdkLogger.error("build", FORMAT_INVALI= D, + "{} used in [Depex] se= ction should be used as FixedAtBuild type and VOID* datum type and 16 bytes= in the module.".format(item)) + elif len(Value.split(',')) !=3D 16: EdkLogger.error("build", FORMAT_INVALID, "{} used in [Depex] sectio= n should be used as FixedAtBuild type and VOID* datum type and 16 bytes in = the module.".format(item)) NewList.append(Value) --=20 2.14.1.windows.1