From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp01.apple.com (ma1-aaemail-dr-lapp01.apple.com [17.171.2.60]) by mx.groups.io with SMTP id smtpd.web09.318.1620063117772762910 for ; Mon, 03 May 2021 10:31:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=pf+XF6E3; spf=pass (domain: apple.com, ip: 17.171.2.60, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp01.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp01.apple.com (8.16.0.42/8.16.0.42) with SMTP id 143HDnHn016938; Mon, 3 May 2021 10:15:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=20180706; bh=CRGC+F36oG+yYFsSGsaoJuUzNDEmCr3QsMo37fqdRT4=; b=pf+XF6E3FOwAyMNJZUDmte7E1Bkla1ykYOOIUPARxSPsPNYjW2Ie0c9vVhtB8rtptTea YBDITODpsletpNZhorTIoUdQ+r4hqcgi3xKznlgpQ/EJTjioLdPEOYzsxi8k/6hztiqF Xovd/R7npPvsuXSmQ/JrQzy6yOe7Y9u6y+bG5VtkuGmBMBwdzEakwB8oci86br+FuDW0 EUjQuF4COlAMrammxnOQ9RY3BkdNMz/ageYxJ/ghMywoJMGEhaviFnQ0kzbav6bAxqdR guA4EhOkgB9dQ56HfPMRhYqRKJRwGuUcU6RqUTMc2DikT44K6jI7MYD9DNDWjDdtqL0F WQ== Received: from rn-mailsvcp-mta-lapp04.rno.apple.com (rn-mailsvcp-mta-lapp04.rno.apple.com [10.225.203.152]) by ma1-aaemail-dr-lapp01.apple.com with ESMTP id 3895n34w9h-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 03 May 2021 10:15:17 -0700 Received: from rn-mailsvcp-mmp-lapp02.rno.apple.com (rn-mailsvcp-mmp-lapp02.rno.apple.com [17.179.253.15]) by rn-mailsvcp-mta-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.7.20201203 64bit (built Dec 3 2020)) with ESMTPS id <0QSJ00063JXGYU10@rn-mailsvcp-mta-lapp04.rno.apple.com>; Mon, 03 May 2021 10:15:16 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp02.rno.apple.com by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.7.20201203 64bit (built Dec 3 2020)) id <0QSJ00J00JWNWV00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Mon, 03 May 2021 10:15:16 -0700 (PDT) X-Va-A: X-Va-T-CD: 70a38c3f5b1d46c4b8dccb3b011be358 X-Va-E-CD: 29a08f4927b6ae69562fd34bf6e5452d X-Va-R-CD: e59086912de53814c4459099d505d685 X-Va-CD: 0 X-Va-ID: 5f33ba29-bf77-40eb-92ef-2bd4867f596c X-V-A: X-V-T-CD: 70a38c3f5b1d46c4b8dccb3b011be358 X-V-E-CD: 29a08f4927b6ae69562fd34bf6e5452d X-V-R-CD: e59086912de53814c4459099d505d685 X-V-CD: 0 X-V-ID: caf59937-59ba-44e2-8790-2ae05f0d6371 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-03_13:2021-05-03,2021-05-03 signatures=0 Received: from [17.235.49.175] (unknown [17.235.49.175]) by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.7.20201203 64bit (built Dec 3 2020)) with ESMTPSA id <0QSJ0079NJXFP600@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Mon, 03 May 2021 10:15:16 -0700 (PDT) MIME-version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.1\)) Subject: Re: [edk2-devel] [Patch 1/1] BaseTools: Fix New Target/ToolChain/Arch in DSC [BuildOptions] issues From: "Andrew Fish" In-reply-to: <20210501170241.1185-1-michael.d.kinney@intel.com> Date: Mon, 03 May 2021 10:15:14 -0700 Cc: Bob Feng , Liming Gao , Yuwei Chen , Ray Ni , Steven Shi Message-id: <8BF97385-1C3B-4D5B-A654-F3BBE80533D8@apple.com> References: <20210501170241.1185-1-michael.d.kinney@intel.com> To: edk2-devel-groups-io , Mike Kinney X-Mailer: Apple Mail (2.3654.20.0.2.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-03_13:2021-05-03,2021-05-03 signatures=0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Reviewed-by: Andrew Fish Thanks, Andrew Fish > On May 1, 2021, at 10:02 AM, Michael D Kinney wrote: >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3359 >=20 > * Save/Restore global state in GetToolChainAndFamilyFromDsc() > This resolves an issue where the multi-arch build for > UefiPayloadPkg would skip the autogen and build of IA32 > components. > * Expand tools wildcard. > This resolves the issue where autogen makefile contents > would have a BUIDLRULEFAMILY tools definitions with an > '*' in the tool field that breaks the build from invalid > makefile syntax. > * Build rule family higher priority than Family. > This resolves the issue where flags were appended from > both the BUILDRULEFAMILY and FAMILY when only > BUILDRULEFAMILY should be appended when present. >=20 > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Cc: Ray Ni > Cc: Steven Shi > Signed-off-by: Michael D Kinney > --- > .../Python/AutoGen/ModuleAutoGenHelper.py | 27 +++++++++---------- > .../Source/Python/AutoGen/PlatformAutoGen.py | 27 +++++++++---------- > BaseTools/Source/Python/build/build.py | 2 ++ > 3 files changed, 26 insertions(+), 30 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py b/Ba= seTools/Source/Python/AutoGen/ModuleAutoGenHelper.py > index 167bb59d2315..036fdac3d7df 100644 > --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py > +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py > @@ -181,20 +181,12 @@ class AutoGenInfo(object): > if Family =3D=3D ToolDef[Tool][TAB_TOD_DEFINES_B= UILDRULEFAMILY]: > FamilyMatch =3D True > Found =3D True > - if TAB_TOD_DEFINES_FAMILY in ToolDef[Tool]: > - if Family =3D=3D ToolDef[Tool][TAB_TOD_DEFINES_= FAMILY]: > - FamilyMatch =3D True > - Found =3D True > if TAB_STAR in ToolDef: > FamilyIsNull =3D False > if TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDef[TAB_ST= AR]: > if Family =3D=3D ToolDef[TAB_STAR][TAB_TOD_DEFIN= ES_BUILDRULEFAMILY]: > FamilyMatch =3D True > Found =3D True > - if TAB_TOD_DEFINES_FAMILY in ToolDef[TAB_STAR]: > - if Family =3D=3D ToolDef[TAB_STAR][TAB_TOD_DEFI= NES_FAMILY]: > - FamilyMatch =3D True > - Found =3D True > if not Found: > continue > # expand any wildcard > @@ -640,14 +632,19 @@ class PlatformInfo(AutoGenInfo): > if Attr =3D=3D TAB_TOD_DEFINES_BUILDRULEORDER: > continue > Value =3D Options[Tool][Attr] > - # check if override is indicated > - if Value.startswith('=3D'): > - BuildOptions[Tool][Attr] =3D mws.handleWsMacro(= Value[1:]) > - else: > - if Attr !=3D 'PATH': > - BuildOptions[Tool][Attr] +=3D " " + mws.han= dleWsMacro(Value) > + ToolList =3D [Tool] > + if Tool =3D=3D TAB_STAR: > + ToolList =3D list(AllTools) > + ToolList.remove(TAB_STAR) > + for ExpandedTool in ToolList: > + # check if override is indicated > + if Value.startswith('=3D'): > + BuildOptions[ExpandedTool][Attr] =3D mws.ha= ndleWsMacro(Value[1:]) > else: > - BuildOptions[Tool][Attr] =3D mws.handleWsMa= cro(Value) > + if Attr !=3D 'PATH': > + BuildOptions[ExpandedTool][Attr] +=3D "= " + mws.handleWsMacro(Value) > + else: > + BuildOptions[ExpandedTool][Attr] =3D mw= s.handleWsMacro(Value) >=20 > return BuildOptions, BuildRuleOrder >=20 > diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTo= ols/Source/Python/AutoGen/PlatformAutoGen.py > index 21e72438e59e..832c0da86bb7 100644 > --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > @@ -1391,14 +1391,19 @@ class PlatformAutoGen(AutoGen): > if Attr =3D=3D TAB_TOD_DEFINES_BUILDRULEORDER: > continue > Value =3D Options[Tool][Attr] > - # check if override is indicated > - if Value.startswith('=3D'): > - BuildOptions[Tool][Attr] =3D mws.handleWsMacro(= Value[1:]) > - else: > - if Attr !=3D 'PATH': > - BuildOptions[Tool][Attr] +=3D " " + mws.han= dleWsMacro(Value) > + ToolList =3D [Tool] > + if Tool =3D=3D TAB_STAR: > + ToolList =3D list(AllTools) > + ToolList.remove(TAB_STAR) > + for ExpandedTool in ToolList: > + # check if override is indicated > + if Value.startswith('=3D'): > + BuildOptions[ExpandedTool][Attr] =3D mws.ha= ndleWsMacro(Value[1:]) > else: > - BuildOptions[Tool][Attr] =3D mws.handleWsMa= cro(Value) > + if Attr !=3D 'PATH': > + BuildOptions[ExpandedTool][Attr] +=3D "= " + mws.handleWsMacro(Value) > + else: > + BuildOptions[ExpandedTool][Attr] =3D mw= s.handleWsMacro(Value) >=20 > return BuildOptions, BuildRuleOrder >=20 > @@ -1529,20 +1534,12 @@ class PlatformAutoGen(AutoGen): > if Family =3D=3D ToolDef[Tool][TAB_TOD_DEFINES_B= UILDRULEFAMILY]: > FamilyMatch =3D True > Found =3D True > - if TAB_TOD_DEFINES_FAMILY in ToolDef[Tool]: > - if Family =3D=3D ToolDef[Tool][TAB_TOD_DEFINES_= FAMILY]: > - FamilyMatch =3D True > - Found =3D True > if TAB_STAR in ToolDef: > FamilyIsNull =3D False > if TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDef[TAB_ST= AR]: > if Family =3D=3D ToolDef[TAB_STAR][TAB_TOD_DEFIN= ES_BUILDRULEFAMILY]: > FamilyMatch =3D True > Found =3D True > - if TAB_TOD_DEFINES_FAMILY in ToolDef[TAB_STAR]: > - if Family =3D=3D ToolDef[TAB_STAR][TAB_TOD_DEFI= NES_FAMILY]: > - FamilyMatch =3D True > - Found =3D True > if not Found: > continue >=20 > diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/P= ython/build/build.py > index 0570c29f1ada..e5693c0d27a2 100755 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -897,6 +897,7 @@ class Build(): > # $(TARGET), $(TOOLCHAIN), $(TOOLCHAIN_TAG), or $(ARCH) operands. > # > def GetToolChainAndFamilyFromDsc (self, File): > + SavedGlobalDefines =3D GlobalData.gGlobalDefines.copy() > for BuildTarget in self.BuildTargetList: > GlobalData.gGlobalDefines['TARGET'] =3D BuildTarget > for BuildToolChain in self.ToolChainList: > @@ -929,6 +930,7 @@ class Build(): > self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEF= INES_TOOL_CHAIN_TAG] =3D [] > if ToolChain not in self.ToolDef.ToolsDefTxtData= base[TAB_TOD_DEFINES_TOOL_CHAIN_TAG]: > self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEF= INES_TOOL_CHAIN_TAG].append(ToolChain) > + GlobalData.gGlobalDefines =3D SavedGlobalDefines >=20 > ## Load configuration > # > --=20 > 2.31.1.windows.1 >=20 >=20 >=20 >=20 >=20 >=20