From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.136]) by mx.groups.io with SMTP id smtpd.web11.718.1586295117271418647 for ; Tue, 07 Apr 2020 14:31:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=Y+ajZG6W; spf=pass (domain: microsoft.com, ip: 40.107.236.136, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zr5crG5AKfAsAaZ9i1OSMQnp8a2Mc/yNtI02sfKxipp66FCZSShvbZ+nEFBTaKpb6nmSpE4/8wemgshat+EPkLIb03ZXztudHtey06Qf9a1Lx+WYzKgvTRg4NhNkjt+rIeLrRp1e4fX8Pip2Gd/PAPYfsznn7viJgV+bynjgppSh5jfPeZag7NkJiGJLISqPLr/Ebuz4YYc6TjCpk4sYfS3assRl1lqVH9iW6nVNpajblSfLcTYoXHWWPPs71p8J11csCbCc1J9n5DDLoj4ROI6/V7xWeTJgjQj9g/ungMOG4u1bV+tZkCpMgZm6U4ajip8fYNiWAAkL/dgQ7i3pLQ== 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=wY+TzqcJJ/0GQOVAwqYkAkisibyM58c2e5VBR09Dc+0=; b=R4JuZojXADFopKm9mvx6mfcUzr8agkwPhmXchgXmD/mWDyVXSHPuZm+70bxgZp7YDZS5m8BKEqvzl0PHp2+DTgysU0jppCqiFPBJLqb69FIZE9QSFVTq39isgX/Hh10l2PjRwBnXs/YLQTQO+u2z2NgAAd7PDfu4gdQ1HrWJmMvNdEwUQWd9/9tXauqBn7TD1Pd5v1dWE9SPGPDs/5xXvfUKzGzj0yBLAKs65txU38PbkJWvkdM9wM0dQRdl0UcZKxlwmpu2xRUPwrjGMN8bwtubHuv6Dj22R0uJMFYYMywY+vlWMmustDwx6j3MSveEybtRkCqcARvYynaRPmajQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wY+TzqcJJ/0GQOVAwqYkAkisibyM58c2e5VBR09Dc+0=; b=Y+ajZG6W4uMCeuSfiU1iCE+Jz2xWNUbl8R6S4SrQfiLO/7xF/z0Qt4cypePa/KLdYTML/TQ+9xHqDR4WA9IZ3/hV3roELEiBXMjCaXwQoVxVUYp2JeE09l7igjVGZR+k/xwNFrF+QbWKSSEQU3FPP+1eh2X5u2vk9Y+ckbfZauY= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0694.namprd21.prod.outlook.com (2603:10b6:903:13b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.2; Tue, 7 Apr 2020 21:31:55 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%12]) with mapi id 15.20.2921.000; Tue, 7 Apr 2020 21:31:55 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "shenglei.zhang@intel.com" CC: Bob Feng , Liming Gao Subject: Re: [EXTERNAL] [edk2-devel] [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin Thread-Index: AQHWDKhzv5Kf2xjEUEu8OoUuWA5wEqhuLpQj Date: Tue, 7 Apr 2020 21:31:55 +0000 Message-ID: References: <20200407064737.8172-1-shenglei.zhang@intel.com>,<20200407064737.8172-3-shenglei.zhang@intel.com> In-Reply-To: <20200407064737.8172-3-shenglei.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-04-07T21:31:49.8006351Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ed8b1256-6f7c-424d-5aaf-08d7db3b184f x-ms-traffictypediagnostic: CY4PR21MB0694: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 036614DD9C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(6029001)(4636009)(396003)(136003)(39860400002)(346002)(366004)(376002)(71200400001)(55016002)(15650500001)(82960400001)(2906002)(9686003)(186003)(8990500004)(82950400001)(4326008)(26005)(7696005)(53546011)(33656002)(6506007)(478600001)(110136005)(316002)(66946007)(54906003)(76116006)(66476007)(66446008)(8936002)(52536014)(64756008)(966005)(5660300002)(66556008)(81166006)(86362001)(10290500003)(81156014)(8676002);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XlVp+CQckTc1oBcqAN2CkeqCX36j4kqvY60V4AsITNvsigLg3e4hTw3IYrYbxLdIMvCdkQ8xtv4M4TEKC8n9DHYFzDd5sTBxPYiGdDyNQI3UJCVXt1ZOi7/LcvjkcpEZ4FMsjl6IIz2yWoKN4bSvPqdL2LTEXJ988KLZKCRfepAyPUx3w257VCNWi9wUNLn7BidzJLBd0Nuue3SDjNSnEa/9uCRHcUpHLW622ZYMfQkPf2ao16d8CMp5f0lhBW9mjNL8JpiXq9hXAHACV6XlO9Q3xhfDf1wmWTFGZx1ldWSNUWeE7mW7Tm3I2dsfHK10J2ik9S8N73Sf0QN1dhQpaPjUvpcIR5FI7hc4uAVnpAJb8yCUkJqc4+3NLo3+FuPW6JFba5cItbTMppPqB2aP7WQhtjm2yy5dnxfDHPMrr/xGLEihB7AVsGumGTrz3290zvkigGSOzRfYi4KqUW7SeSuhev2kQOaO0l8wzp39A4eIxPdQ4d/U0yrJUzTNwnY3ji9DgMQ+d9UNnLxel13drg== x-ms-exchange-antispam-messagedata: H2XpFSuWsTx4naw64+M9wVbEe9hQytX+AeJkd81t6JOHwLwu3CAPBidygcTpxWNVGo86wWYMM1SkGJTMjsvwj7i7dljoxzUPb36JklDRPK77LtwWoSKpeCUaPlSVZYzkPhZ+WzbBytfZw8RiTuUdsw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed8b1256-6f7c-424d-5aaf-08d7db3b184f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2020 21:31:55.2762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4JE4O2JAgyC/smGWxbx1i97WbVjPcnzAxujuIC8itbxSc4pab1XZZMW3RJcj8EdbP+tLCTDc/vjX7hdDPxXQSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0694 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0743A8E9D41E571C463C3550EFC30CY4PR21MB0743namp_" --_000_CY4PR21MB0743A8E9D41E571C463C3550EFC30CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: devel@edk2.groups.io on behalf of Zhang, Shen= glei via groups.io Sent: Monday, April 6, 2020 11:47:37 PM To: devel@edk2.groups.io Cc: Bob Feng ; Liming Gao Subject: [EXTERNAL] [edk2-devel] [PATCH] BaseTools/WindowsVsToolChain.py: = Update toolchain plugin REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fb= ugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2659&data=3D02%7C01%7CBret.= Barkelew%40microsoft.com%7Cb69f6a990b644ab252d708d7dabf94d6%7C72f988bf86f14= 1af91ab2d7cd011db47%7C1%7C0%7C637218388681928753&sdata=3DnCRoJjRWBWaeRB= kCUsWV7TFwdKGR7770Cq4qFiBkA5U%3D&reserved=3D0 Allow WindowsVsToolChain Plugin to add libraries and headers of user defined ARCH for VS2017 and VS2019. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../WindowsVsToolChain/WindowsVsToolChain.py | 73 ++++++++++++++++--- 1 file changed, 62 insertions(+), 11 deletions(-) diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/B= aseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py index c9279e1c75b5..0fba2c1b5325 100644 --- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py +++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py @@ -13,6 +13,7 @@ import edk2toollib.windows.locate_tools as locate_tools from edk2toollib.windows.locate_tools import FindWithVsWhere from edk2toolext.environment import shell_environment from edk2toolext.environment import version_aggregator +from edk2toollib.utility_functions import GetHostInfo class WindowsVsToolChain(IUefiBuildPlugin): @@ -26,14 +27,41 @@ class WindowsVsToolChain(IUefiBuildPlugin): "UCRTVersion", "WindowsLibPath", "WindowsSdkB= inPath", "WindowsSdkDir", "WindowsSdkVerBinPath", "WindowsSDKVersion", "VCToolsInstallDir", "Pa= th"] -# + # # VS2017 - Follow VS2017 where there is potential for many versio= ns of the tools. # If a specific version is required then the user must set both e= nv variables: # VS150INSTALLPATH: base install path on system to VC install di= r. Here you will find the VC folder, etc # VS150TOOLVER: version number for the VC compiler tools # VS2017_PREFIX: path to MSVC compiler folder with trailing s= lash (can be used instead of two vars above) + # VS2017_HOST: set the host architecture to use for host to= ols, and host libs, etc if thebuilder.env.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2017": + # check to see if host is configured + # HostType for VS2017 should be (defined in tools_def): + # x86 =3D=3D 32bit Intel + # x64 =3D=3D 64bit Intel + # arm =3D=3D 32bit Arm + # arm64 =3D=3D 64bit Arm + # + HostType =3D shell_environment.GetEnvironment().get_shell_var= ("VS2017_HOST") + if HostType is not None: + HostType =3D HostType.lower() + self.Logger.info( + f"HOST TYPE defined by environment. Host Type is {Ho= stType}") + else: + HostInfo =3D GetHostInfo() + if HostInfo.arch =3D=3D "x86": + if HostInfo.bit =3D=3D "32": + HostType =3D "x86" + elif HostInfo.bit =3D=3D "64": + HostType =3D "x64" + else: + raise NotImplementedError() + + # VS2017_HOST options are not exactly the same as QueryVcVari= ables. This translates. + VC_HOST_ARCH_TRANSLATOR =3D { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "ar= m64": "not supported"} + # check to see if full path already configured if shell_environment.GetEnvironment().get_shell_var("VS2017_P= REFIX") !=3D None: self.Logger.info("VS2017_PREFIX is already set.") @@ -58,16 +86,14 @@ class WindowsVsToolChain(IUefiBuildPlugin): "Tools", "MSVC", vc_ver) prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_= PREFIX", prefix) + shell_environment.GetEnvironment().set_shell_var("VS2017_= HOST", HostType) shell_env =3D shell_environment.GetEnvironment() # Use the tools lib to determine the correct values for t= he vars that interest us. vs_vars =3D locate_tools.QueryVcVariables( - interesting_keys, "amd64", vs_version=3D"vs2017") + interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], = vs_version=3D"vs2017") for (k, v) in vs_vars.items(): - if k.upper() =3D=3D "PATH": - shell_env.insert_path(v) - else: - shell_env.set_shell_var(k, v) + shell_env.set_shell_var(k, v) # now confirm it exists if not os.path.exists(shell_environment.GetEnvironment().get_= shell_var("VS2017_PREFIX")): @@ -80,8 +106,35 @@ class WindowsVsToolChain(IUefiBuildPlugin): # VS160INSTALLPATH: base install path on system to VC install di= r. Here you will find the VC folder, etc # VS160TOOLVER: version number for the VC compiler tools # VS2019_PREFIX: path to MSVC compiler folder with trailing s= lash (can be used instead of two vars above) + # VS2017_HOST: set the host architecture to use for host to= ols, and host libs, etc elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2019": + # check to see if host is configured + # HostType for VS2019 should be (defined in tools_def): + # x86 =3D=3D 32bit Intel + # x64 =3D=3D 64bit Intel + # arm =3D=3D 32bit Arm + # arm64 =3D=3D 64bit Arm + # + HostType =3D shell_environment.GetEnvironment().get_shell_var= ("VS2019_HOST") + if HostType is not None: + HostType =3D HostType.lower() + self.Logger.info( + f"HOST TYPE defined by environment. Host Type is {Ho= stType}") + else: + HostInfo =3D GetHostInfo() + if HostInfo.arch =3D=3D "x86": + if HostInfo.bit =3D=3D "32": + HostType =3D "x86" + elif HostInfo.bit =3D=3D "64": + HostType =3D "x64" + else: + raise NotImplementedError() + + # VS2019_HOST options are not exactly the same as QueryVcVari= ables. This translates. + VC_HOST_ARCH_TRANSLATOR =3D { + "x86": "x86", "x64": "AMD64", "arm": "not supported", "ar= m64": "not supported"} + # check to see if full path already configured if shell_environment.GetEnvironment().get_shell_var("VS2019_P= REFIX") !=3D None: self.Logger.info("VS2019_PREFIX is already set.") @@ -106,16 +159,14 @@ class WindowsVsToolChain(IUefiBuildPlugin): "Tools", "MSVC", vc_ver) prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_= PREFIX", prefix) + shell_environment.GetEnvironment().set_shell_var("VS2019_= HOST", HostType) shell_env =3D shell_environment.GetEnvironment() # Use the tools lib to determine the correct values for t= he vars that interest us. vs_vars =3D locate_tools.QueryVcVariables( - interesting_keys, "amd64", vs_version=3D"vs2019") + interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], = vs_version=3D"vs2019") for (k, v) in vs_vars.items(): - if k.upper() =3D=3D "PATH": - shell_env.insert_path(v) - else: - shell_env.set_shell_var(k, v) + shell_env.set_shell_var(k, v) # now confirm it exists if not os.path.exists(shell_environment.GetEnvironment().get_= shell_var("VS2019_PREFIX")): -- 2.18.0.windows.1 --_000_CY4PR21MB0743A8E9D41E571C463C3550EFC30CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micros= oft.com>

 

- Bret

 


From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Zhang, Shenglei via groups.io &l= t;shenglei.zhang=3Dintel.com@groups.io>
Sent: Monday, April 6, 2020 11:47:37 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Bob Feng <bob.c.feng@intel.com>; Liming Gao <liming.ga= o@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH] BaseTools/WindowsVsToolCha= in.py: Update toolchain plugin
 
REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzil= la.tianocore.org%2Fshow_bug.cgi%3Fid%3D2659&amp;data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7Cb69f6a990b644ab252d708d7dabf94d6%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637218388681928753&amp;sdata=3DnCRoJjRWBWa= eRBkCUsWV7TFwdKGR7770Cq4qFiBkA5U%3D&amp;reserved=3D0
Allow WindowsVsToolChain Plugin to add libraries and headers
of user defined ARCH for VS2017 and VS2019.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 .../WindowsVsToolChain/WindowsVsToolChain.py  | 73 ++&#= 43;+++++++++++++---
 1 file changed, 62 insertions(+), 11 deletions(-)

diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/B= aseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
index c9279e1c75b5..0fba2c1b5325 100644
--- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
+++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.p= y
@@ -13,6 +13,7 @@ import edk2toollib.windows.locate_tools as locate_to= ols
 from edk2toollib.windows.locate_tools import FindWithVsWhere
 from edk2toolext.environment import shell_environment
 from edk2toolext.environment import version_aggregator
+from edk2toollib.utility_functions import GetHostInfo
 
 
 class WindowsVsToolChain(IUefiBuildPlugin):
@@ -26,14 +27,41 @@ class WindowsVsToolChain(IUefiBuildPlugin):
            &n= bsp;            = ;    "UCRTVersion", "WindowsLibPath", &q= uot;WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVer= BinPath",
            &n= bsp;            = ;    "WindowsSDKVersion", "VCToolsInstallDir&= quot;, "Path"]
 
