From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web08.8301.1619069401742062473 for ; Wed, 21 Apr 2021 22:30:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=alrdNBEv; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: bob.c.feng@intel.com) IronPort-SDR: FGLVi3v2i8xhUexJEvG70WI/9OYMcN7dVAmztIo0yc4DYV+Fvi7M+zn9ohXt61sEgpYFNeTw3A 9PcBCGIWfoYA== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="281158473" X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="281158473" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 22:30:00 -0700 IronPort-SDR: wq9Ft0325fMvh5fJLW5GaDQKkei5y1Jy1B1L7Z041vKGzZYp9mlHiVIvLLcGfQg0Y8ZwrB3umh 06JUjbUNWFIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="427788191" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 21 Apr 2021 22:30:00 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 21 Apr 2021 22:29:59 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 21 Apr 2021 22:29:59 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 21 Apr 2021 22:29:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLYEdC4AHYA/pxGiDQX/5B5hB3LSFggbJf0ZoM8mJgXor6iPUM6savolL8Rf5hoOSBVOYhswFh0LDXEG9BZ2ctBtGP4656tC+usul2+EsNH7sBBDNTAMd9L+vNcAfonm7XrreFMMabe52wUdNd2dfZrLF8HawAGR8t78r0qfoy60ioO6TPUDeoqX7lR//xAWR8+lYK23/YoeepvE7hEvKQzxAc81DEPCjybwG5qnGWMZLMMuE6aTwbcw/C/20S4MZWb2O7VrRFzq3qgHll8H9mo7eRMubYoyxWp8bZjKlsWBlJVeqtbA9DnrGOlgUBM/Q5NfbM/R7XD2zcP99HfN2w== 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=JGQrHoAnqdaOAvxHRzOfZu+hfUwXsh4+FMTDz0/Wf4U=; b=aiNaJuTRJrI23TISqD68pvQOt2t7S8XtkVPef47FqOaXzOoxUuDbrbcvqaFofRYNku02Fpt1Q+kV+hkgrZjvSdOfnDnO3Iaar9pJTlvNBxB6I1A1qQGRWuqmlA10Z7yIc20ZrY8HUKKBLF/o5EQFSrQMWvdvKv+JDd+f55E6dD5ViXoPRB/q2Ci25Cqyva0a11+7ROeLUAp7B9DI2IIGYFbxmU57v8eQNqLrFsP2b0G5K+DcZESId+DuBVLMaa12/XADAvJf8SdxwNCJ+v176of/HgVSXSnnHnOGgFDx9/MPdLWLAT2O9BIjSLeYitQiL1KKU7MWb12xw8SxQNKzKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JGQrHoAnqdaOAvxHRzOfZu+hfUwXsh4+FMTDz0/Wf4U=; b=alrdNBEvNo5A6MHIf7BAG+2bvJi12turusUV8M1wEBfHIshlFu9CpwP1pKeQ2xsqBWFmM3yUgnSxc/qIBnVgzTAKOSSLW8aIlKc+38rRE/ydEN8kL/HOvSWpZJOXTQIUWyaSyPwqWOX0TTv13iSFm/Bb82Ro7D+leK3AmXgh+qg= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB4297.namprd11.prod.outlook.com (2603:10b6:5:14e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.21; Thu, 22 Apr 2021 05:29:56 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::cc64:a87c:5cf:5f18]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::cc64:a87c:5cf:5f18%3]) with mapi id 15.20.4065.022; Thu, 22 Apr 2021 05:29:56 +0000 From: "Bob Feng" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Liming Gao , "Chen, Christine" Subject: Re: [Patch 1/1] BaseTools/Source/Python: Verify TAB_TOD_DEFINES_FAMILY key present Thread-Topic: [Patch 1/1] BaseTools/Source/Python: Verify TAB_TOD_DEFINES_FAMILY key present Thread-Index: AQHXNgy6lytRtZPQmUCsuvLcLCjA46rABMSA Date: Thu, 22 Apr 2021 05:29:56 +0000 Message-ID: References: <20210420174340.721-1-michael.d.kinney@intel.com> In-Reply-To: <20210420174340.721-1-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9321aed2-6c4a-4603-79ea-08d9054faa2e x-ms-traffictypediagnostic: DM6PR11MB4297: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2733; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Bg2oPrTyv70jwlKI2j1pzkYU7Sft7tx+ELIAPbgFQ7zP5cWqNmXhk86sas7qoDqDHqRLvtITrRREgqkV/COkdFcN2dOdo2LzgxPviQ1e2wx3YRQobCI0YZX0UtkOawv8BMFg4Uw1A2GU3ExHvvVFDFroI5LwXGgcbHBKEM9uEJl4dkwzxCpE3UuC9U2xHIdvpoCRo078S2KG6GH/MYYl7z7o/C1SoFLDMXsfauP3jlKhj4BOpZvV189AlVEAFWSGxKCnYvpM/Z/T4wlzj/TWfcearAgNNdlMDAfQsN4FxORxQ/nZC9fnqDKRaeEgnujI5/kFpw62Ji30lGZ88bOq6TTDyElFPDlXCnCnH0lJVCnA9st2NfF+bzns1JUeR/9MiRBcC7vZaJ1za1ij9jdF5qEyl3pYmll9TDLfiBvwkObeaG2Hf7L+qdRNgZhZyDBkwpUNH76qE/omqxpM5+dLCMrA3f+kbcScxDUn1iDlLVck/WRhOW3w6LNA6E1kQSn/zeXza5h9N5/uwnXVmwZduWeIfyh/YZEOdQTutIOlbvS5cfLVbI4CN17KQTlyMPt3kVksEbWe1VMh09NQd5KjdxgQQGvCSoqi6vLgDQBKc/V6qhvpvvdqlNttvCUkSwiLMEAqyhhGJDPy7QSpp5fO+OK0H2aPT3ESpkebGz1PmlcoLfrwrReoSuB4sRiW0AfM x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(396003)(366004)(136003)(376002)(39860400002)(76116006)(316002)(8936002)(15650500001)(86362001)(9686003)(26005)(4326008)(186003)(107886003)(33656002)(8676002)(53546011)(66556008)(5660300002)(64756008)(66476007)(55016002)(122000001)(110136005)(7696005)(2906002)(54906003)(966005)(71200400001)(478600001)(66946007)(83380400001)(38100700002)(6506007)(52536014)(66446008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Cx0BobQkTwZYGc6nDgp3iDkIdtWX66lHeeblCKJxDXerKBPNCuB5F3UJroRs?= =?us-ascii?Q?dgtXGWY7IGLCaxrwlIDI/f0Tf7yuNDGcVjcfs09ZypZi6jK3ib/1McWM2cGq?= =?us-ascii?Q?zDXkOrC+NOBz0AURJJ4fZvAIQn8urNeO+TgyaYOUbapPiJC5ZopnWCMDeBpr?= =?us-ascii?Q?o2ipuecOhHC30JmpkYNAcobY0IHxp3iY6fV16YqJbgf1LLBh+ijvCVaQOV3x?= =?us-ascii?Q?mOafBru2J4SAHHJQWXnPzCkzKWMbseEADCwQ444aF4BI64IFpSPMswukoWdH?= =?us-ascii?Q?DvS0/gi6ffXjxt7F569WbN/6OMe6vyGdu7IbvZq0z7UIuIE7gGgIm7Ufq+4C?= =?us-ascii?Q?DG5kFzLlpTfUG4pszYdPS9otbzWSLQEx2zieUNUFBQfr7SCi5ITHOXwm5Hxa?= =?us-ascii?Q?Gr8MnjnwTgbyZbk+QiMb9P984jTlS+sghsrX5wLAoF7ypXheTbkvB1xRMGYW?= =?us-ascii?Q?7tXqxfu++HqgqzBkn5gXdd9yqot0hutOE7H61P3oI9NSZcgoJUN60XlMgDP6?= =?us-ascii?Q?2L7WJ6RtKrldy5ggA5oCRdh1ENrQVMUItAsxHsKryzuxQ+rRoMF0VnqX8t2S?= =?us-ascii?Q?sQH1EtBkcKy01ty5duCBNz/QJBwX+o+ahgizh+NOI6GTRFgs3ZZkSIxEp7Il?= =?us-ascii?Q?htrqVA+pqSq79c5Ol+iaA7Q5pJ6t6KGie5GBLYfgD7ZLD/dgrnaNke0Ne0Hf?= =?us-ascii?Q?Cci7KXExI/jYg2bvxc0xMkB4XHdASHqASGulcAWiw79tHLClV2qKfbW1jT91?= =?us-ascii?Q?KB+qJ0bQILqySH6ipHvx6FKt/axW5rJd0a8PA9sqS1otA2wHPIRE21wEGwdo?= =?us-ascii?Q?+lsEl36j9nu7j6kMhbVwYgCY8d34HcV7blNTp2u5my3zkls4GVmeTZSYrHsA?= =?us-ascii?Q?sQ0tj/3Gy1zzC3BjR7/0zjCh2TnmQ90d53y1kQMf9zvmLwxtXGcw7gAjWzYU?= =?us-ascii?Q?bxVHFUl5VttaInEOHD+8jo9WV4XGF0Zb+eH1ju5gEV7Uc/EkVRphvwH4hZSz?= =?us-ascii?Q?4LYbSjgOPh7wxRU+ZBKS74R8rDlkegfG9REJtq3VjnESj5JWVxQYeWjbKem1?= =?us-ascii?Q?kehdA9b6NRsCtR8HvZC+Usl6PNDN97utGQkT7A58D3FM2tUgXzp9uXjA6IoW?= =?us-ascii?Q?OAnJavI4Xro5RK8M0nB6iQo1qnf0apCH1Oextp7ObS3YPaD3dw8iF0M/tmrF?= =?us-ascii?Q?0esDor55QqSeqZEukLw23qQPA6ZhiHpn9IduEJNej0uNstENmizswJJPqr9I?= =?us-ascii?Q?7JLJX/xD3sb3NW/pvaqLlgMbOvfcBjmBO/Xn7whhWbd3IFeOgR/844xaOySx?= =?us-ascii?Q?4D4=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9321aed2-6c4a-4603-79ea-08d9054faa2e X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2021 05:29:56.3784 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Y7oL5oXBlOOObbeeJ3jXVh8Yja3zxrYm1H28E3R/vMSdb/7mdJgPGY3PNMILOnpsSjmDsbR7LRdjpfqC2c3uNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4297 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is good to me. Reviewed-by: Bob Feng -----Original Message----- From: Kinney, Michael D =20 Sent: Wednesday, April 21, 2021 1:44 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao ; Chen, Christine Subject: [Patch 1/1] BaseTools/Source/Python: Verify TAB_TOD_DEFINES_FAMILY= key present REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3344 Veify that TAB_TOD_DEFINES_FAMILY key is present in ToolDef dictionary befo= re access. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Michael D Kinney --- .../Source/Python/AutoGen/ModuleAutoGenHelper.py | 11 ++++++++--- BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py b/BaseT= ools/Source/Python/AutoGen/ModuleAutoGenHelper.py index 8e60643d1fd9..7477b1d77fb8 100644 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py @@ -1,7 +1,7 @@ ## @file # Create makefile for MS nmake and GNU make # -# Copyright (c) 2019, Inte= l Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights=20 +reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import = absolute_import @@ -178,8 +178,11 @@ class AutoGenInfo(object): if ToolDef[Tool].get(TAB_TOD_DEFINES_BUILDRULEFAMILY, "") = !=3D "": if Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_BUILDRULE= FAMILY]: continue - elif Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]: - continue + else: + if ToolDef[Tool].get(TAB_TOD_DEFINES_FAMILY, "") =3D= =3D "": + continue + if Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]: + continue FamilyMatch =3D True # expand any wildcard if Target =3D=3D TAB_STAR or Target =3D=3D self.BuildTarget: @@ -213,6 +216,8 @@ class AutoGenInfo(object): if Tool not in ToolDef or Family =3D=3D "": continue # option has been added before + if TAB_TOD_DEFINES_FAMILY not in ToolDef[Tool]: + continue if Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]: continue =20 diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools= /Source/Python/AutoGen/PlatformAutoGen.py index c16f2e4cd8b7..e2ef3256773e 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -1474,8 +1474,11 @@ class PlatformAutoGen(AutoGen): if ToolDef[Tool].get(TAB_TOD_DEFINES_BUILDRULEFAMILY, "") = !=3D "": if Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_BUILDRULE= FAMILY]: continue - elif Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]: - continue + else: + if ToolDef[Tool].get(TAB_TOD_DEFINES_FAMILY, "") =3D= =3D "": + continue + if Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]: + continue FamilyMatch =3D True # expand any wildcard if Target =3D=3D TAB_STAR or Target =3D=3D self.BuildTarget: @@ -1509,6 +1512,8 @@ class PlatformAutoGen(AutoGen): if Tool not in ToolDef or Family =3D=3D "": continue # option has been added before + if TAB_TOD_DEFINES_FAMILY not in ToolDef[Tool]: + continue if Family !=3D ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]: continue =20 -- 2.31.1.windows.1