-#
+        #
         # VS2017 - Follow VS2017 = where there is potential for many versions of the tools.
         # If a specific version i= s required then the user must set both env variables:
         # VS150INSTALLPATH: = base install path on system to VC install dir.  Here you will find th= e VC folder, etc
         # VS150TOOLVER: &nbs= p;    version number for the VC compiler tools
         # VS2017_PREFIX: &nb= sp;   path to MSVC compiler folder with trailing slash (can be us= ed instead of two vars above)
+        # VS2017_HOST:  =      set the host architecture to use for host tools, a= nd host libs, etc
         if thebuilder.env.GetValu= e("TOOL_CHAIN_TAG") =3D=3D "VS2017":
 
+            # = check to see if host is configured
+            # = HostType for VS2017 should be (defined in tools_def):
+            # = x86   =3D=3D 32bit Intel
+            # = x64   =3D=3D 64bit Intel
+            # = arm   =3D=3D 32bit Arm
+            # = arm64 =3D=3D 64bit Arm
+            #<= br> +            Ho= stType =3D shell_environment.GetEnvironment().get_shell_var("VS2017_HO= ST")
+            if= HostType is not None:
+           &nb= sp;    HostType =3D HostType.lower()
+           &nb= sp;    self.Logger.info(
+           &nb= sp;        f"HOST TYPE defined by e= nvironment.  Host Type is {HostType}")
+            el= se:
+           &nb= sp;    HostInfo =3D GetHostInfo()
+           &nb= sp;    if HostInfo.arch =3D=3D "x86":
+           &nb= sp;        if HostInfo.bit =3D=3D "= 32":
+           &nb= sp;            HostT= ype =3D "x86"
+           &nb= sp;        elif HostInfo.bit =3D=3D &quo= t;64":
+           &nb= sp;            HostT= ype =3D "x64"
+           &nb= sp;    else:
+           &nb= sp;        raise NotImplementedError() +
+            # = VS2017_HOST options are not exactly the same as QueryVcVariables. This tran= slates.
+            VC= _HOST_ARCH_TRANSLATOR =3D {
+           &nb= sp;    "x86": "x86", "x64": &q= uot;AMD64", "arm": "not supported", "arm64&qu= ot;: "not supported"}
+
             #= check to see if full path already configured
             i= f shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX"= ;) !=3D None:
            &n= bsp;    self.Logger.info("VS2017_PREFIX is already set.= ")
@@ -58,16 +86,14 @@ class WindowsVsToolChain(IUefiBuildPlugin):
            &n= bsp;            = ;            &n= bsp; "Tools", "MSVC", vc_ver)
            &n= bsp;    prefix =3D prefix + os.path.sep
            &n= bsp;    shell_environment.GetEnvironment().set_shell_var(&qu= ot;VS2017_PREFIX", prefix)
+           &nb= sp;    shell_environment.GetEnvironment().set_shell_var(&quo= t;VS2017_HOST", HostType)
 
            &n= bsp;    shell_env =3D shell_environment.GetEnvironment()
            &n= bsp;    # Use the tools lib to determine the correct values = for the vars that interest us.
            &n= bsp;    vs_vars =3D locate_tools.QueryVcVariables(
-            &= nbsp;       interesting_keys, "amd64&quo= t;, vs_version=3D"vs2017")
+           &nb= sp;        interesting_keys, VC_HOST_ARC= H_TRANSLATOR[HostType], vs_version=3D"vs2017")
            &n= bsp;    for (k, v) in vs_vars.items():
-            &= nbsp;       if k.upper() =3D=3D "PATH&qu= ot;:
-            &= nbsp;           shell_env= .insert_path(v)
-            &= nbsp;       else:
-            &= nbsp;           shell_env= .set_shell_var(k, v)
+           &nb= sp;        shell_env.set_shell_var(k, v)=
 
             #= now confirm it exists
             i= f not os.path.exists(shell_environment.GetEnvironment().get_shell_var("= ;VS2017_PREFIX")):
@@ -80,8 +106,35 @@ class WindowsVsToolChain(IUefiBuildPlugin):
         # VS160INSTALLPATH: = base install path on system to VC install dir.  Here you will find th= e VC folder, etc
         # VS160TOOLVER: &nbs= p;    version number for the VC compiler tools
         # VS2019_PREFIX: &nb= sp;   path to MSVC compiler folder with trailing slash (can be us= ed instead of two vars above)
+        # VS2017_HOST:  =      set the host architecture to use for host tools, a= nd host libs, etc
         elif thebuilder.env.GetVa= lue("TOOL_CHAIN_TAG") =3D=3D "VS2019":
 
+            # = check to see if host is configured
+            # = HostType for VS2019 should be (defined in tools_def):
+            # = x86   =3D=3D 32bit Intel
+            # = x64   =3D=3D 64bit Intel
+            # = arm   =3D=3D 32bit Arm
+            # = arm64 =3D=3D 64bit Arm
+            #<= br> +            Ho= stType =3D shell_environment.GetEnvironment().get_shell_var("VS2019_HO= ST")
+            if= HostType is not None:
+           &nb= sp;    HostType =3D HostType.lower()
+           &nb= sp;    self.Logger.info(
+           &nb= sp;        f"HOST TYPE defined by e= nvironment.  Host Type is {HostType}")
+            el= se:
+           &nb= sp;    HostInfo =3D GetHostInfo()
+           &nb= sp;    if HostInfo.arch =3D=3D "x86":
+           &nb= sp;        if HostInfo.bit =3D=3D "= 32":
+           &nb= sp;            HostT= ype =3D "x86"
+           &nb= sp;        elif HostInfo.bit =3D=3D &quo= t;64":
+           &nb= sp;            HostT= ype =3D "x64"
+           &nb= sp;    else:
+           &nb= sp;        raise NotImplementedError() +
+            # = VS2019_HOST options are not exactly the same as QueryVcVariables. This tran= slates.
+            VC= _HOST_ARCH_TRANSLATOR =3D {
+           &nb= sp;    "x86": "x86", "x64": &q= uot;AMD64", "arm": "not supported", "arm64&qu= ot;: "not supported"}
+
             #= check to see if full path already configured
             i= f shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX"= ;) !=3D None:
            &n= bsp;    self.Logger.info("VS2019_PREFIX is already set.= ")
@@ -106,16 +159,14 @@ class WindowsVsToolChain(IUefiBuildPlugin):
            &n= bsp;            = ;            &n= bsp; "Tools", "MSVC", vc_ver)
            &n= bsp;    prefix =3D prefix + os.path.sep
            &n= bsp;    shell_environment.GetEnvironment().set_shell_var(&qu= ot;VS2019_PREFIX", prefix)
+           &nb= sp;    shell_environment.GetEnvironment().set_shell_var(&quo= t;VS2019_HOST", HostType)
 
            &n= bsp;    shell_env =3D shell_environment.GetEnvironment()
            &n= bsp;    # Use the tools lib to determine the correct values = for the vars that interest us.
            &n= bsp;    vs_vars =3D locate_tools.QueryVcVariables(
-            &= nbsp;       interesting_keys, "amd64&quo= t;, vs_version=3D"vs2019")
+           &nb= sp;        interesting_keys, VC_HOST_ARC= H_TRANSLATOR[HostType], vs_version=3D"vs2019")
            &n= bsp;    for (k, v) in vs_vars.items():
-            &= nbsp;       if k.upper() =3D=3D "PATH&qu= ot;:
-            &= nbsp;           shell_env= .insert_path(v)
-            &= nbsp;       else:
-            &= nbsp;           shell_env= .set_shell_var(k, v)
+           &nb= sp;        shell_env.set_shell_var(k, v)=
 
             #= now confirm it exists
             i= f not os.path.exists(shell_environment.GetEnvironment().get_shell_var("= ;VS2019_PREFIX")):
--
2.18.0.windows.1




--_000_CY4PR21MB0743A8E9D41E571C463C3550EFC30CY4PR21MB0743namp_--